|
FEDEM Model Database
R8.0
Source code of the FEDEM model database
|
The base class for FFaReferenceList. More...
#include <FFaReferenceList.H>


Public Member Functions | |
| 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... | |
Protected Types | |
| using | FFaReferenceList = std::list< FFaReferenceBase * > |
| Convenience type alias. More... | |
Protected Member Functions | |
| FFaReferenceListBase () | |
| The default constructor initializes the members. More... | |
| virtual | ~FFaReferenceListBase () |
| The destructor clears the list. More... | |
| void | insertRefLast (FFaReferenceBase *ref) |
| Appends a reference to the end of myRefs. More... | |
| virtual FFaReferenceBase * | createNewReference () const =0 |
| Virtual method for creating a FFaReference of correct type. More... | |
| FFaReferenceList::const_iterator | findPtr (const FFaFieldContainer *ptr) const |
| Returns a const_iterator matching a FFaFieldContainer pointer. More... | |
| FFaReferenceList::iterator | findPtr (const FFaFieldContainer *ptr) |
| Returns an iterator matching a FFaFieldContainer pointer. More... | |
| FFaReferenceBase * | getRefBase (int idx) const |
| Returns the pointer at index idx. More... | |
| void | setOwnerOnRef (FFaReferenceBase *pt) |
| Sets this list as the owner of the reference pt. More... | |
| void | copy (const FFaReferenceListBase *other, bool unresolve=false) |
| Copy method used by copy constructors, etc. More... | |
Protected Attributes | |
| FFaReferenceList | myRefs |
| The actual list of references. More... | |
Private Member Functions | |
| FFaReferenceListBase (const FFaReferenceListBase &)=delete | |
| Remove implicitly defined copy constructor. More... | |
| FFaReferenceListBase & | operator= (const FFaReferenceListBase &)=delete |
| Remove implicitly defined assignment operator,. More... | |
| void | setOwnerFieldContainer (FFaFieldContainer *owner) |
| Sets the FFaFieldContainer that this reference list is a member of. More... | |
| FFaFieldContainer * | getOwnerFieldContainer () const |
| Returns the FFaFieldContainer this reference list is a member of. More... | |
| void | eraseReferenceIfNeeded (FFaReferenceBase *ref) |
| Removes a reference from the list. More... | |
| void | resolve (FFaSearcher &findCB) |
| Used after reading to translate IDs to actual pointers. More... | |
| void | unresolve () |
| Does the opposite of resolve. More... | |
| void | updateAssemblyRef (int from, int to, size_t ind=0) |
| Updates the assembly reference when moving to another assembly. More... | |
| void | updateAssemblyRef (const IntVec &from, const IntVec &to) |
| Updates the assembly reference when moving to another assembly. More... | |
| void | removePtr (const FFaFieldContainer *ptr, bool notifyContainer) |
| Removes all instances of ptr from this list. More... | |
| void | zeroOutPtr (const FFaFieldContainer *ptr, bool notifyContainer) |
| Sets all instances of ptr in this list to zero. More... | |
Private Attributes | |
| FFaFieldContainer * | myOwner |
| Points to the owner object. More... | |
| const char * | myContext |
| Typically, this will be the variable name. More... | |
| bool | autoSizing |
Friends | |
| class | FFaFieldContainer |
| Grants access to some private methods for resolving references. More... | |
| class | FFaReferenceBase |
| Grants access to some private methods for resolving references. More... | |
The base class for FFaReferenceList.
When autoSizing is true, the entries in the list are deleted when the object pointed to is deleted. Otherwise, the reference is set to zero.
The context name of a reference list is used when doing topological browsing to know why a reference is referring to a certain FFaFieldContainer object. It is supposed to be set upon initializing when adding the list to the book-keeping in the FFaFieldContainer object it resides in.
|
protected |
Convenience type alias.
|
privatedelete |
Remove implicitly defined copy constructor.
|
inlineprotected |
The default constructor initializes the members.
|
inlineprotectedvirtual |
The destructor clears the list.
| void FFaReferenceListBase::clear | ( | ) |
Clears the reference list.
|
protected |
Copy method used by copy constructors, etc.
|
protectedpure virtual |
Virtual method for creating a FFaReference of correct type.
Implemented in FFaReferenceList< Type >, FFaReferenceList< FmSensorBase >, FFaReferenceList< FmModelMemberBase >, FFaReferenceList< FmSimulationModelBase >, FFaReferenceList< FmCurveSet >, FFaReferenceList< FmTriad >, FFaReferenceList< FmIsMeasuredBase >, FFaReferenceList< FmCamJoint >, FFaReferenceList< FmLink >, FFaReferenceList< FmEngine >, FFaReferenceList< FmIsPlottedBase >, and FFaReferenceList< FmBladeProperty >.
|
inline |
Returns true if myRefs is empty (zero length).
| bool FFaReferenceListBase::erase | ( | int | index | ) |
Erases entry index from the list, decrementing its size by one.
|
private |
Removes a reference from the list.
This method is used by FFaReferenceBase to notify this container (which the FFaReferenceBase object is a member of), that it has been zeroed out due to the death of the FFaFieldContainer object it was referring to. Takes the auto-sizing mode into account (see autoSizing), it either does nothing, or deletes the reference.
|
protected |
Returns an iterator matching a FFaFieldContainer pointer.
|
protected |
Returns a const_iterator matching a FFaFieldContainer pointer.
| FFaFieldContainer * FFaReferenceListBase::getBasePtr | ( | int | idx | ) | const |
Returns the pointer to the idx'th member in the list.
| void FFaReferenceListBase::getBasePtrs | ( | std::vector< FFaFieldContainer * > & | toFill | ) | const |
Fills provided vector with the non-NULL pointers in the list.
|
inline |
Returns the context name myContext used by this reference.
|
inlineprivate |
Returns the FFaFieldContainer this reference list is a member of.
|
protected |
Returns the pointer at index idx.
If idx is out of range, NULL is returned.
| bool FFaReferenceListBase::hasPtr | ( | const FFaFieldContainer * | ptr, |
| int * | idx = NULL |
||
| ) | const |
Returns true if ptr is present in the list.
If idx is not NULL, *idx is set to the index of ptr within the list.
|
protected |
Appends a reference to the end of myRefs.
|
inline |
Returns the value of the autoSizing flag.
|
privatedelete |
Remove implicitly defined assignment operator,.
| void FFaReferenceListBase::read | ( | std::istream & | is | ) |
Reads the reference list from specified input stream.
|
inline |
Removes all instances of ptr from this list.
|
private |
Removes all instances of ptr from this list.
If notifyContainer is false, the reference is removed without decrementing the FFaFieldContainer it points to, telling that it no longer does so. This is to be used in cleanup during destruction of an FFaFieldContainer instance.
|
private |
Used after reading to translate IDs to actual pointers.
|
inline |
Inverts the element order in the list.
|
inline |
Sets the autoSizing flag.
|
inline |
Assigns the context name myContext for this reference.
|
inlineprivate |
Sets the FFaFieldContainer that this reference list is a member of.
|
inlineprotected |
Sets this list as the owner of the reference pt.
| bool FFaReferenceListBase::shuffle | ( | size_t | newFirst | ) |
Reorders the elements in the list.
This method reorders the elements such that the one pointed to by newFirst becomes the first member.
|
inline |
Returns the length of myRefs,.
|
private |
Does the opposite of resolve.
Makes references in list remove pointer binding to object, and replace it with the ID as reference instead.
Updates the assembly reference when moving to another assembly.
|
private |
Updates the assembly reference when moving to another assembly.
| void FFaReferenceListBase::write | ( | std::ostream & | os | ) | const |
Writes the reference list to specified output stream.
|
inline |
Sets all instances of ptr in this list to zero.
|
private |
Sets all instances of ptr in this list to zero.
If notifyContainer is false the reference is set to zero without decrementing the FFaFieldContainer it points to, to say that it no longer points on it. This is to be used in cleaning during destruction of an FFaFieldContainer instance.
|
friend |
Grants access to some private methods for resolving references.
|
friend |
Grants access to some private methods for resolving references.
|
private |
Tells whether a reference in the list is deleted or set to zero when the referred object disappears
|
private |
Typically, this will be the variable name.
|
private |
Points to the owner object.
|
protected |
The actual list of references.