Files
statechart/example/BitMachine/UniqueObject.hpp
Andreas Huber eb9ab82063 Added a missing cstddef includes.
[SVN r32819]
2006-02-10 20:09:26 +00:00

42 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"
#include <cstddef> // size_t
//////////////////////////////////////////////////////////////////////////////
template< class Derived >
class UniqueObject
{
public:
//////////////////////////////////////////////////////////////////////////
void * operator new( size_t size )
{
return UniqueObjectAllocator< Derived >::allocate( size );
}
void operator delete( void * p, size_t size )
{
UniqueObjectAllocator< Derived >::deallocate( p, size );
}
protected:
//////////////////////////////////////////////////////////////////////////
UniqueObject() {}
~UniqueObject() {}
};
#endif