OpenDDS::DCPS::SafetyProfilePool Class Reference

Memory pool for use when the Safety Profile is enabled. More...

#include <SafetyProfilePool.h>

Inheritance diagram for OpenDDS::DCPS::SafetyProfilePool:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::SafetyProfilePool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SafetyProfilePool ()
 ~SafetyProfilePool ()
void configure_pool (size_t size, size_t granularity)
void install ()
void * malloc (std::size_t size)
void free (void *ptr)
void * calloc (std::size_t bytes, char init= '\0')
void * calloc (std::size_t elems, std::size_t size, char init= '\0')
int remove ()
int bind (const char *, void *, int=0)
int trybind (const char *, void *&)
int find (const char *, void *&)
int find (const char *)
int unbind (const char *, void *&)
int unbind (const char *)
int sync (ssize_t=-1, int=MS_SYNC)
int sync (void *, size_t, int=MS_SYNC)
int protect (ssize_t=-1, int=PROT_RDWR)
int protect (void *, size_t, int=PROT_RDWR)
void dump () const

Static Public Member Functions

static SafetyProfilePoolinstance ()
 Return a singleton instance of this class.

Private Member Functions

 SafetyProfilePool (const SafetyProfilePool &)
SafetyProfilePooloperator= (const SafetyProfilePool &)

Private Attributes

MemoryPoolmain_pool_
ACE_Thread_Mutex lock_

Static Private Attributes

static SafetyProfilePoolinstance_

Friends

class SafetyProfilePoolTest
class InstanceMaker

Detailed Description

Memory pool for use when the Safety Profile is enabled.

Saftey Profile disallows std::free() and the delete operators See PoolAllocator.h for a class that allows STL containers to use an instance of SafetyProfilePool managed by our Service_Participant singleton.

Definition at line 34 of file SafetyProfilePool.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::SafetyProfilePool::SafetyProfilePool (  ) 
OpenDDS::DCPS::SafetyProfilePool::~SafetyProfilePool (  ) 
OpenDDS::DCPS::SafetyProfilePool::SafetyProfilePool ( const SafetyProfilePool  )  [private]

Member Function Documentation

int OpenDDS::DCPS::SafetyProfilePool::bind ( const char *  ,
void *  ,
int  = 0 
) [inline, virtual]

Implements ACE_Allocator.

Definition at line 69 of file SafetyProfilePool.h.

00069 { return -1; }

void* OpenDDS::DCPS::SafetyProfilePool::calloc ( std::size_t  elems,
std::size_t  size,
char  init = '\0' 
) [inline]

Definition at line 63 of file SafetyProfilePool.h.

References calloc(), and init().

00064   {
00065     return calloc(elems * size, init);
00066   }

Here is the call graph for this function:

void* OpenDDS::DCPS::SafetyProfilePool::calloc ( std::size_t  bytes,
char  init = '\0' 
) [inline]

Definition at line 56 of file SafetyProfilePool.h.

References calloc(), init(), and malloc().

00057   {
00058     void* const mem = malloc(bytes);
00059     std::memset(mem, init, bytes);
00060     return mem;
00061   }

Here is the call graph for this function:

void OpenDDS::DCPS::SafetyProfilePool::configure_pool ( size_t  size,
size_t  granularity 
)
void OpenDDS::DCPS::SafetyProfilePool::dump ( void   )  const [inline, virtual]

Implements ACE_Allocator.

Definition at line 79 of file SafetyProfilePool.h.

00079 {}

int OpenDDS::DCPS::SafetyProfilePool::find ( const char *   )  [inline, virtual]

Implements ACE_Allocator.

Definition at line 72 of file SafetyProfilePool.h.

00072 { return -1; }

int OpenDDS::DCPS::SafetyProfilePool::find ( const char *  ,
void *&   
) [inline, virtual]

Implements ACE_Allocator.

Definition at line 71 of file SafetyProfilePool.h.

00071 { return -1; }

void OpenDDS::DCPS::SafetyProfilePool::free ( void *  ptr  )  [inline, virtual]

Implements ACE_Allocator.

Definition at line 50 of file SafetyProfilePool.h.

References free().

00051   {
00052     ACE_GUARD(ACE_Thread_Mutex, lock, lock_);
00053     main_pool_->pool_free(ptr);
00054   }

Here is the call graph for this function:

void OpenDDS::DCPS::SafetyProfilePool::install (  ) 
static SafetyProfilePool* OpenDDS::DCPS::SafetyProfilePool::instance (  )  [static]

Return a singleton instance of this class.

Reimplemented from ACE_Allocator.

Referenced by OpenDDS::RTPS::GuidGenerator::interfaceName().

Here is the caller graph for this function:

void* OpenDDS::DCPS::SafetyProfilePool::malloc ( std::size_t  size  )  [inline]

Definition at line 44 of file SafetyProfilePool.h.

References malloc().

00045   {
00046     ACE_GUARD_RETURN(ACE_Thread_Mutex, lock, lock_, 0);
00047     return main_pool_->pool_alloc(size);
00048   }

Here is the call graph for this function:

SafetyProfilePool& OpenDDS::DCPS::SafetyProfilePool::operator= ( const SafetyProfilePool  )  [private]
int OpenDDS::DCPS::SafetyProfilePool::protect ( void *  ,
size_t  ,
int  = PROT_RDWR 
) [inline]

Definition at line 78 of file SafetyProfilePool.h.

00078 { return -1; }

int OpenDDS::DCPS::SafetyProfilePool::protect ( ssize_t  = -1,
int  = PROT_RDWR 
) [inline, virtual]

Implements ACE_Allocator.

Definition at line 77 of file SafetyProfilePool.h.

00077 { return -1; }

int OpenDDS::DCPS::SafetyProfilePool::remove ( void   )  [inline, virtual]

Implements ACE_Allocator.

Definition at line 68 of file SafetyProfilePool.h.

00068 { return -1; }

int OpenDDS::DCPS::SafetyProfilePool::sync ( void *  ,
size_t  ,
int  = MS_SYNC 
) [inline]

Definition at line 76 of file SafetyProfilePool.h.

00076 { return -1; }

int OpenDDS::DCPS::SafetyProfilePool::sync ( ssize_t  = -1,
int  = MS_SYNC 
) [inline, virtual]

Implements ACE_Allocator.

Definition at line 75 of file SafetyProfilePool.h.

00075 { return -1; }

int OpenDDS::DCPS::SafetyProfilePool::trybind ( const char *  ,
void *&   
) [inline, virtual]

Implements ACE_Allocator.

Definition at line 70 of file SafetyProfilePool.h.

00070 { return -1; }

int OpenDDS::DCPS::SafetyProfilePool::unbind ( const char *   )  [inline, virtual]

Implements ACE_Allocator.

Definition at line 74 of file SafetyProfilePool.h.

00074 { return -1; }

int OpenDDS::DCPS::SafetyProfilePool::unbind ( const char *  ,
void *&   
) [inline, virtual]

Implements ACE_Allocator.

Definition at line 73 of file SafetyProfilePool.h.

00073 { return -1; }


Friends And Related Function Documentation

friend class InstanceMaker [friend]

Definition at line 91 of file SafetyProfilePool.h.

friend class SafetyProfilePoolTest [friend]

Definition at line 36 of file SafetyProfilePool.h.


Member Data Documentation

Definition at line 90 of file SafetyProfilePool.h.

Definition at line 89 of file SafetyProfilePool.h.

Definition at line 88 of file SafetyProfilePool.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1