00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef MON_h
00023 #define MON_h
00024
00025 #pragma warning( disable : 4786 )
00026
00027 #include "MONImpl.h"
00028 #include "Exceptions.h"
00029
00030 namespace MON
00031 {
00032 class Project;
00033 class MetaObject;
00034 class Object;
00035 class Folder;
00036 class FCO;
00037 class Atom;
00038 class Model;
00039 class Set;
00040 class Reference;
00041 class Connection;
00042
00043 class FolderContainment;
00044 class ReferenceAssociation;
00045 class SetMembership;
00046 class Containment;
00047 class Attribute;
00048 class Constraint;
00049 class Aspect;
00050 class RegistryNode;
00051 class ContainmentPart;
00052 class ConnectionSpecification;
00053 class ConnectionRole;
00054 class ConnectionEnd;
00055 class ModelInAspect;
00056 class AttributeAggregation;
00057
00058
00059
00060
00061
00062
00063
00064 class Project
00065 : public Util::GenRefCounter
00066 {
00067
00068 public :
00069 Project();
00070 Project( ProjectImpl* pProject );
00071 Project( IMgaMetaProject* spProject );
00072 Project( const Project& project );
00073 Project& operator = ( const Project& project );
00074
00075
00076 public :
00077 ProjectPtr getProjectI() const;
00078 std::string name() const;
00079 std::string displayedName() const;
00080 std::string author() const;
00081 std::string comment() const;
00082 std::string creationTime() const;
00083 std::string infoString( bool bWithIdentifiers = false ) const;
00084
00085
00086 public :
00087 Folder rootFolder() const;
00088 std::set<Folder> folders() const;
00089 std::set<Atom> atoms() const;
00090 std::set<Model> models() const;
00091 std::set<Set> sets() const;
00092 std::set<Reference> references() const;
00093 std::set<Connection> connections() const;
00094 std::set<Aspect> aspects() const;
00095 std::set<Attribute> attributes() const;
00096 std::set<FolderContainment> folderContainments() const;
00097 std::set<ReferenceAssociation> referenceAssociations() const;
00098 std::set<SetMembership> setMemberships() const;
00099 std::set<Containment> containments() const;
00100 std::set<ConnectionEnd> connectionEnds() const;
00101 std::set<ModelInAspect> modelInAspects() const;
00102 std::set<ContainmentPart> containmentParts() const;
00103 std::set<AttributeAggregation> attributeAggregations() const;
00104
00105
00106 public :
00107 MetaObject findByRef( long lRef ) const;
00108 MetaObject findByName( const std::string strName ) const;
00109
00110
00111 public:
00112 std::string m_nmsp;
00113 std::string prefixWNmsp( const std::string& strName) const;
00114
00115
00116 };
00117
00118
00119
00120
00121
00122
00123
00124 class MetaObject
00125 : public Util::GenRefCounter
00126 {
00127
00128 public :
00129 MetaObject();
00130 MetaObject( ObjectImpl* pObject );
00131 MetaObject( const MetaObject& object );
00132 MetaObject& operator = ( const MetaObject& object );
00133
00134
00135 protected :
00136 void castObjectImpl( ObjectType eType, ObjectType eType2 = OT_Null );
00137
00138
00139 public :
00140 ObjectPtr getObjectI() const;
00141 long ref() const;
00142 std::string name() const;
00143 std::string displayedName() const;
00144 ObjectType type() const;
00145 std::string infoString( bool bWithIdentifiers = false, bool bWithRef = false ) const;
00146
00147 RegistryNode registry() const;
00148
00149
00150 public :
00151 Project project() const;
00152 };
00153
00154
00155
00156
00157
00158
00159
00160 class Object
00161 : public MetaObject
00162 {
00163
00164 public :
00165 Object();
00166 Object( ObjectImpl* pObject );
00167 Object( const MetaObject& object );
00168 Object& operator = ( const MetaObject& object );
00169
00170
00171 public :
00172 std::set<FolderContainment> parentFolderContainments() const;
00173 std::set<Folder> parentFolders() const;
00174 bool isFolderParent( const Folder& folder ) const;
00175
00176 std::set<Constraint> constraints() const;
00177 };
00178
00179
00180
00181
00182
00183
00184
00185 class Folder
00186 : public Object
00187 {
00188
00189 public :
00190 Folder() { }
00191 Folder( ObjectImpl* pObject );
00192 Folder( const MetaObject& object );
00193 Folder( IMgaMetaBase* spObject );
00194 Folder& operator = ( const MetaObject& object );
00195
00196
00197 public :
00198 FolderPtr getFolderI() const;
00199
00200
00201 public :
00202 std::set<FolderContainment> childFolderContainments() const;
00203 std::set<Object> childObjects() const;
00204 std::set<Folder> childFolders() const;
00205 std::set<FCO> childFCOs() const;
00206 std::set<Atom> childAtoms() const;
00207 std::set<Model> childModels() const;
00208 bool isObjectChild( const Object& object ) const;
00209 };
00210
00211
00212
00213
00214
00215
00216
00217 class FCO
00218 : public Object
00219 {
00220
00221 public :
00222 FCO() { }
00223 FCO( ObjectImpl* pObject );
00224 FCO( const MetaObject& object );
00225 FCO& operator = ( const MetaObject& object );
00226
00227
00228 public :
00229 FCOPtr getFCOI() const;
00230
00231
00232 public :
00233 std::set<Containment> parentContainments() const;
00234 std::set<Model> parentModels() const;
00235 bool isModelParent( const Model& model ) const;
00236
00237 std::set<ConnectionEnd> connectionEnds() const;
00238 std::set<ConnectionRole> targetOf() const;
00239 bool isTargetOf( const ConnectionRole& role ) const;
00240
00241 std::set<ReferenceAssociation> referenceAssociations() const;
00242 std::set<Reference> referencedBy() const;
00243 bool isReferencedBy( const Reference& reference ) const;
00244
00245 std::set<SetMembership> setMemberships() const;
00246 std::set<Set> memberOf() const;
00247 bool isMemberOf( const Set& reference ) const;
00248
00249 std::set<AttributeAggregation> attributeAggregations() const;
00250 std::set<Attribute> attributes( bool bLocalsAlso = true ) const;
00251 std::set<Attribute> localAttributes() const;
00252 bool hasAttribute( const Attribute& attribute, bool bLocalsAlso = true ) const;
00253 };
00254
00255
00256
00257
00258
00259
00260
00261 class Atom
00262 : public FCO
00263 {
00264
00265 public :
00266 Atom() { }
00267 Atom( ObjectImpl* pObject );
00268 Atom( const MetaObject& object );
00269 Atom( IMgaMetaBase* spObject );
00270 Atom& operator = ( const MetaObject& object );
00271
00272
00273 public :
00274 AtomPtr getAtomI() const;
00275 };
00276
00277
00278
00279
00280
00281
00282
00283 class Model
00284 : public FCO
00285 {
00286
00287 public :
00288 Model() { }
00289 Model( ObjectImpl* pObject );
00290 Model( const MetaObject& object );
00291 Model( IMgaMetaBase* spObject );
00292 Model& operator = ( const MetaObject& object );
00293
00294
00295 public :
00296 ModelPtr getModelI() const;
00297
00298
00299 public :
00300 std::set<Containment> childContainments() const;
00301 std::set<FCO> childFCOs() const;
00302 std::set<Atom> childAtoms() const;
00303 std::set<Model> childModels() const;
00304 std::set<Connection> childConnections() const;
00305 std::set<Set> childSets() const;
00306 std::set<Reference> childReferences() const;
00307 bool isFCOChild( const FCO& fco ) const;
00308
00309 std::set<ModelInAspect> modelInAspects() const;
00310 std::set<Aspect> aspects() const;
00311 bool hasAspect( const Aspect& aspect ) const;
00312 };
00313
00314
00315
00316
00317
00318
00319
00320 class ConnectionRole
00321 : public Util::GenRefCounter
00322 {
00323
00324 public :
00325 typedef std::pair<std::string, FCO> KindPair;
00326 typedef std::pair<std::string, Containment> RolePair;
00327
00328
00329 public :
00330 ConnectionRole();
00331 ConnectionRole( ConnectionRoleImpl* pConnectionRole );
00332 ConnectionRole( const ConnectionRole& connectionRole );
00333 ConnectionRole& operator = ( const ConnectionRole& connectionRole );
00334
00335
00336 public :
00337 Project project() const;
00338 ConnectionSpecification specification() const;
00339 std::string name() const;
00340 std::string infoString( bool bWithIdentifiers = false, bool bWithRef = false ) const;
00341
00342 std::set<ConnectionEnd> connectionEnds() const;
00343 std::set<Containment> targetRoles() const;
00344 std::set<FCO> targets() const;
00345 bool isTarget( const FCO& fco ) const;
00346 bool isTarget( const Containment& containment ) const;
00347 };
00348
00349
00350
00351
00352
00353
00354
00355 class ConnectionSpecification
00356 : public Util::GenRefCounter
00357 {
00358
00359 public :
00360 ConnectionSpecification();
00361 ConnectionSpecification( ConnectionSpecImpl* pConnectionSpec );
00362 ConnectionSpecification( const ConnectionSpecification& connectionSpec );
00363 ConnectionSpecification& operator = ( const ConnectionSpecification& connectionSpec );
00364
00365
00366 public :
00367 Project project() const;
00368 Connection connection() const;
00369 int number() const;
00370 std::string infoString( bool bWithIdentifiers = false, bool bWithRef = false ) const;
00371
00372 std::set<ConnectionRole> roles() const;
00373 ConnectionRole role( const std::string& strRoleName ) const;
00374 };
00375
00376
00377
00378
00379
00380
00381
00382 class Connection
00383 : public FCO
00384 {
00385
00386 public :
00387 typedef std::pair<std::string,FCO> Pair;
00388
00389
00390 public :
00391 Connection() { }
00392 Connection( ObjectImpl* pObject );
00393 Connection( const MetaObject& object );
00394 Connection( IMgaMetaBase* spObject );
00395 Connection& operator = ( const MetaObject& object );
00396
00397
00398 public :
00399 ConnectionPtr getConnectionI() const;
00400
00401
00402 public :
00403 bool isSimple() const;
00404 bool isBidirectional() const;
00405
00406 std::set<ConnectionSpecification> specifications() const;
00407 size_t specificationCount() const;
00408 ConnectionSpecification specification( int iNum ) const;
00409 };
00410
00411
00412
00413
00414
00415
00416
00417 class Set
00418 : public FCO
00419 {
00420
00421 public :
00422 Set() { }
00423 Set( ObjectImpl* pObject );
00424 Set( const MetaObject& object );
00425 Set( IMgaMetaBase* spObject );
00426 Set& operator = ( const MetaObject& object );
00427
00428
00429 public :
00430 SetPtr getSetI() const;
00431
00432
00433 public :
00434 std::set<SetMembership> memberships() const;
00435 std::set<Containment> memberRoles() const;
00436 bool isMember( const Containment& role ) const;
00437 bool isMember( const FCO& fco ) const;
00438 };
00439
00440
00441
00442
00443
00444
00445
00446 class Reference
00447 : public FCO
00448 {
00449
00450 public :
00451 Reference() { }
00452 Reference( ObjectImpl* pObject );
00453 Reference( const MetaObject& object );
00454 Reference( IMgaMetaBase* spObject );
00455 Reference& operator = ( const MetaObject& object );
00456
00457
00458 public :
00459 ReferencePtr getReferenceI() const;
00460
00461
00462 public :
00463 std::set<ReferenceAssociation> refAssociations() const;
00464 std::set<FCO> targetFCOs() const;
00465 bool isReferenced( const FCO& fco ) const;
00466 };
00467
00468
00469
00470
00471
00472
00473
00474 class Containment
00475 : public MetaObject
00476 {
00477
00478 public :
00479 Containment() { }
00480 Containment( ObjectImpl* pObject );
00481 private:
00482 Containment( const MetaObject& object );
00483 Containment( const FCO& object );
00484 public:
00485 Containment( IMgaMetaBase* spObject );
00486 private:
00487 Containment& operator = ( const MetaObject& object );
00488
00489
00490 public :
00491 ContainmentPtr getContainmentI() const;
00492
00493
00494 public :
00495 Model parent() const;
00496 FCO child() const;
00497
00498 std::set<ConnectionEnd> connectionEnds() const;
00499 std::set<ConnectionRole> targetOf() const;
00500 bool isTargetOf( const ConnectionRole& role ) const;
00501
00502 std::set<ContainmentPart> parts() const;
00503 std::set<Aspect> aspects() const;
00504 bool isVisibleIn( const Aspect& aspect ) const;
00505
00506 std::set<ReferenceAssociation> referenceAssociations() const;
00507 std::set<Reference> referencedBy() const;
00508 bool isReferencedBy( const Reference& reference ) const;
00509
00510 std::set<SetMembership> setMemberships() const;
00511 std::set<Set> memberOf() const;
00512 bool isMemberOf( const Set& set ) const;
00513
00514 };
00515
00516
00517
00518
00519
00520
00521
00522 class Attribute
00523 : public MetaObject
00524 {
00525
00526 public :
00527 typedef std::pair<std::string,std::string> NameValue;
00528
00529
00530 public :
00531 Attribute() { }
00532 Attribute( ObjectImpl* pObject );
00533 Attribute( const MetaObject& object );
00534 Attribute( IMgaMetaBase* spObject );
00535 Attribute& operator = ( const MetaObject& object );
00536
00537
00538 public :
00539 AttributePtr getAttributeI() const;
00540 Util::Variant defaultValue() const;
00541 AttributeType valueType() const;
00542 std::vector<NameValue> enumItems() const;
00543 FCO owner() const;
00544
00545
00546 public :
00547 std::set<AttributeAggregation> attributeAggregations() const;
00548 std::set<FCO> FCOs() const;
00549 bool isContainedBy( const FCO& fco ) const;
00550 };
00551
00552
00553
00554
00555
00556
00557
00558 class Aspect
00559 : public MetaObject
00560 {
00561
00562 public :
00563 Aspect() { }
00564 Aspect( ObjectImpl* pObject );
00565 Aspect( const MetaObject& object );
00566 Aspect( IMgaMetaBase* spObject );
00567 Aspect& operator = ( const MetaObject& object );
00568
00569
00570 public :
00571 AspectPtr getAspectI() const;
00572
00573
00574 public :
00575 std::set<ModelInAspect> modelInAspects() const;
00576 std::set<Model> models() const;
00577 bool isContainedBy( const Model& model ) const;
00578
00579 std::set<ContainmentPart> parts() const;
00580 std::set<Containment> containments() const;
00581 bool hasContainment( const Containment& containment ) const;
00582 };
00583
00584
00585
00586
00587
00588
00589
00590 class ContainmentPart
00591 : public MetaObject
00592 {
00593
00594 public :
00595 ContainmentPart() { }
00596 ContainmentPart( ObjectImpl* pObject );
00597 ContainmentPart( const MetaObject& object );
00598 ContainmentPart( IMgaMetaBase* spObject );
00599 ContainmentPart& operator = ( const MetaObject& object );
00600
00601
00602 public :
00603 PartPtr getPartI() const;
00604 bool isLinked() const;
00605 bool isPrimary() const;
00606
00607
00608 public :
00609 Containment containment() const;
00610 Aspect aspect() const;
00611 };
00612
00613
00614
00615
00616
00617
00618
00619 class FolderContainment
00620 : public Util::GenRefCounter
00621 {
00622
00623 public :
00624 FolderContainment();
00625 FolderContainment( FolderContainmentImpl* pFolderContainment );
00626 FolderContainment( const FolderContainment& folderContainment );
00627 FolderContainment& operator=( const FolderContainment& folderContainment );
00628
00629
00630 public :
00631 std::string infoString( bool bWithIdentifiers = false, bool bWithRef = false ) const;
00632
00633
00634 public :
00635 Project project() const;
00636 Folder parent() const;
00637 Object child() const;
00638 };
00639
00640
00641
00642
00643
00644
00645
00646 class ReferenceAssociation
00647 : public Util::GenRefCounter
00648 {
00649
00650 public :
00651 ReferenceAssociation();
00652 ReferenceAssociation( ReferenceAssocImpl* pReferenceAssoc );
00653 ReferenceAssociation( const ReferenceAssociation& referenceAssoc );
00654 ReferenceAssociation& operator=( const ReferenceAssociation& referenceAssoc );
00655
00656
00657 public :
00658 std::string infoString( bool bWithIdentifiers = false, bool bWithRef = false ) const;
00659
00660
00661 public :
00662 Project project() const;
00663 Reference reference() const;
00664 FCO target() const;
00665 };
00666
00667
00668
00669
00670
00671
00672
00673 class SetMembership
00674 : public Util::GenRefCounter
00675 {
00676
00677 public :
00678 SetMembership();
00679 SetMembership( SetMembershipImpl* pSetMembership );
00680 SetMembership( const SetMembership& setMembership );
00681 SetMembership& operator=( const SetMembership& setMembership );
00682
00683
00684 public :
00685 std::string infoString( bool bWithIdentifiers = false, bool bWithRef = false ) const;
00686
00687
00688 public :
00689 Project project() const;
00690 Set set() const;
00691 Containment member() const;
00692 };
00693
00694
00695
00696
00697
00698
00699
00700 class ConnectionEnd
00701 : public Util::GenRefCounter
00702 {
00703
00704 public :
00705 typedef std::pair<std::string,Connection> Pair;
00706
00707
00708 public :
00709 ConnectionEnd();
00710 ConnectionEnd( ConnectionEndImpl* pConnectionEnd );
00711 ConnectionEnd( const ConnectionEnd& connectionEnd );
00712 ConnectionEnd& operator=( const ConnectionEnd& connectionEnd );
00713
00714
00715 public :
00716 std::string infoString( bool bWithIdentifiers = false, bool bWithRef = false ) const;
00717
00718
00719 public :
00720 Project project() const;
00721 ConnectionRole role() const;
00722 Containment target() const;
00723 };
00724
00725
00726
00727
00728
00729
00730
00731 class ModelInAspect
00732 : public Util::GenRefCounter
00733 {
00734
00735 public :
00736 ModelInAspect();
00737 ModelInAspect( ModelInAspectImpl* pModelInAspect);
00738 ModelInAspect( const ModelInAspect& modelInAspect );
00739 ModelInAspect& operator=( const ModelInAspect& modelInAspect );
00740
00741
00742 public :
00743 std::string infoString( bool bWithIdentifiers = false, bool bWithRef = false ) const;
00744
00745
00746 public :
00747 Project project() const;
00748 Aspect aspect() const;
00749 Model model() const;
00750 };
00751
00752
00753
00754
00755
00756
00757
00758 class AttributeAggregation
00759 : public Util::GenRefCounter
00760 {
00761
00762 public :
00763 AttributeAggregation();
00764 AttributeAggregation( AttributeAggregationImpl* pAttributeAggr );
00765 AttributeAggregation( const AttributeAggregation& attributeAggr );
00766 AttributeAggregation& operator=( const AttributeAggregation& attributeAggr );
00767
00768
00769 public :
00770 std::string infoString( bool bWithIdentifiers = false, bool bWithRef = false ) const;
00771
00772
00773 public :
00774 Project project() const;
00775 FCO fco() const;
00776 Attribute attribute() const;
00777 };
00778
00779
00780
00781
00782
00783
00784
00785 class RegistryNode
00786 : public Util::GenRefCounter
00787 {
00788
00789 public :
00790 RegistryNode();
00791 RegistryNode( const RegistryNode& node );
00792 RegistryNode( RegistryNodeImpl* pRegistryNode );
00793 RegistryNode& operator = ( const RegistryNode& node );
00794
00795
00796 public :
00797 RegNodePtr getRegNodeI() const;
00798 Project project() const;
00799 MetaObject object() const;
00800 bool isRoot() const;
00801
00802 std::string name() const;
00803 std::string path() const;
00804
00805 std::string value() const;
00806 long integerValue() const;
00807 double realValue() const;
00808 bool boolValue() const;
00809
00810 std::string valueByPath( const std::string& strPath ) const;
00811
00812 RegistryNode parent() const;
00813 std::set<RegistryNode> children() const;
00814 RegistryNode child( const std::string& strName ) const;
00815 RegistryNode childByPath( const std::string& strPath ) const;
00816 };
00817
00818
00819
00820
00821
00822
00823
00824 class Constraint
00825 : public Util::GenRefCounter
00826 {
00827
00828 public :
00829 Constraint();
00830 Constraint( const Constraint& constraint );
00831 Constraint( ConstraintImpl* pConstraint );
00832 Constraint& operator = ( const Constraint& constraint );
00833
00834
00835 public :
00836 Project project() const;
00837 Object object() const;
00838 ConstraintPtr getConstraintI() const;
00839
00840 std::string name() const;
00841 std::string description() const;
00842 std::vector<std::string> equation() const;
00843 std::set<ObjectEventType> events() const;
00844 ConstraintPriority priority() const;
00845 ConstraintDepth depth() const;
00846 };
00847
00848 };
00849
00850 #endif // MON_h