OpenSceneGraph/include/osg/MemoryAdapter
Robert Osfield 9917b6500d Added a copyright notice to all core headers, which all begin with
//C++ header to help scripts and editors pick up the fact that the
file is a header file.
2001-10-04 15:12:57 +00:00

42 lines
1.2 KiB
Plaintext

//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 <osg/Referenced>
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