phdMesh
Version of the Day
|
Set of entities of arbitrary types. More...
#include <CSet.hpp>
Public Member Functions | |
template<class T > | |
const T * | get () const |
Get member conforming to the given type T . Return NULL if there is no member of that type. | |
template<class T > | |
const T * | insert_with_delete (const T *) |
Insert a member of a given type T and invoke the delete operator on destruction. More... | |
template<class T > | |
const T * | insert_no_delete (const T *) |
Insert a member of a given type T but never invoke the delete operator. More... | |
template<class T > | |
bool | remove (const T *) |
Remove a member of the given type without deleting it. The caller assumes responsibility for the removed member. Return if the remove operation was successful. | |
const T* phdmesh::CSet::insert_with_delete | ( | const T * | ) |
Insert a member of a given type T and invoke the delete operator on destruction.
If a member of the given type already exists then the insertion operation fails and the existing member is returned. If the insertion succeeds then the inserted member is returned. For example:
CSet & container = ... ; const A * const a = new A(); if ( a == container.insert_with_delete( a ) ) { ... };
const T* phdmesh::CSet::insert_no_delete | ( | const T * | ) |
Insert a member of a given type T but never invoke the delete operator.
If a member of the given type already exists then the insertion operation fails and the existing member is returned. If the insertion succeeds then the inserted member is returned. For example:
CSet & container = ... ; const A * const a = new A(); if ( a == container.insert_with_delete( a ) ) { ... };