Files
statechart/example/BitMachine/UniqueObject.hpp
Andreas Huber fc9d6004a1 - Changed the library namespace from fsm to statechart
- Changed the library name from boost::fsm to Boost.Statechart


[SVN r28788]
2005-05-10 18:24:35 +00:00

40 lines
1.1 KiB
C++

#ifndef BOOST_STATECHART_EXAMPLE_UNIQUE_OBJECT_HPP_INCLUDED
#define BOOST_STATECHART_EXAMPLE_UNIQUE_OBJECT_HPP_INCLUDED
//////////////////////////////////////////////////////////////////////////////
// (c) Copyright Andreas Huber Doenni 2002-2005
// Distributed under the Boost Software License, Version 1.0. (See accompany-
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//////////////////////////////////////////////////////////////////////////////
#include "UniqueObjectAllocator.hpp"
//////////////////////////////////////////////////////////////////////////////
template< class Derived >
class UniqueObject
{
public:
//////////////////////////////////////////////////////////////////////////
static void * operator new( size_t size )
{
return UniqueObjectAllocator< Derived >::allocate( size );
}
static void operator delete( void * p, size_t size )
{
UniqueObjectAllocator< Derived >::deallocate( p, size );
}
protected:
//////////////////////////////////////////////////////////////////////////
UniqueObject() {}
~UniqueObject() {}
};
#endif