JsonCpp project page | JsonCpp home page |
#include <json/value.h>
Inherited by Json::DefaultValueMapAllocator.
Public Member Functions | |
virtual | ~ValueMapAllocator () |
virtual ValueInternalMap * | newMap ()=0 |
virtual ValueInternalMap * | newMapCopy (const ValueInternalMap &other)=0 |
virtual void | destructMap (ValueInternalMap *map)=0 |
virtual ValueInternalLink * | allocateMapBuckets (unsigned int size)=0 |
virtual void | releaseMapBuckets (ValueInternalLink *links)=0 |
virtual ValueInternalLink * | allocateMapLink ()=0 |
virtual void | releaseMapLink (ValueInternalLink *link)=0 |
Below is an example of a simple implementation (default implementation actually use memory pool for speed).
class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { return new ValueInternalMap(); } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { return new ValueInternalMap( other ); } virtual void destructMap( ValueInternalMap *map ) { delete map; } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { return new ValueInternalLink(); } virtual void releaseMapLink( ValueInternalLink *link ) { delete link; } };
Definition at line 616 of file value.h.
Json::ValueMapAllocator::~ValueMapAllocator | ( | ) | [virtual] |
Definition at line 43 of file json_internalmap.inl.
virtual ValueInternalLink* Json::ValueMapAllocator::allocateMapBuckets | ( | unsigned int | size | ) | [pure virtual] |
virtual ValueInternalLink* Json::ValueMapAllocator::allocateMapLink | ( | ) | [pure virtual] |
virtual void Json::ValueMapAllocator::destructMap | ( | ValueInternalMap * | map | ) | [pure virtual] |
virtual ValueInternalMap* Json::ValueMapAllocator::newMap | ( | ) | [pure virtual] |
virtual ValueInternalMap* Json::ValueMapAllocator::newMapCopy | ( | const ValueInternalMap & | other | ) | [pure virtual] |
virtual void Json::ValueMapAllocator::releaseMapBuckets | ( | ValueInternalLink * | links | ) | [pure virtual] |
Referenced by Json::ValueInternalMap::~ValueInternalMap().
virtual void Json::ValueMapAllocator::releaseMapLink | ( | ValueInternalLink * | link | ) | [pure virtual] |
Referenced by Json::ValueInternalMap::doActualRemove(), and Json::ValueInternalMap::~ValueInternalMap().
hosts this site. |
Send comments to: Json-cpp Developers |