From: Marty K. <mrk...@co...> - 2010-08-02 17:12:58
|
On 08/02/2010 09:42 AM, jam...@di... wrote: > Hi > Some suggestions for discussion: > 1) Return std::string instead of shared_ptr<std::string>, the > implementation of std::string is typically shared anway. Note that the java implementation of pvData, etc relies heavily on the fact that: 1) A String is an immutable object. 2) A String is garbage collected. Don't we have to provide the same semantics for the c++ implementation? For a simple example assume that a record contains a Field object that is not shared with any other record. It has a fieldName, which is a string. If the record is removed from the database, which is possible with pvData, etc, then the string field must be garbage collected or else we leak memory. Am I missing something about how std::string is implemented? > 2) Don't use virtual inheritance ( Nikolay has covered that ). > I do not understand. Why not? I assume that pure virtual base classes are the C++ equivalent of a Java interface. Marty > I'll wait for the mercurial repository before further comments (I've > asked to be added as a developer so I can do the import if required). > |