geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael William Dodge <mdo...@pivotal.io>
Subject Re: [Discuss] Moving away from virtual CacheableStringPtr toString() for Serializable objects in debug and logging to std::string and std::wstring
Date Thu, 14 Sep 2017 18:10:47 GMT
+1 for std::string and std::wstring.

Sarge

> On 14 Sep, 2017, at 11:10, Mark Hanson <mhanson@pivotal.io> wrote:
> 
> Hi All,
> 
> I wanted to broach the subject of moving away from moving away from CacheableStringPtrs
for the toString representation of Serializable. It would seem desirable to move to std::string
and std::wstring to use more basic types that would be faster to log and the code would be
simpler for a user.
> 
> Are there any opinions on this subject? 
> 
> Here is a before and after look at a chunk of code
> 
> Before
> 
> CacheableStringPtr ptr = pdxser->toString();
> if (ptr->isWideString()) {
>  printf(" query idx %d pulled object %S  :: \n", i,
>         ptr->asWChar());
> } else {
>  printf(" query idx %d pulled object %s  :: \n", i,
>         ptr->asChar());
> }
> 
> After
> 
> 
> if (pdxser->isWideString()) {
>   std::cout << " query idx “ << i << "pulled object ” <<
 pdxser->toWString() << std::endl;
> } else {
>   std::cout << " query idx “ << i << "pulled object ” <<
 pdxser->toString() << std::endl;
> }
> 
> 
> Thanks,
> Mark


Mime
View raw message