00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef BON_h
00023 #define BON_h
00024
00025 #include "Utils.h"
00026 #include "GME.h"
00027 #include "Common.h"
00028 #include "MON.h"
00029
00030 namespace BON
00031 {
00032 class Project;
00033
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 Attribute;
00044 class RegistryNode;
00045 class FCORegistryNode;
00046 class FCOExRegistryNode;
00047 class ModelRegistryNode;
00048 class ConnectionRegistryNode;
00049
00050 class ConnectionEnd;
00051 class ReferencePort;
00052
00053 class ReferencePortContainer;
00054
00055 class TypeInhObject;
00056 class Type;
00057 class Instance;
00058
00059 class Visitor;
00060
00061 class ProjectImpl;
00062
00063 class ObjectImpl;
00064 class FolderImpl;
00065 class FCOImpl;
00066 class AtomImpl;
00067 class ModelImpl;
00068 class SetImpl;
00069 class ReferenceImpl;
00070 class ConnectionImpl;
00071
00072 class AttributeImpl;
00073 class RegistryNodeImpl;
00074 class FCORegistryNodeImpl;
00075 class FCOExRegistryNodeImpl;
00076 class ModelRegistryNodeImpl;
00077 class ConnectionRegistryNodeImpl;
00078
00079 class ConnectionEndImpl;
00080 class ReferencePortImpl;
00081
00082 class ReferencePortContainerImpl;
00083
00084 class TypeInhObjectImpl;
00085 class TypeImpl;
00086 class InstanceImpl;
00087
00088
00089
00090
00091
00092
00093
00094
00095 class Project
00096 : public Util::GenRefCounter
00097 {
00098
00099 public :
00100 Project() { }
00101 Project( const Project& project );
00102 Project( ProjectImpl* pProject );
00103 Project& operator = ( const Project& project );
00104
00105 static Project attach( IMgaProject* spProject );
00106
00107
00108 public :
00109 ProjectImpl* operator -> () const;
00110 };
00111
00112
00113
00114
00115
00116
00117
00118 class Object
00119 : virtual public Util::GenRefCounter
00120 {
00121
00122 public :
00123 Object() { }
00124 Object( ObjectImpl* pObject );
00125 Object( const Object& object );
00126 Object& operator = ( const Object& object );
00127
00128 static Object attach( IMgaObject* spObject );
00129
00130
00131 protected :
00132 bool castObjectImpl( ObjectType eType, ObjectType eType2 = OT_Null );
00133
00134
00135 public :
00136 ObjectImpl* operator -> () const;
00137 };
00138
00139
00140
00141
00142
00143
00144
00145 class RegistryNode
00146 : public Util::GenRefCounter
00147 {
00148
00149 public :
00150 RegistryNode() { }
00151 RegistryNode( const RegistryNode& node );
00152 RegistryNode( RegistryNodeImpl* pRegistryNode );
00153 RegistryNode& operator = ( const RegistryNode& node );
00154
00155
00156 public :
00157 RegistryNodeImpl* operator -> () const;
00158 };
00159
00160
00161
00162
00163
00164
00165
00166 class Folder
00167 : public Object
00168 {
00169 public :
00170
00171 typedef FolderImpl implementation_type;
00172 static const ObjectType type;
00173 static const std::string string_type;
00174 static const int inheritance_level;
00175
00176
00177 private :
00178 static std::vector<std::string> vecDerivedKinds;
00179 protected :
00180 static void addDerivedKinds( const std::vector<std::string>& vecKinds );
00181
00182
00183 public :
00184 Folder() { }
00185 Folder( FolderImpl* pObject );
00186 Folder( const Object& object );
00187 Folder& operator = ( const Object& object );
00188
00189 static Folder attach( IMgaObject* spObject );
00190 static Folder create( const Folder& parent, const MON::Folder& meta = MON::Folder() );
00191 static Folder create( const Folder& parent, const std::string& strFolder );
00192
00193
00194 public :
00195 FolderImpl* operator -> () const;
00196 };
00197
00198
00199
00200
00201
00202
00203
00204 class ConnectionEnd
00205 : virtual public Util::GenRefCounter
00206 {
00207
00208 public :
00209 typedef std::pair<std::string,Connection> Pair;
00210
00211
00212 public :
00213 ConnectionEnd() { }
00214 ConnectionEnd( ConnectionEndImpl* pObject );
00215 ConnectionEnd( const ConnectionEnd& object );
00216 ConnectionEnd& operator = ( const ConnectionEnd& object );
00217
00218
00219 public :
00220 ConnectionEndImpl* operator -> () const;
00221 };
00222
00223
00224
00225
00226
00227
00228
00229 class ReferencePort
00230 : public ConnectionEnd
00231 {
00232
00233 public :
00234 ReferencePort() { }
00235 ReferencePort( ReferencePortImpl* pObject );
00236 ReferencePort( const ConnectionEnd& object );
00237 ReferencePort& operator = ( const ConnectionEnd& object );
00238
00239
00240 public :
00241 ReferencePortImpl* operator -> () const;
00242 };
00243
00244
00245
00246
00247
00248
00249
00250 class FCO
00251 : public Object, public ConnectionEnd
00252 {
00253 public :
00254
00255 typedef FolderImpl implementation_type;
00256 static const ObjectType type;
00257 static const std::string string_type;
00258 static const int inheritance_level;
00259 static std::vector<std::string> vecDerivedKinds;
00260 protected :
00261 static void addDerivedKinds( const std::vector<std::string>& vecKinds );
00262
00263
00264 public :
00265 FCO() { }
00266 FCO( FCOImpl* pObject );
00267 FCO( const Object& object );
00268 FCO( const ConnectionEnd& object );
00269 FCO( const FCO& object );
00270 FCO& operator = ( const Object& object );
00271 FCO& operator = ( const ConnectionEnd& object );
00272 FCO& operator = ( const FCO& object );
00273
00274 static FCO attach( IMgaObject* spObject );
00275
00276
00277 public :
00278 operator bool () const;
00279 bool operator ! () const;
00280
00281
00282 public :
00283 FCOImpl* operator -> () const;
00284 };
00285
00286
00287
00288
00289
00290
00291
00292 class Attribute
00293 : public Util::GenRefCounter
00294 {
00295
00296 public :
00297 Attribute();
00298 Attribute( AttributeImpl* pObject );
00299 Attribute( const Attribute& object );
00300 Attribute& operator = ( const Attribute& object );
00301
00302
00303 public :
00304 AttributeImpl* operator -> () const;
00305 };
00306
00307
00308
00309
00310
00311
00312
00313 class Atom
00314 : virtual public FCO
00315 {
00316 public :
00317
00318 typedef AtomImpl implementation_type;
00319 static const ObjectType type;
00320 static const std::string string_type;
00321 static const int inheritance_level;
00322
00323
00324 private :
00325 static std::vector<std::string> vecDerivedKinds;
00326 protected :
00327 static void addDerivedKinds( const std::vector<std::string>& vecKinds );
00328
00329
00330 public :
00331 Atom() { }
00332 Atom( AtomImpl* pObject );
00333 Atom( const Object& object );
00334 Atom( const ConnectionEnd& object );
00335 Atom( const FCO& object );
00336 Atom& operator = ( const Object& object );
00337 Atom& operator = ( const ConnectionEnd& object );
00338 Atom& operator = ( const FCO& object );
00339
00340 static Atom attach( IMgaObject* spObject );
00341 static Atom create( const Folder& parent, const MON::Atom& meta = MON::Atom() );
00342 static Atom create( const Folder& parent, const std::string& strAtom );
00343 static Atom create( const Folder& parent, const Atom& baseType, bool bAsInstance = true );
00344 static Atom create( const Model& parent, const MON::Atom& meta = MON::Atom(), const std::string& strRole = "" );
00345 static Atom create( const Model& parent, const std::string& strAtom, const std::string& strRole = "" );
00346 static Atom create( const Model& parent, const Atom& baseType, bool bAsInstance = true, const std::string& strRole = "" );
00347 static Atom createAs( const Model& parent, const std::string& strRole );
00348
00349
00350 public :
00351 AtomImpl* operator -> () const;
00352 };
00353
00354
00355
00356
00357
00358
00359
00360 class Model
00361 : virtual public FCO
00362 {
00363 public :
00364
00365 typedef ModelImpl implementation_type;
00366 static const ObjectType type;
00367 static const std::string string_type;
00368 static const int inheritance_level;
00369
00370
00371 private :
00372 static std::vector<std::string> vecDerivedKinds;
00373 protected :
00374 static void addDerivedKinds( const std::vector<std::string>& vecKinds );
00375
00376
00377 public :
00378 Model() { }
00379 Model( ModelImpl* pObject );
00380 Model( const Object& object );
00381 Model( const ConnectionEnd& object );
00382 Model( const FCO& object );
00383 Model& operator = ( const Object& object );
00384 Model& operator = ( const ConnectionEnd& object );
00385 Model& operator = ( const FCO& object );
00386
00387 static Model attach( IMgaObject* spObject );
00388 static Model create( const Folder& parent, const MON::Model& meta = MON::Model() );
00389 static Model create( const Folder& parent, const std::string& strModel );
00390 static Model create( const Folder& parent, const Model& baseType, bool bAsInstance = true );
00391 static Model create( const Model& parent, const MON::Model& meta = MON::Model(), const std::string& strRole = "" );
00392 static Model create( const Model& parent, const std::string& strModel, const std::string& strRole = "" );
00393 static Model create( const Model& parent, const Model& baseType, bool bAsInstance = true, const std::string& strRole = "" );
00394 static Model createAs( const Model& parent, const std::string& strRole );
00395
00396
00397 public :
00398 ModelImpl* operator -> () const;
00399 };
00400
00401
00402
00403
00404
00405
00406
00407 class Set
00408 : virtual public FCO
00409 {
00410 public :
00411
00412 typedef SetImpl implementation_type;
00413 static const ObjectType type;
00414 static const std::string string_type;
00415 static const int inheritance_level;
00416
00417
00418 private :
00419 static std::vector<std::string> vecDerivedKinds;
00420 protected :
00421 static void addDerivedKinds( const std::vector<std::string>& vecKinds );
00422
00423
00424 public :
00425 Set() { }
00426 Set( SetImpl* pObject );
00427 Set( const Object& object );
00428 Set( const ConnectionEnd& object );
00429 Set( const FCO& object );
00430 Set& operator = ( const Object& object );
00431 Set& operator = ( const ConnectionEnd& object );
00432 Set& operator = ( const FCO& object );
00433
00434 static Set attach( IMgaObject* spObject );
00435 static Set create( const Folder& parent, const MON::Set& meta = MON::Set() );
00436 static Set create( const Folder& parent, const std::string& strSet );
00437 static Set create( const Folder& parent, const Set& baseType, bool bAsInstance = true );
00438 static Set create( const Model& parent, const MON::Set& meta = MON::Set(), const std::string& strRole = "" );
00439 static Set create( const Model& parent, const std::string& strSet, const std::string& strRole = "" );
00440 static Set create( const Model& parent, const Set& baseType, bool bAsInstance = true, const std::string& strRole = "" );
00441 static Set createAs( const Model& parent, const std::string& strRole );
00442
00443
00444 public :
00445 SetImpl* operator -> () const;
00446 };
00447
00448
00449
00450
00451
00452
00453
00454 class Reference
00455 : virtual public FCO
00456 {
00457 public :
00458
00459 typedef ReferenceImpl implementation_type;
00460 static const ObjectType type;
00461 static const std::string string_type;
00462 static const int inheritance_level;
00463
00464
00465 private :
00466 static std::vector<std::string> vecDerivedKinds;
00467 protected :
00468 static void addDerivedKinds( const std::vector<std::string>& vecKinds );
00469
00470
00471 public :
00472 Reference() { }
00473 Reference( ReferenceImpl* pObject );
00474 Reference( const Object& object );
00475 Reference( const ConnectionEnd& object );
00476 Reference( const FCO& object );
00477 Reference& operator = ( const Object& object );
00478 Reference& operator = ( const ConnectionEnd& object );
00479 Reference& operator = ( const FCO& object );
00480
00481 static Reference attach( IMgaObject* spObject );
00482 static Reference create( const Folder& parent, const MON::Reference& meta = MON::Reference() );
00483 static Reference create( const Folder& parent, const std::string& strReference );
00484 static Reference create( const Folder& parent, const Reference& baseType, bool bAsInstance = true );
00485 static Reference create( const Model& parent, const MON::Reference& meta = MON::Reference(), const std::string& strRole = "" );
00486 static Reference create( const Model& parent, const std::string& strReference, const std::string& strRole = "" );
00487 static Reference create( const Model& parent, const Reference& baseType, bool bAsInstance = true, const std::string& strRole = "" );
00488 static Reference createAs( const Model& parent, const std::string& strRole );
00489
00490
00491 public :
00492 ReferenceImpl* operator -> () const;
00493 };
00494
00495
00496
00497
00498
00499
00500
00501 class Connection
00502 : virtual public FCO
00503 {
00504
00505 public :
00506 typedef std::pair<std::string,ConnectionEnd> Pair;
00507 typedef ConnectionImpl implementation_type;
00508 static const ObjectType type;
00509 static const std::string string_type;
00510 static const int inheritance_level;
00511
00512
00513 private :
00514 static std::vector<std::string> vecDerivedKinds;
00515 protected :
00516 static void addDerivedKinds( const std::vector<std::string>& vecKinds );
00517
00518
00519 public :
00520 Connection() { }
00521 Connection( ConnectionImpl* pObject );
00522 Connection( const Object& object );
00523 Connection( const ConnectionEnd& object );
00524 Connection( const FCO& object );
00525 Connection& operator = ( const Object& object );
00526 Connection& operator = ( const ConnectionEnd& object );
00527 Connection& operator = ( const FCO& object );
00528
00529 static Connection attach( IMgaObject* spObject );
00530 static Connection create( const Model& parent, const std::set<Pair>& ends, const MON::Connection& meta = MON::Connection(), const std::string& strRole = "" );
00531 static Connection create( const Model& parent, const std::set<Pair>& ends, const std::string& strConnection, const std::string& strRole = "" );
00532 static Connection create( const Model& parent, const ConnectionEnd& srcEnd, const ConnectionEnd& dstEnd, const MON::Connection& meta = MON::Connection(), const std::string& strRole = "" );
00533 static Connection create( const Model& parent, const ConnectionEnd& srcEnd, const ConnectionEnd& dstEnd, const std::string& strConnection, const std::string& strRole = "" );
00534 static Connection createAs( const Model& parent, const std::set<Pair>& ends, const std::string& strRole );
00535 static Connection createAs( const Model& parent, const ConnectionEnd& srcEnd, const ConnectionEnd& dstEnd, const std::string& strRole );
00536
00537
00538 public :
00539 ConnectionImpl* operator -> () const;
00540 };
00541
00542
00543
00544
00545
00546
00547
00548 class ReferencePortContainer
00549 : public Util::GenRefCounter
00550 {
00551
00552 public :
00553 ReferencePortContainer() { }
00554 ReferencePortContainer( const ReferencePortContainer& object );
00555 ReferencePortContainer( ReferencePortContainerImpl* pContainer );
00556 ReferencePortContainer& operator = ( const ReferencePortContainer& object );
00557
00558
00559 public :
00560 ReferencePortContainerImpl* operator -> () const;
00561 };
00562
00563
00564
00565
00566
00567
00568
00569 class TypeInhObject
00570 : public Util::GenRefCounter
00571 {
00572
00573 public :
00574 TypeInhObject() { }
00575 TypeInhObject( const TypeInhObject& object );
00576 TypeInhObject( TypeInhObjectImpl* pObject );
00577 TypeInhObject& operator = ( const TypeInhObject& object );
00578
00579
00580 public :
00581 TypeInhObjectImpl* operator -> () const;
00582 };
00583
00584
00585
00586
00587
00588
00589
00590 class Type
00591 : public TypeInhObject
00592 {
00593
00594 public :
00595 Type() { }
00596 Type( const TypeInhObject& object );
00597 Type( TypeImpl* pObject );
00598 Type& operator = ( const TypeInhObject& object );
00599
00600
00601 public :
00602 TypeImpl* operator -> () const;
00603 };
00604
00605
00606
00607
00608
00609
00610
00611 class Instance
00612 : public TypeInhObject
00613 {
00614
00615 public :
00616 Instance() { }
00617 Instance( const TypeInhObject& object );
00618 Instance( InstanceImpl* pObject );
00619 Instance& operator = ( const TypeInhObject& object );
00620
00621
00622 public :
00623 InstanceImpl* operator -> () const;
00624 };
00625
00626
00627
00628
00629
00630
00631
00632 class FCORegistryNode
00633 : public RegistryNode
00634 {
00635
00636 public :
00637 FCORegistryNode();
00638 FCORegistryNode( const RegistryNode& node );
00639 FCORegistryNode( RegistryNodeImpl* pRegistryNode );
00640 FCORegistryNode& operator = ( const RegistryNode& node );
00641
00642
00643 public :
00644 FCORegistryNodeImpl* operator -> () const;
00645 };
00646
00647
00648
00649
00650
00651
00652
00653 class FCOExRegistryNode
00654 : public FCORegistryNode
00655 {
00656
00657 public :
00658 FCOExRegistryNode();
00659 FCOExRegistryNode( const RegistryNode& node );
00660 FCOExRegistryNode( RegistryNodeImpl* pRegistryNode );
00661 FCOExRegistryNode& operator = ( const RegistryNode& node );
00662
00663
00664 public :
00665 FCOExRegistryNodeImpl* operator -> () const;
00666 };
00667
00668
00669
00670
00671
00672
00673
00674 class ModelRegistryNode
00675 : public FCOExRegistryNode
00676 {
00677
00678 public :
00679 ModelRegistryNode();
00680 ModelRegistryNode( const RegistryNode& node );
00681 ModelRegistryNode( RegistryNodeImpl* pRegistryNode );
00682 ModelRegistryNode& operator = ( const RegistryNode& node );
00683
00684
00685 public :
00686 ModelRegistryNodeImpl* operator -> () const;
00687 };
00688
00689
00690
00691
00692
00693
00694
00695 class ConnectionRegistryNode
00696 : public FCORegistryNode
00697 {
00698
00699 public :
00700 ConnectionRegistryNode();
00701 ConnectionRegistryNode( const RegistryNode& node );
00702 ConnectionRegistryNode( RegistryNodeImpl* pRegistryNode );
00703 ConnectionRegistryNode& operator = ( const RegistryNode& node );
00704
00705
00706 public :
00707 ConnectionRegistryNodeImpl* operator -> () const;
00708 };
00709
00710
00711
00712
00713
00714
00715
00716 class Visitor
00717 {
00718
00719 public :
00720 Visitor() { }
00721 virtual ~Visitor() { }
00722
00723
00724 public :
00725 void visitFolder( const Folder& folder );
00726 void visitAtom( const Atom& atom );
00727 void visitModel( const Model& model );
00728 void visitConnection( const Connection& connection );
00729 void visitSet( const Set& set );
00730 void visitReference( const Reference& reference );
00731 void visitReferencePort( const ReferencePort& port );
00732
00733
00734 protected :
00735 virtual void visitObjectImpl( const Object& object ) { }
00736 virtual void visitConnectionEndImpl( const ConnectionEnd& end ) { }
00737 virtual void visitFCOImpl( const FCO& fco ) { }
00738 virtual void visitFolderImpl( const Folder& folder ) { }
00739 virtual void visitAtomImpl( const Atom& atom ) { }
00740 virtual void visitModelImpl( const Model& model ) { }
00741 virtual void visitConnectionImpl( const Connection& connection ) { }
00742 virtual void visitSetImpl( const Set& set ) { }
00743 virtual void visitReferenceImpl( const Reference& reference ) { }
00744 virtual void visitReferencePortImpl( const ReferencePort& port ) { }
00745 };
00746
00747 };
00748
00749 #endif // BON_h