Teamcenter C++ API Reference  2312
Classes | Public Types | Public Member Functions | List of all members
sm_allocator< T > Class Template Reference

Provides a way to leverage NX Storage Management (SM) for memory allocation in STL library. More...

#include <SmAllocator.hxx>

Classes

class  rebind
 

Public Types

typedef const T * const_pointer
 
typedef const T & const_reference
 
typedef std::ptrdiff_t difference_type
 
typedef T * pointer
 
typedef T & reference
 
typedef std::size_t size_type
 
typedef T value_type
 

Public Member Functions

char * _Charalloc (size_type n)
 
pointer address (reference x) const
 
const_pointer address (const_reference x) const
 
pointer allocate (size_type n, const void *=NULL)
 
void construct (pointer p, const T &val)
 
void deallocate (pointer p, size_type=0)
 
void destroy (pointer p)
 
size_type max_size () const
 
bool operator!= (const sm_allocator &) const
 
sm_allocator< T > & operator= (const sm_allocator< T > &)
 
bool operator== (const sm_allocator &) const
 
template<class U >
 sm_allocator (const sm_allocator< U > &)
 
 sm_allocator ()
 

Detailed Description

template<class T>
class sm_allocator< T >

Provides a way to leverage NX Storage Management (SM) for memory allocation in STL library.

One of the key features of SM is that allocated memory is returned to the Operating System once deallocated. This means that the memory footprint of the application just not increases, but can also decrease significantly.

class MyClass
{
public:
MyClass(const std::string& iParameter);
virtual ~MyClass();
[...]
};
typedef std::vector< MyClass, sm_allocator<MyClass> > MyClassVector;
[...]
MyClassVector.push_back( MyClassString("InstanceI") );

None of the methods defined in this class is of use to customizers.

Definition at line 75 of file SmAllocator.hxx.

Member Typedef Documentation

template<class T >
typedef const T* sm_allocator< T >::const_pointer

Definition at line 94 of file SmAllocator.hxx.

template<class T >
typedef const T& sm_allocator< T >::const_reference

Definition at line 96 of file SmAllocator.hxx.

template<class T >
typedef std::ptrdiff_t sm_allocator< T >::difference_type

Definition at line 92 of file SmAllocator.hxx.

template<class T >
typedef T* sm_allocator< T >::pointer

Definition at line 93 of file SmAllocator.hxx.

template<class T >
typedef T& sm_allocator< T >::reference

Definition at line 95 of file SmAllocator.hxx.

template<class T >
typedef std::size_t sm_allocator< T >::size_type

Definition at line 91 of file SmAllocator.hxx.

template<class T >
typedef T sm_allocator< T >::value_type

Definition at line 97 of file SmAllocator.hxx.

Constructor & Destructor Documentation

template<class T >
template<class U >
sm_allocator< T >::sm_allocator ( const sm_allocator< U > &  )
inline

Definition at line 86 of file SmAllocator.hxx.

template<class T >
sm_allocator< T >::sm_allocator ( )
inline

Definition at line 106 of file SmAllocator.hxx.

Member Function Documentation

template<class T >
char* sm_allocator< T >::_Charalloc ( size_type  n)
inline

Definition at line 126 of file SmAllocator.hxx.

template<class T >
pointer sm_allocator< T >::address ( reference  x) const
inline

Definition at line 98 of file SmAllocator.hxx.

template<class T >
const_pointer sm_allocator< T >::address ( const_reference  x) const
inline

Definition at line 102 of file SmAllocator.hxx.

template<class T >
pointer sm_allocator< T >::allocate ( size_type  n,
const void *  = NULL 
)
inline

Definition at line 113 of file SmAllocator.hxx.

template<class T >
void sm_allocator< T >::construct ( pointer  p,
const T &  val 
)
inline

Definition at line 134 of file SmAllocator.hxx.

template<class T >
void sm_allocator< T >::deallocate ( pointer  p,
size_type  = 0 
)
inline

Definition at line 130 of file SmAllocator.hxx.

template<class T >
void sm_allocator< T >::destroy ( pointer  p)
inline

Definition at line 138 of file SmAllocator.hxx.

template<class T >
size_type sm_allocator< T >::max_size ( ) const
inline

Definition at line 142 of file SmAllocator.hxx.

template<class T >
bool sm_allocator< T >::operator!= ( const sm_allocator< T > &  ) const
inline

Definition at line 156 of file SmAllocator.hxx.

template<class T >
sm_allocator<T>& sm_allocator< T >::operator= ( const sm_allocator< T > &  )
inline

Definition at line 109 of file SmAllocator.hxx.

template<class T >
bool sm_allocator< T >::operator== ( const sm_allocator< T > &  ) const
inline

Definition at line 152 of file SmAllocator.hxx.


The documentation for this class was generated from the following file: