phdMesh  Version of the Day
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
Public Member Functions | List of all members
phdmesh::CSet Class Reference

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.
 

Detailed Description

Set of entities of arbitrary types.

Definition at line 40 of file CSet.hpp.

Member Function Documentation

template<class T >
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 ) ) { ... };
template<class T >
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 ) ) { ... };

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