Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
SharedObject< MC > Class Template Reference#include <SharedObject.h>
Inheritance diagram for SharedObject< MC >:
![]() Detailed Descriptiontemplate<class MC>
This templated class allows convenient creation of any type of class wrapped in a shared memory region.
|
Public Member Functions | |
virtual | ~SharedObject () |
destructor, removes reference to shared region | |
MC * | operator-> () const |
smart pointer to the underlying class | |
MC & | operator * () const |
smart pointer to the underlying class | |
MC & | operator[] (int i) const |
smart pointer to the underlying class | |
templated contructors - allows you to pass constructor arguments on to the object being created | |
if you really need more than 5 arguments for your class, well, you're one crazy puppy but if you really want to, just make more like shown... (yay templates!) | |
SharedObject () | |
Creates the class with the default constructor. | |
template<class T1> | |
SharedObject (const T1 &t1) | |
Creates the class, passing its constructor t1. | |
template<class T1, class T2> | |
SharedObject (const T1 &t1, const T2 &t2) | |
Creates the class, passing its constructor t1 and t2. | |
template<class T1, class T2, class T3> | |
SharedObject (const T1 &t1, const T2 &t2, const T3 &t3) | |
Creates the class, passing its constructor t1, t2, and t3. | |
template<class T1, class T2, class T3, class T4> | |
SharedObject (const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4) | |
Creates the class, passing its constructor t1, t2, t3 and t4. | |
template<class T1, class T2, class T3, class T4, class T5> | |
SharedObject (const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5) | |
Creates the class, passing its constructor t1, t2, t3, t4 and t5 - if you need more arguments, just add them. | |
SharedObject (RCRegion *r) | |
Constructs from a pre-existing region, laying claim to the caller's reference to the region - region's creator is responsible for initialization. | |
Protected Member Functions | |
MC * | dataCasted () const |
returns a correctly typed pointer to the object's memory | |
virtual void | removeRef () |
removes a reference from rcr, and if necessary, destructs its data | |
Static Protected Member Functions | |
static RCRegion * | createRCRegion () |
creates and returns RCRegion of correct size for current class. Adds a reference (which is removed in the destructor) | |
static unsigned int | calcsize () |
Calculates the size of the memory region to be used, (on Aperios, rounding up to the nearest page size). |
SharedObject< MC >::SharedObject | ( | ) | [inline] |
SharedObject< MC >::SharedObject | ( | const T1 & | t1 | ) | [inline, explicit] |
SharedObject< MC >::SharedObject | ( | const T1 & | t1, | |
const T2 & | t2 | |||
) | [inline] |
SharedObject< MC >::SharedObject | ( | const T1 & | t1, | |
const T2 & | t2, | |||
const T3 & | t3 | |||
) | [inline] |
Creates the class, passing its constructor t1, t2, and t3.
Definition at line 73 of file SharedObject.h.
SharedObject< MC >::SharedObject | ( | const T1 & | t1, | |
const T2 & | t2, | |||
const T3 & | t3, | |||
const T4 & | t4 | |||
) | [inline] |
Creates the class, passing its constructor t1, t2, t3 and t4.
Definition at line 78 of file SharedObject.h.
SharedObject< MC >::SharedObject | ( | const T1 & | t1, | |
const T2 & | t2, | |||
const T3 & | t3, | |||
const T4 & | t4, | |||
const T5 & | t5 | |||
) | [inline] |
Creates the class, passing its constructor t1, t2, t3, t4 and t5 - if you need more arguments, just add them.
Definition at line 83 of file SharedObject.h.
SharedObject< MC >::SharedObject | ( | RCRegion * | r | ) | [inline, explicit] |
Constructs from a pre-existing region, laying claim to the caller's reference to the region - region's creator is responsible for initialization.
In other words, this SharedObject doesn't AddReference, but will RemoveReference when the time is right (upon destruction). If you want to maintain an reference of your own to the region, you will need to call AddReference yourself.
Definition at line 93 of file SharedObject.h.
virtual SharedObject< MC >::~SharedObject | ( | ) | [inline, virtual] |
MC* SharedObject< MC >::operator-> | ( | ) | const [inline] |
MC& SharedObject< MC >::operator * | ( | ) | const [inline] |
MC& SharedObject< MC >::operator[] | ( | int | i | ) | const [inline] |
MC* SharedObject< MC >::dataCasted | ( | ) | const [inline, protected] |
returns a correctly typed pointer to the object's memory
Definition at line 114 of file SharedObject.h.
Referenced by SharedObject< UPennWalkMC >::operator *(), SharedObject< UPennWalkMC >::operator->(), SharedObject< UPennWalkMC >::operator[](), and SharedObject< UPennWalkMC >::removeRef().
virtual void SharedObject< MC >::removeRef | ( | ) | [inline, protected, virtual] |
removes a reference from rcr, and if necessary, destructs its data
Implements SharedObjectBase.
Definition at line 117 of file SharedObject.h.
Referenced by SharedObject< UPennWalkMC >::~SharedObject().
static RCRegion* SharedObject< MC >::createRCRegion | ( | ) | [inline, static, protected] |
creates and returns RCRegion of correct size for current class. Adds a reference (which is removed in the destructor)
Definition at line 131 of file SharedObject.h.
Referenced by SharedObject< UPennWalkMC >::SharedObject().
static unsigned int SharedObject< MC >::calcsize | ( | ) | [inline, static, protected] |
Calculates the size of the memory region to be used, (on Aperios, rounding up to the nearest page size).
Not sure this is completely necessary, but may be nice. Of course, this also means even small regions are going to be at least 4K (current page size) If memory gets tight or we get a lot of little regions floating around, this might be worth checking into
PLATFORM_APERIOS
Definition at line 155 of file SharedObject.h.
Referenced by SharedObject< UPennWalkMC >::createRCRegion().
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:41 2007 by Doxygen 1.5.4 |