Controller< T > Class Template Reference
Controller template. Helps managing a collection of objects.
More...
#include <Controller.h>
List of all members.
Detailed Description
template<class T>
class Controller< T >
Controller template. Helps managing a collection of objects.
Member Typedef Documentation
Constructor & Destructor Documentation
Member Function Documentation
Internal creation function.
Try to create a new object instance and insert it in the map. Return a new instance or throw an exception if already exists. Each specialization of the Controller template should *
- Parameters:
-
| s | the key of the object in the map |
- Returns:
- a pointer to the freshly created object or the already existing object
template<class T>
bool Controller< T >::check_remove |
( |
T |
obj |
) |
[inline, private] |
Scan the ObjectMap and destroy the instances that are not referenced. Before destruction, calls the prepareCleanup of each referenced object. This step depends on each Controller specialization.
- Returns:
- the number of instances removed
Find an object using the key and return a pointer to it.
- Parameters:
-
- Returns:
- a pointer to the object if found. NULL otherwise.
Allows access to the object map
- Returns:
- a pair of iterators (begin, end)
template<class T >
void Controller< T >::registerReference |
( |
string |
s |
) |
[inline] |
Tells the controller to consider the instance referenced as in use.
Increments the accounting map for this reference
- Parameters:
-
| s | the reference of the instance to register as used. |
template<class T >
bool Controller< T >::remove |
( |
string |
s |
) |
[inline] |
remove an object from collection
- Parameters:
-
| s | the key of the object to remove |
- Returns:
- true if removed, false otherwise
template<class T >
void Controller< T >::unregisterReference |
( |
string |
s |
) |
[inline] |
Tells the controller that one reference to the given instance is not used anymore.
- Parameters:
-
| s | the reference of the instance to register as used. |
Member Data Documentation
The documentation for this class was generated from the following file:
- /home/gomez/Documents/workspaces/treqs/treqs/src/Controller.h