Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

SharedObjectBase Class Reference

It's nice to have a parent class of SharedObject (which is what you probably want to be reading) so that you can pass around the data structure without worrying about what type is inside the shared memory region. More...

#include <SharedObject.h>

Inheritance diagram for SharedObjectBase:

Detailed Description

It's nice to have a parent class of SharedObject (which is what you probably want to be reading) so that you can pass around the data structure without worrying about what type is inside the shared memory region.

See MotionManager for an example on how to use this.

Definition at line 11 of file SharedObject.h.

List of all members.

Classes

struct  NoInit
 when passed to the SharedObject constructor, indicates that no RCRegion should be created More...

Public Member Functions

void * data () const
 returns a pointer to the data region
RCRegiongetRegion () const
 returns the OPEN-R memory region, should you need it
virtual ~SharedObjectBase ()
 destructor
SharedObjectBaseoperator= (const SharedObjectBase &sob)
 assignment, adds a reference to the existing region (shallow copy)

Static Public Member Functions

static unsigned int getNextKey ()
 return the next region serial number -- doesn't actually increment it though, repeated calls will return the same value until the value is actually used

Protected Member Functions

 SharedObjectBase ()
 constructor, protected because you shouldn't need to create this directly, just a common interface to all templates of SharedObject
 SharedObjectBase (const SharedObjectBase &sob)
 copy constructor, adds a reference to the existing region (shallow copy)
virtual void removeRef ()=0
 removes a reference from rcr, and if necessary, destructs its data

Protected Attributes

RCRegionrcr
 the pointer to the shared memory region this is in charge of

Static Protected Attributes

static unsigned int serialNumber = 0
 incremented for each region created so they will all have unique IDs

Constructor & Destructor Documentation

virtual SharedObjectBase::~SharedObjectBase (  )  [virtual]

destructor

Definition at line 19 of file SharedObject.h.

SharedObjectBase::SharedObjectBase (  )  [protected]

constructor, protected because you shouldn't need to create this directly, just a common interface to all templates of SharedObject

Definition at line 39 of file SharedObject.h.

SharedObjectBase::SharedObjectBase ( const SharedObjectBase sob  )  [protected]

copy constructor, adds a reference to the existing region (shallow copy)

Definition at line 41 of file SharedObject.h.


Member Function Documentation

void* SharedObjectBase::data (  )  const

returns a pointer to the data region

Definition at line 16 of file SharedObject.h.

Referenced by SharedObject< UPennWalkMC >::dataCasted(), and MotionManager::doAddMotion().

static unsigned int SharedObjectBase::getNextKey (  )  [static]

return the next region serial number -- doesn't actually increment it though, repeated calls will return the same value until the value is actually used

Definition at line 23 of file SharedObject.h.

RCRegion* SharedObjectBase::getRegion (  )  const

returns the OPEN-R memory region, should you need it

Definition at line 17 of file SharedObject.h.

Referenced by BehaviorBase::addMotion(), MotionManager::doAddMotion(), and MotionManager::removeMotion().

SharedObjectBase& SharedObjectBase::operator= ( const SharedObjectBase sob  ) 

assignment, adds a reference to the existing region (shallow copy)

Definition at line 27 of file SharedObject.h.

virtual void SharedObjectBase::removeRef (  )  [protected, pure virtual]

Member Data Documentation

the pointer to the shared memory region this is in charge of

Definition at line 49 of file SharedObject.h.

Referenced by data(), getRegion(), operator=(), SharedObject< UPennWalkMC >::removeRef(), SharedObject< UPennWalkMC >::SharedObject(), and SharedObjectBase().

unsigned int SharedObjectBase::serialNumber = 0 [static, protected]

incremented for each region created so they will all have unique IDs

Definition at line 52 of file SharedObject.h.

Referenced by SharedObject< UPennWalkMC >::createRCRegion(), and getNextKey().


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:16 2016 by Doxygen 1.6.3