//C++ header - Open Scene Graph - Copyright (C) 1998-2001 Robert Osfield //Distributed under the terms of the GNU Library General Public License (LGPL) //as published by the Free Software Foundation. #ifndef OSG_MEMORYADAPTER #define OSG_MEMORYADAPTER 1 #include namespace osg { /** Class for adapting the memory management of external data. * Typically used to specify the memory management of user data * which can be attached to osg::Node. */ class SG_EXPORT MemoryAdapter : public Referenced { public: MemoryAdapter() {} /** Increment the reference count of the userData.*/ virtual void ref_data(void* /*userData*/) = 0; /** Decrement the reference count of the userData. Is usually implemented such that if reference count is decremented to zero the userData should be deleted. However, this is entirely up to the discretion of the user who is extending this base class.*/ virtual void unref_data(void* /*userData*/) = 0; /** not current used, but will be used in future.*/ virtual void* clone_data(void* /*userData*/) { return 0L; } protected: virtual ~MemoryAdapter() {} }; }; #endif