|
| FFaReferenceList< Type > & | operator= (const std::vector< Type * > &ptrs) |
| | Overloaded assignment operator. More...
|
| |
| void | push_front (Type *ptr, bool insertNullToo=false) |
| | Inserts ptr in the front of the list. More...
|
| |
| void | push_back (Type *ptr, bool insertNullToo=false) |
| | Inserts ptr at the end of the list. More...
|
| |
| void | insertPtrAfter (Type *ptr, Type *objInList=NULL) |
| | Insert ptr after objInList in the list. More...
|
| |
| void | insert (Type *ptr, size_t idx=0) |
| | Inserts ptr at position idx in the list. More...
|
| |
| void | getPtrs (std::vector< Type * > &toFill, bool includeNullToo=false) const |
| | Fills the provided vector with the pointers contained in the list. More...
|
| |
| void | setPtrs (const std::vector< Type * > &ptrs) |
| | Replaces the current contents with the provided vector of pointers. More...
|
| |
| void | setRefs (const IntVec &IDs) |
| | Replaces the current contents with the provided new references. More...
|
| |
| FFaReference< Type > & | operator[] (int idx) |
| | Indexing operator (for update). More...
|
| |
| const FFaReference< Type > & | operator[] (int idx) const |
| | Indexing operator (for read only). More...
|
| |
| void | setPtr (Type *ptr, int idx) |
| | Assigns ptr at position idx. More...
|
| |
| Type * | getPtr (int idx) const |
| | Returns the pointer at position idx. More...
|
| |
| Type * | getFirstPtr () const |
| | Returns the first pointer, or NULL if myRefs is empty. More...
|
| |
| Type * | getLastPtr () const |
| | Returns the last pointer, or NULL if myRefs is empty. More...
|
| |
| void | setAutoSizing (bool onOrOff) |
| | Sets the autoSizing flag. More...
|
| |
| bool | isAutoSizing () const |
| | Returns the value of the autoSizing flag. More...
|
| |
| void | setContextName (const char *name) |
| | Assigns the context name myContext for this reference. More...
|
| |
| const char * | getContextName () const |
| | Returns the context name myContext used by this reference. More...
|
| |
| bool | erase (int index) |
| | Erases entry index from the list, decrementing its size by one. More...
|
| |
| void | clear () |
| | Clears the reference list. More...
|
| |
| bool | shuffle (size_t newFirst) |
| | Reorders the elements in the list. More...
|
| |
| void | reverse () |
| | Inverts the element order in the list. More...
|
| |
| void | removePtr (const FFaFieldContainer *ptr) |
| | Removes all instances of ptr from this list. More...
|
| |
| void | zeroOutPtr (const FFaFieldContainer *ptr) |
| | Sets all instances of ptr in this list to zero. More...
|
| |
| bool | hasPtr (const FFaFieldContainer *ptr, int *index=NULL) const |
| | Returns true if ptr is present in the list. More...
|
| |
| void | getBasePtrs (std::vector< FFaFieldContainer * > &toFill) const |
| | Fills provided vector with the non-NULL pointers in the list. More...
|
| |
| FFaFieldContainer * | getBasePtr (int idx) const |
| | Returns the pointer to the idx'th member in the list. More...
|
| |
| size_t | size () const |
| | Returns the length of myRefs,. More...
|
| |
| bool | empty () const |
| | Returns true if myRefs is empty (zero length). More...
|
| |
| void | write (std::ostream &os) const |
| | Writes the reference list to specified output stream. More...
|
| |
| void | read (std::istream &is) |
| | Reads the reference list from specified input stream. More...
|
| |
template<class Type>
class FFaReferenceList< Type >
A container of FFaReference objects (guarded pointers).
This class provides a container of guarded pointers (FFaReference) that can be used in classes derived from FFaFieldContainer to refer to several objects of classes derived from FFaFieldContainer. The class can be used in two modes: Either like a vector/array with elements automatically set to zero when referred objects are deleted, or like a list where the references/pointers are deleted from the list when the objects referred to cease to exist.
One of the main reasons to use this class is to use it together with FFaField and get automated IO of the list of references. To use this feature, the FFaFieldContainer derived class containing the reference needs an FFaField<FFaReferenceListBase*> object that is initialized with the address of the FFaReferenceList to read/write:
{
};
FmNewClass::FmNewClass()
{
this->addRefList(&someClassReferences);
FFA_FIELD_INIT(someWrittenReferences,&someClassReferences,
"FILE_KEY_WORD");
}
#define FFA_FIELD_INIT(field, defaultValue, identifier)
Adds a named field to *this with specified default value.
Definition: FFaFieldContainer.H:228
Base class for the FEDEM model database structure.
Definition: FFaFieldContainer.H:39
A container of FFaReference objects (guarded pointers).
Definition: FFaReferenceList.H:194