|
FEDEM Model Database
R8.0
Source code of the FEDEM model database
|
Base class for the template class FFaReference for guarded pointers. More...
#include <FFaReference.H>


Public Member Functions | |
| FFaReferenceBase () | |
| The default constructor initializes the members. More... | |
| virtual | ~FFaReferenceBase () |
| The destructor clears the cross references. More... | |
| bool | setRef (FFaFieldContainer *ptr) |
| Sets the pointer value from a FFaFieldContainer pointer directly. More... | |
| void | setRef (int objId, int typeId) |
| Sets the unresolved id and type of the referred object. More... | |
| void | setRef (int objId, int typeId, const IntVec &assemblyIDs) |
| Sets the unresolved id and type of object in a subassembly. More... | |
| bool | setPointerToNull () |
| Clears the reference. More... | |
| void | copy (const FFaReferenceBase &aReference, bool unresolve=false) |
| A copy method mostly used by FFaFieldContainer::copy(). More... | |
| FFaFieldContainer * | getRef () const |
| Returns the FFaFieldContainer pointer contained. More... | |
| bool | isResolved () const |
| Returns whether this reference has been resolved or not. More... | |
| bool | isNull () const |
| Returns whether this reference points to an actual object. More... | |
| void | setContextName (const char *name) |
| Assigns the context name for this reference. More... | |
| const char * | getContextName () const |
| Returns the context name used by this reference. More... | |
| virtual int | getRefClassTypeID () const |
| Returns the type ID that this reference is supposed to refer to. More... | |
| const char * | getRefTypeName () const |
| Returns the type name of the referred object. More... | |
| int | getRefTypeID () const |
| Returns the type id of the referred object. More... | |
| int | getRefID () const |
| Returns the id number of the referred object. More... | |
| bool | getRefAssemblyID (IntVec &assID) const |
| Returns the assembly id array of the referred object. More... | |
| void | setPrintIfZero (bool doPrint) |
| Flags whether this reference should be printed even if NULL. More... | |
| bool | printMeIfZero () const |
| Returns if this reference should be printed even if NULL. More... | |
| void | write (std::ostream &os) const |
| Writes the reference to specified output stream. More... | |
| void | read (std::istream &is) |
| Reads the reference from specified input stream. More... | |
Protected Member Functions | |
| void | resolve (FFaSearcher &findCB) |
| Finds the object that has matching Type and ID as read from file. 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... | |
| bool | isEqual (const FFaReferenceBase *p) const |
| Checks for equality between two references. More... | |
| void | bind () |
| Tells the object this reference is pointing at that it is referred. More... | |
| void | unbind () |
| Tells the referred object that it is not being referred anymore. More... | |
| void | clearResolveRef () |
| Deletes the variable used to hold temporary ID information. More... | |
Private Types | |
| using | UnResolvedID = std::vector< int > |
| Type of unique identification of the unresolved references. More... | |
Private Member Functions | |
| FFaReferenceBase (const FFaReferenceBase &)=delete | |
| Remove implicitly defined copy constructor. More... | |
| FFaReferenceBase & | operator= (const FFaReferenceBase &)=delete |
| Remove implicitly defined assignment operator. More... | |
| void | zeroOut () |
| Only used by the FFaReferenceListBase to clean a ToRef. More... | |
| void | zeroOutOrRemoveFromList () |
| Only used by FFaFieldContainer to notify that it is obsolete. More... | |
| void | setOwnerReferenceList (FFaReferenceListBase *) |
| Sets the FFaReferenceListBase that this reference is a member of. More... | |
| FFaReferenceListBase * | getOwnerReferenceList () const |
| Returns the FFaReferenceListBase this reference is a member of. More... | |
| void | setOwnerFieldContainer (FFaFieldContainer *) |
| Sets the FFaFieldContainer that this reference is a member of. More... | |
| FFaFieldContainer * | getOwnerFieldContainer () const |
| Returns the FFaFieldContainer this reference is a member of. More... | |
| void | setRefID (int id) |
| Convenience method used when reading from file. More... | |
| void | setRefTypeID (int id) |
| Convenience method used when reading from file. More... | |
| void | setRefAssemblyID (const IntVec &assemblyID) |
| Convenience method used when reading from file. More... | |
Private Attributes | |
| bool | IAmResolved |
| false if we have an UnResolvedID object pointed to by myUnresolvedRef More... | |
| bool | IAmBound |
| true if myPtr is pointing to a container, and the container knows it More... | |
| bool | IAmInAList |
| true if this reference is maintained by a FFaReferenceList More... | |
| union { | |
| FFaFieldContainer * myOwnerObj | |
| Points to the owner object. More... | |
| FFaReferenceListBase * myOwnerList | |
| Points to the owner reference list. More... | |
| }; | |
| Shared memory segment for alternative owner types. More... | |
| union { | |
| FFaFieldContainer * myPtr | |
| Points to the referred object when resolved. More... | |
| UnResolvedID * myUnresolvedRef | |
| Id of referred object before resolving. More... | |
| }; | |
| Shared memory segment for pointers to resolved and unresolved data. More... | |
| const char * | myContextName |
| Typically, this will be the variable name. More... | |
| bool | printIfZero |
| If true, print the reference also when NULL. More... | |
Friends | |
| class | FFaFieldContainer |
| Grants access to some private methods for resolving references. More... | |
| class | FFaReferenceListBase |
| Grants access to some private methods for resolving references. More... | |
Base class for the template class FFaReference for guarded pointers.
Requirements:
In the referred object we need a table with those who refer to it. In object that prints the connection, the connection needs to be in the field container.
|
private |
Type of unique identification of the unresolved references.
|
privatedelete |
Remove implicitly defined copy constructor.
| FFaReferenceBase::FFaReferenceBase | ( | ) |
The default constructor initializes the members.
|
virtual |
The destructor clears the cross references.
|
protected |
Tells the object this reference is pointing at that it is referred.
|
protected |
Deletes the variable used to hold temporary ID information.
| void FFaReferenceBase::copy | ( | const FFaReferenceBase & | aReference, |
| bool | unresolve = false |
||
| ) |
A copy method mostly used by FFaFieldContainer::copy().
| const char * FFaReferenceBase::getContextName | ( | ) | const |
Returns the context name used by this reference.
This method is used when doing topology browsing to know why a reference is referring to a certain FFaFieldContainer. Supposed to be set upon initialization when adding the reference to the book keeping in the FFaFieldContainer it is residing in. If this reference is a member of a FFaReferenceList, this method will return the context name of that FFaReferenceList.
|
private |
Returns the FFaFieldContainer this reference is a member of.
This could also be the FFaFieldContainer of the FFaReferenceListBase that this reference is a member of.
|
private |
Returns the FFaReferenceListBase this reference is a member of.
| FFaFieldContainer * FFaReferenceBase::getRef | ( | ) | const |
Returns the FFaFieldContainer pointer contained.
| bool FFaReferenceBase::getRefAssemblyID | ( | IntVec & | assID | ) | const |
Returns the assembly id array of the referred object.
If the reference is not resolved, the read assembly id returned.
|
inlinevirtual |
Returns the type ID that this reference is supposed to refer to.
Reimplemented in FFaReference< Type >, FFaReference< FmJointDamper >, FFaReference< FmJointSpring >, FFaReference< FmCtrlElementBase >, FFaReference< FmBase >, FFaReference< FmIsPositionedBase >, FFaReference< FmPart >, FFaReference< FmModelMemberBase >, FFaReference< FmFrictionBase >, FFaReference< FmMaterialProperty >, FFaReference< FmTriad >, FFaReference< FmDofLoad >, FFaReference< FmJointBase >, FFaReference< FmIsMeasuredBase >, FFaReference< FmRoad >, FFaReference< FmDofMotion >, FFaReference< FmGraph >, FFaReference< FmCtrlOutputElementBase >, FFaReference< FmSubAssembly >, FFaReference< FmLink >, FFaReference< FmEngine >, FFaReference< FmIsPlottedBase >, FFaReference< FmSpringChar >, FFaReference< Fm1DMaster >, FFaReference< FmMathFuncBase >, and FFaReference< FmFileReference >.
| int FFaReferenceBase::getRefID | ( | ) | const |
Returns the id number of the referred object.
If the reference is not resolved, the read id returned.
| int FFaReferenceBase::getRefTypeID | ( | ) | const |
Returns the type id of the referred object.
| const char * FFaReferenceBase::getRefTypeName | ( | ) | const |
Returns the type name of the referred object.
|
protected |
Checks for equality between two references.
|
inline |
Returns whether this reference points to an actual object.
|
inline |
Returns whether this reference has been resolved or not.
|
privatedelete |
Remove implicitly defined assignment operator.
|
inline |
Returns if this reference should be printed even if NULL.
| void FFaReferenceBase::read | ( | std::istream & | is | ) |
Reads the reference from specified input stream.
|
protected |
Finds the object that has matching Type and ID as read from file.
This method sets up the pointer relation to the object with correct Type and ID compared to what was read from file.
|
inline |
Assigns the context name for this reference.
|
private |
Sets the FFaFieldContainer that this reference is a member of.
|
private |
Sets the FFaReferenceListBase that this reference is a member of.
|
inline |
Clears the reference.
|
inline |
Flags whether this reference should be printed even if NULL.
| bool FFaReferenceBase::setRef | ( | FFaFieldContainer * | ptr | ) |
Sets the pointer value from a FFaFieldContainer pointer directly.
Returns true if a new pointer value is assigned, otherwise false.
| void FFaReferenceBase::setRef | ( | int | objId, |
| int | typeId | ||
| ) |
Sets the unresolved id and type of the referred object.
Must be resolved later. Can be used when reading the references in another way than through the read() method.
| void FFaReferenceBase::setRef | ( | int | objId, |
| int | typeId, | ||
| const IntVec & | assemblyIDs | ||
| ) |
Sets the unresolved id and type of object in a subassembly.
|
private |
Convenience method used when reading from file.
|
private |
Convenience method used when reading from file.
|
private |
Convenience method used when reading from file.
|
protected |
Tells the referred object that it is not being referred anymore.
|
protected |
Does the opposite of resolve.
Updates the assembly reference when moving to another assembly.
|
protected |
Updates the assembly reference when moving to another assembly.
| void FFaReferenceBase::write | ( | std::ostream & | os | ) | const |
Writes the reference to specified output stream.
|
private |
Only used by the FFaReferenceListBase to clean a ToRef.
|
private |
Only used by FFaFieldContainer to notify that it is obsolete.
|
friend |
Grants access to some private methods for resolving references.
|
friend |
Grants access to some private methods for resolving references.
| union { ... } |
Shared memory segment for pointers to resolved and unresolved data.
| union { ... } |
Shared memory segment for alternative owner types.
|
private |
true if myPtr is pointing to a container, and the container knows it
|
private |
true if this reference is maintained by a FFaReferenceList
|
private |
false if we have an UnResolvedID object pointed to by myUnresolvedRef
|
private |
Typically, this will be the variable name.
| FFaReferenceListBase* FFaReferenceBase::myOwnerList |
Points to the owner reference list.
| FFaFieldContainer* FFaReferenceBase::myOwnerObj |
Points to the owner object.
| FFaFieldContainer* FFaReferenceBase::myPtr |
Points to the referred object when resolved.
| UnResolvedID* FFaReferenceBase::myUnresolvedRef |
Id of referred object before resolving.
|
private |
If true, print the reference also when NULL.