CSGEngUnitList is a non-owning index of CSGEngUnit objects stored in the type lists (CSGSurfaceList, CSGCellList, CSGUniverseList) of a CSGBase instance. More...
#include <CSGEngUnitList.h>
Protected Member Functions | |
| CSGEngUnitList () | |
| Default constructor. More... | |
| virtual | ~CSGEngUnitList ()=default |
| Destructor. More... | |
| bool | hasEngUnit (const std::string &name) const |
| Return whether an engineering unit with the given name exists in this list. More... | |
| std::vector< std::reference_wrapper< const CSGEngUnit > > | getAllEngUnits () const |
| Get all engineering units of all types in the list. More... | |
| std::vector< std::reference_wrapper< const CSGSurfaceEngUnit > > | getAllSurfaceEngUnits () const |
| Get all surface-like engineering units. More... | |
| std::vector< std::reference_wrapper< const CSGCellEngUnit > > | getAllCellEngUnits () const |
| Get all cell-like engineering units. More... | |
| std::vector< std::reference_wrapper< const CSGUniverseEngUnit > > | getAllUniverseEngUnits () const |
| Get all universe-like engineering units. More... | |
| CSGEngUnit & | addEngUnit (CSGEngUnit &unit) |
| Register an engineering unit in this index. More... | |
| CSGEngUnit & | getEngUnit (const std::string &name) const |
| Get an engineering unit by name. More... | |
| void | removeEngUnit (const CSGEngUnit &unit) |
| Remove an engineering unit from this index by address. More... | |
| bool | operator== (const CSGEngUnitList &other) const |
| Operator overload for checking if two CSGEngUnitList objects are equal. More... | |
| bool | operator!= (const CSGEngUnitList &other) const |
| Operator overload for checking if two CSGEngUnitList objects are not equal. More... | |
Protected Attributes | |
| std::vector< CSGEngUnit * > | _eng_units |
| Non-owning index: raw pointers into the type lists. More... | |
Friends | |
| class | CSGBase |
CSGEngUnitList is a non-owning index of CSGEngUnit objects stored in the type lists (CSGSurfaceList, CSGCellList, CSGUniverseList) of a CSGBase instance.
It provides lookup by name and typed queries without holding ownership of the objects.
A vector of raw pointers is used rather than a name-keyed map so that renames require no index update. The object's name is updated in-place by the owning type list, and the pointer in this vector automatically reflects the new name.
Definition at line 28 of file CSGEngUnitList.h.
|
protected |
|
protectedvirtualdefault |
Destructor.
|
protected |
Register an engineering unit in this index.
The object must already be owned by the appropriate type list (CSGSurfaceList, CSGCellList, or CSGUniverseList).
Throws if an engineering unit with the given name already exists.
| unit | reference to the engineering unit to register (non-owning) |
Definition at line 18 of file CSGEngUnitList.C.
Referenced by CSG::CSGBase::addEngUnit(), and CSG::CSGBase::rebuildEngUnitList().
|
protected |
Get all cell-like engineering units.
Definition at line 64 of file CSGEngUnitList.C.
Referenced by CSG::CSGBase::getAllCellEngUnits().
|
protected |
Get all engineering units of all types in the list.
Definition at line 45 of file CSGEngUnitList.C.
Referenced by CSG::CSGBase::getAllEngUnits(), and operator==().
|
protected |
Get all surface-like engineering units.
Definition at line 54 of file CSGEngUnitList.C.
Referenced by CSG::CSGBase::getAllSurfaceEngUnits().
|
protected |
Get all universe-like engineering units.
Definition at line 74 of file CSGEngUnitList.C.
Referenced by CSG::CSGBase::getAllUniverseEngUnits().
|
protected |
Get an engineering unit by name.
| name | name of the engineering unit |
Definition at line 28 of file CSGEngUnitList.C.
Referenced by CSG::CSGBase::addTransformation(), CSG::CSGBase::checkEngUnitInBase(), CSG::CSGBase::getEngUnitByName(), and operator==().
|
inlineprotected |
Return whether an engineering unit with the given name exists in this list.
| name | name of the engineering unit |
Definition at line 47 of file CSGEngUnitList.h.
Referenced by addEngUnit(), CSG::CSGBase::addEngUnit(), CSG::CSGBase::hasEngUnit(), CSG::CSGBase::renameCell(), CSG::CSGBase::renameSurface(), and CSG::CSGBase::renameUniverse().
|
protected |
Operator overload for checking if two CSGEngUnitList objects are not equal.
Definition at line 103 of file CSGEngUnitList.C.
|
protected |
Operator overload for checking if two CSGEngUnitList objects are equal.
Definition at line 84 of file CSGEngUnitList.C.
|
protected |
Remove an engineering unit from this index by address.
Called by CSGBase when a unit is deleted or expanded. Does not affect ownership because the object is destroyed by the owning type list.
| unit | reference to the engineering unit to remove |
Definition at line 37 of file CSGEngUnitList.C.
Referenced by CSG::CSGBase::deleteCell(), CSG::CSGBase::deleteSurface(), and CSG::CSGBase::deleteUniverse().
|
friend |
Definition at line 123 of file CSGEngUnitList.h.
|
protected |
Non-owning index: raw pointers into the type lists.
Rename does not require updating this vector because the pointed-to object's name is updated in-place by the type list.
Definition at line 120 of file CSGEngUnitList.h.
Referenced by addEngUnit(), getAllCellEngUnits(), getAllEngUnits(), getAllSurfaceEngUnits(), getAllUniverseEngUnits(), getEngUnit(), hasEngUnit(), and removeEngUnit().
1.8.14