#include <SIM_Relationship.h>

Public Member Functions | |
| SIM_Data * | getRelationshipTypeData () |
| Returns the single subdata that defines the relationship type. | |
| const SIM_Data * | getConstRelationshipTypeData () const |
| Returns the single const subdata that defines the relationship type. | |
| void | setGroup (const SIM_ObjectArray &objects) |
| Sets the object group equal to the set of supplied objects. | |
| void | setGroup (SIM_Object *object) |
| Sets the object group to contain only the single specified object. | |
| void | addGroup (const SIM_ObjectArray &objects) |
| Adds a number of objects to the object group. | |
| void | addGroup (SIM_Object *object) |
| Adds a single object to the object group. | |
| void | removeGroup (const SIM_ObjectArray &objects) |
| Removes a number of objects from the object group. | |
| void | removeGroup (SIM_Object *object) |
| Removes a single object from the object group. | |
| void | clearGroup () |
| Removes all objects from the object group. | |
| int | getGroupEntries () const |
| Gets the number of objects in the object group. | |
| const SIM_Object * | getGroupObject (int index) const |
| Gets the object at position index within the object group. | |
| bool | getGroupHasObject (const SIM_Object *object) const |
| Tests whether the supplied object is in the object group. | |
| void | setAffGroup (const SIM_ObjectArray &objects) |
| Sets the affector group equal to the set of supplied objects. | |
| void | setAffGroup (SIM_Object *object) |
| Sets the affector group to contain only the single specified object. | |
| void | addAffGroup (const SIM_ObjectArray &objects) |
| Adds a number of objects to the affector group. | |
| void | addAffGroup (SIM_Object *object) |
| Adds a single object to the affector group. | |
| void | removeAffGroup (const SIM_ObjectArray &objects) |
| Removes a number of objects from the affector group. | |
| void | removeAffGroup (SIM_Object *object) |
| Removes a single object from the affector group. | |
| void | clearAffGroup () |
| Removes all objects from the affector group. | |
| int | getAffGroupEntries () const |
| Gets the number of objects in the affector group. | |
| const SIM_Object * | getAffGroupObject (int index) const |
| Gets the object at position index within the affector group. | |
| bool | getAffGroupHasObject (const SIM_Object *object) const |
| Tests whether the supplied object is in the affector group. | |
Protected Member Functions | |
| SIM_Relationship (const SIM_SimulationState *factory) | |
| virtual | ~SIM_Relationship () |
| virtual void | initializeSubclass () |
| Clears all attached objects. | |
| virtual void | makeEqualSubclass (const SIM_Data *source) |
| virtual void | saveSubclass (ostream &os) const |
| virtual bool | loadSubclass (UT_IStream &is) |
| Loads a relationship from a stream. | |
| virtual SIM_Query * | createQueryObjectSubclass () const |
| Creates a query object specific to SIM_Relationship. | |
| virtual int64 | getMemorySizeSubclass () const |
| Returns the memory usage of our group data. | |
| virtual bool | getMatchesStringSubclass (const char *pattern) const |
| Override the SIM_RootData function for matching us to a string. | |
| virtual void | getRootDataIdSubclass (SIM_RootDataId &id) const |
| Override the SIM_RootData function for getting our identifier. | |
Friends | |
| class | SIM_SimulationState |
| class | SIM_Object |
This data type is not meant to be subclassed, and does not contain any information about the nature or meaning of the relationship. That semantic information is held in the subdata of the SIM_Relationship. Only one subdata can be attached to this data at a time, and it must be a subclass of SIM_RelationshipData. Any other kind or number of subdata are ignored and invalidate the relationship.
Any data that refers to other data should be implemented as a SIM_Relationship. Doing so avoids problems of having to lookup objects based on name, enforces proper solve order (so affector objects are always solved before the group objects), and allows reverse lookups (what objects are in a relationship, and what relationships refer to a particular object).
Like SIM_Objects, SIM_Relationships are created and controlled by a SIM_SimulationState. They cannot be created and attached as subdata on existing data. Unlike SIM_Objects, SIM_Relationships do not have a unique integer identifier. Relationships must be given unique names.
Definition at line 53 of file SIM_Relationship.h.
| SIM_Relationship::SIM_Relationship | ( | const SIM_SimulationState * | factory | ) | [protected] |
| virtual SIM_Relationship::~SIM_Relationship | ( | ) | [protected, virtual] |
| void SIM_Relationship::addAffGroup | ( | SIM_Object * | object | ) |
Adds a single object to the affector group.
| void SIM_Relationship::addAffGroup | ( | const SIM_ObjectArray & | objects | ) |
Adds a number of objects to the affector group.
| void SIM_Relationship::addGroup | ( | SIM_Object * | object | ) |
Adds a single object to the object group.
| void SIM_Relationship::addGroup | ( | const SIM_ObjectArray & | objects | ) |
| void SIM_Relationship::clearAffGroup | ( | ) |
Removes all objects from the affector group.
| void SIM_Relationship::clearGroup | ( | ) |
Removes all objects from the object group.
| virtual SIM_Query* SIM_Relationship::createQueryObjectSubclass | ( | ) | const [protected, virtual] |
| int SIM_Relationship::getAffGroupEntries | ( | ) | const |
Gets the number of objects in the affector group.
| bool SIM_Relationship::getAffGroupHasObject | ( | const SIM_Object * | object | ) | const |
Tests whether the supplied object is in the affector group.
| const SIM_Object* SIM_Relationship::getAffGroupObject | ( | int | index | ) | const |
Gets the object at position index within the affector group.
| const SIM_Data* SIM_Relationship::getConstRelationshipTypeData | ( | ) | const |
Returns the single const subdata that defines the relationship type.
| int SIM_Relationship::getGroupEntries | ( | ) | const |
Gets the number of objects in the object group.
| bool SIM_Relationship::getGroupHasObject | ( | const SIM_Object * | object | ) | const |
Tests whether the supplied object is in the object group.
| const SIM_Object* SIM_Relationship::getGroupObject | ( | int | index | ) | const |
Gets the object at position index within the object group.
| virtual bool SIM_Relationship::getMatchesStringSubclass | ( | const char * | pattern | ) | const [protected, virtual] |
| virtual int64 SIM_Relationship::getMemorySizeSubclass | ( | ) | const [protected, virtual] |
| SIM_Data* SIM_Relationship::getRelationshipTypeData | ( | ) |
Returns the single subdata that defines the relationship type.
| virtual void SIM_Relationship::getRootDataIdSubclass | ( | SIM_RootDataId & | id | ) | const [protected, virtual] |
| virtual void SIM_Relationship::initializeSubclass | ( | ) | [protected, virtual] |
| virtual bool SIM_Relationship::loadSubclass | ( | UT_IStream & | is | ) | [protected, virtual] |
| virtual void SIM_Relationship::makeEqualSubclass | ( | const SIM_Data * | source | ) | [protected, virtual] |
Makes the relationship groups equal, but doesn't set the relationship name, which must be kept unique.
Reimplemented from SIM_Data.
| void SIM_Relationship::removeAffGroup | ( | SIM_Object * | object | ) |
Removes a single object from the affector group.
| void SIM_Relationship::removeAffGroup | ( | const SIM_ObjectArray & | objects | ) |
Removes a number of objects from the affector group.
| void SIM_Relationship::removeGroup | ( | SIM_Object * | object | ) |
Removes a single object from the object group.
| void SIM_Relationship::removeGroup | ( | const SIM_ObjectArray & | objects | ) |
Removes a number of objects from the object group.
| virtual void SIM_Relationship::saveSubclass | ( | ostream & | os | ) | const [protected, virtual] |
Saves a relationship to a stream. The object groups are saved to the stream as arrays of object id numbers.
Reimplemented from SIM_Data.
| void SIM_Relationship::setAffGroup | ( | SIM_Object * | object | ) |
Sets the affector group to contain only the single specified object.
| void SIM_Relationship::setAffGroup | ( | const SIM_ObjectArray & | objects | ) |
Sets the affector group equal to the set of supplied objects.
| void SIM_Relationship::setGroup | ( | SIM_Object * | object | ) |
Sets the object group to contain only the single specified object.
| void SIM_Relationship::setGroup | ( | const SIM_ObjectArray & | objects | ) |
Sets the object group equal to the set of supplied objects.
friend class SIM_Object [friend] |
Definition at line 144 of file SIM_Relationship.h.
friend class SIM_SimulationState [friend] |
1.5.9