Darwin  1.10(beta)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
drwnTableFactorStorage Class Reference

Shared memory for table factors. More...

Public Member Functions

 drwnTableFactorStorage (int nSize=0)
 
int capacity () const
 return the total capacity of the storage
 
void reserve (int nSize)
 reserve capacity for nSize entries
 
void zero (int nSize=-1)
 set nSize (or all) entries to zero
 
void fill (double v, int nSize=-1)
 set nSize (or all) entries to the value v
 
void copy (const double *p, int nSize=-1)
 copy nSize (or all) entries from array p
 
void copy (const drwnTableFactorStorage *p, int nSize=-1)
 copy nSize (or all) entries from storage object p
 
double & operator[] (unsigned index)
 
const double & operator[] (unsigned index) const
 

Protected Member Functions

void registerFactor (drwnTableFactor *factor)
 registers the factor with the storage so that data pointer can be updated when storage location changes
 
void unregisterFactor (drwnTableFactor *factor)
 unregisters a factor with the storage
 

Protected Attributes

int _dataSize
 amount of memory allocated
 
double * _data
 memory allocation
 
set< drwnTableFactor * > _tables
 tables using this storage
 

Friends

class drwnTableFactor
 

Detailed Description

Shared memory for table factors.

Warning
Shared storage cannot be deleted until all factors using the storage have been deleted (i.e., unregistered). This means that if factors in a graph are using shared storage then the graph must be destroyed before the storage can be deleted.

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