|
FEDEM Model Database
R8.0
Source code of the FEDEM model database
|
A "guarded pointer" like class. More...
#include <FFaReference.H>


Public Member Functions | |
| bool | setPointer (Type *ptr) |
| Assigns ptr to this reference. More... | |
| FFaReference< Type > & | operator= (Type *ptr) |
| Overloaded assignment operator. More... | |
| Type * | getPointer () const |
| Returns the type-casted pointer this reference points to. More... | |
| operator Type * () const | |
| Pointer operator. More... | |
| Type * | operator-> () const |
| Pointer operator. More... | |
| Type & | operator* () const |
| Dereference operator. More... | |
| bool | operator== (const FFaReference< Type > &p) const |
| Equality operator. More... | |
| bool | operator!= (const FFaReference< Type > &p) const |
| Inequality operator. More... | |
| int | getRefClassTypeID () const final |
| Returns the class type ID this reference is instantiated over. More... | |
Public Member Functions inherited from FFaReferenceBase | |
| 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... | |
| 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... | |
Additional Inherited Members | |
Protected Member Functions inherited from FFaReferenceBase | |
| 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... | |
A "guarded pointer" like class.
This class can be used in classes derived from FFaFieldContainer to refer to other classes derived from FFaFieldContainer. The class can be used much like a normal pointer because of the reimplemented operators. The pointer value encapsulated by this class will automatically be set to zero if the referred object is deleted.
One of the main applications of this class is to use it together with FFaField and get automated IO of the reference. To use this feature, the FFaFieldContainer-derived class containing the reference needs a FFaField<FFaReferenceBase*> object that is initialized with the address of the FFaReference to read/write:
You can also use it as a guarded pointer outside any FFaFieldContainer. Any FFaReference can be assigned a contextName that can be used to look up why a particular reference is pointing to a FFaFieldContainer. When using the macro used above, the context name is automatically set to the same as the name of the reference. But it can be set to anything appropriate.
|
inline |
Returns the type-casted pointer this reference points to.
|
inlinefinalvirtual |
Returns the class type ID this reference is instantiated over.
Reimplemented from FFaReferenceBase.
|
inline |
Pointer operator.
|
inline |
Inequality operator.
|
inline |
Dereference operator.
|
inline |
Pointer operator.
|
inline |
Overloaded assignment operator.
|
inline |
Equality operator.
|
inline |
Assigns ptr to this reference.