Homepage Demos Overview Downloads Tutorials Reference
Credits

SharedObject< MC > Class Template Reference

#include <SharedObject.h>

Inheritance diagram for SharedObject< MC >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class MC>
class SharedObject< MC >

This templated class allows convenient creation of any type of class wrapped in a shared memory region.

See also:
MotionManager for an example on how to use this.

Definition at line 36 of file SharedObject.h.

Public Member Functions

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 (T1 t1)
 Creates the class, passing its constructor t1.
template<class T1, class T2>
 SharedObject (T1 t1, T2 t2)
 Creates the class, passing its constructor t1 and t2.
template<class T1, class T2, class T3>
 SharedObject (T1 t1, T2 t2, T3 t3)
 Creates the class, passing its constructor t1, t2, and t3.
template<class T1, class T2, class T3, class T4>
 SharedObject (T1 t1, T2 t2, T3 t3, 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 (T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)
 Creates the class, passing its constructor t1, t2, t3, t4 and t5 - if you need more arguments, just add them.

Protected Member Functions

MC * dataCasted () const
 returns a correctly typed pointer to the object's memory

Static Protected Member Functions

RCRegion * createRCRegion ()
 creates and returns RCRegion of correct size for current class. Adds a reference (which is removed in the destructor)
unsigned int calcsize ()
 Calculates the size of the memory region to be used, rounding up to the nearest page size.


Constructor & Destructor Documentation

template<class MC>
SharedObject< MC >::SharedObject  )  [inline]
 

Creates the class with the default constructor.

Definition at line 42 of file SharedObject.h.

template<class MC>
template<class T1>
SharedObject< MC >::SharedObject T1  t1  )  [inline]
 

Creates the class, passing its constructor t1.

Definition at line 47 of file SharedObject.h.

template<class MC>
template<class T1, class T2>
SharedObject< MC >::SharedObject T1  t1,
T2  t2
[inline]
 

Creates the class, passing its constructor t1 and t2.

Definition at line 52 of file SharedObject.h.

template<class MC>
template<class T1, class T2, class T3>
SharedObject< MC >::SharedObject T1  t1,
T2  t2,
T3  t3
[inline]
 

Creates the class, passing its constructor t1, t2, and t3.

Definition at line 57 of file SharedObject.h.

template<class MC>
template<class T1, class T2, class T3, class T4>
SharedObject< MC >::SharedObject T1  t1,
T2  t2,
T3  t3,
T4  t4
[inline]
 

Creates the class, passing its constructor t1, t2, t3 and t4.

Definition at line 62 of file SharedObject.h.

template<class MC>
template<class T1, class T2, class T3, class T4, class T5>
SharedObject< MC >::SharedObject T1  t1,
T2  t2,
T3  t3,
T4  t4,
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 67 of file SharedObject.h.


Member Function Documentation

template<class MC>
unsigned int SharedObject< MC >::calcsize  )  [inline, static, protected]
 

Calculates the size of the memory region to be used, 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

Definition at line 91 of file SharedObject.h.

Referenced by SharedObject< OldHeadPointerMC >::createRCRegion().

template<class MC>
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 78 of file SharedObject.h.

Referenced by SharedObject< OldHeadPointerMC >::SharedObject().

template<class MC>
MC* SharedObject< MC >::dataCasted  )  const [inline, protected]
 

returns a correctly typed pointer to the object's memory

Definition at line 85 of file SharedObject.h.

Referenced by SharedObject< OldHeadPointerMC >::operator *(), SharedObject< OldHeadPointerMC >::operator->(), and SharedObject< OldHeadPointerMC >::operator[]().

template<class MC>
MC& SharedObject< MC >::operator *  )  const [inline]
 

smart pointer to the underlying class

Definition at line 74 of file SharedObject.h.

template<class MC>
MC* SharedObject< MC >::operator->  )  const [inline]
 

smart pointer to the underlying class

Definition at line 73 of file SharedObject.h.

template<class MC>
MC& SharedObject< MC >::operator[] int  i  )  const [inline]
 

smart pointer to the underlying class

Definition at line 75 of file SharedObject.h.


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

Tekkotsu v2.2.1
Generated Tue Nov 23 16:37:51 2004 by Doxygen 1.3.9.1