// $Id: Sim/SmartLinkSet.hpp 2012/11/14 16:21:16 philw $ // Smart Link Set // // This class represents a record in the "SmartLinks" link topology // dictionary. Each record contains this information: // // (1) TWO sets of Engineering Object Related Fields (i.e. for TWO objects): // (a) Simulation Object Type (See libEngrObjsClassIds.hpp). // (b) Method-Category Name (a particular Category of the object type). // (c) Method Name (of a method within that category) // // (2) A containing SmartLinkSet Group Format String. The exact string // value relates several SmartLinkSets to each other (as a Group) // AND provides a display string to be used in conjuction with // two Engineering Object instances. // // Example: "%1 Right side to %2 Left side" // // (3) A Link Set Name (also for display), e.g. "Elevations" or "Salinity" // // (4) A list of slot-name pairs representing the set of links which are // used to establish a relationship between the two objects having // the particular method selections indicated in this record. // // Each pair contains: (a) a name of a slot on the first object, and // (b) a name of a slot on the second object. // // See: typedef QPair ObjPairSlotNames; //--- #include #include #include class SmartLinkSet { // *********************************** // *** SmartLinkSet Data Members *** // *********************************** public: // Pair of slot names (on distinct object instances) which can be linked. typedef QPair ObjPairSlotNames; private: unsigned int _obj1TypeId; // [libEngrObjsClassIds.hpp] QString _obj1CategoryName; // QString _obj1MethodName; // unsigned int _obj2TypeId; // [libEngrObjsClassIds.hpp] QString _obj2CategoryName; // QString _obj2MethodName; // // Note: multiple SmartLinkSets with equivalent object types and // methods will share a common "group display format string". QString _groupDispFormatStr; // e.g. "%1 Right side to %2 Left side" QString _linkSetName; // e.g. "Elevations" QList _linkSlotNamePairList; // ****************************** // *** SmartLinkSet Setters *** // ****************************** public: SmartLinkSet(); SmartLinkSet (unsigned int typ1, const QString& cat1, const QString& meth1, unsigned int typ2, const QString& cat2, const QString& meth2, const QString& groupDispFormatStr, const QString& linkSetName); // append link void append (const QString& slot1, const QString& slot2); // ****************************** // *** SmartLinkSet Getters *** // ****************************** public: unsigned int obj1TypeId() const { return _obj1TypeId; } QString obj1CategoryName() const { return _obj1CategoryName; } QString obj1MethodName() const { return _obj1MethodName; } unsigned int obj2TypeId() const { return _obj2TypeId; } QString obj2CategoryName() const { return _obj2CategoryName; } QString obj2MethodName() const { return _obj2MethodName; } QString groupDispFormatStr() const { return _groupDispFormatStr; } QString linkSetName() const { return _linkSetName; } const QList& linkSlotNamePairListRef() const { return _linkSlotNamePairList; } }; //--- (end SmartLinkSet.hpp) ---