00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef BONImpl_h
00023 #define BONImpl_h
00024
00025 #pragma warning( disable : 4786 )
00026 #pragma warning( disable : 4503 )
00027
00028 #include "StdAfx.h"
00029 #include "MON.h"
00030 #include "BON.h"
00031 #include "Events.h"
00032
00033 class CEventSink;
00034
00035 namespace BON
00036 {
00037 class Factory;
00038
00039 class ProjectImpl;
00040
00041 class ObjectImpl;
00042 class FolderImpl;
00043 class FCOImpl;
00044 class AtomImpl;
00045 class ModelImpl;
00046 class ConnectionImpl;
00047 class SetImpl;
00048 class ReferenceImpl;
00049
00050 class AttributeImpl;
00051
00052 class RegistryNodeImpl;
00053 class FCORegsitryNodeImpl;
00054 class FCOExRegsitryNodeImpl;
00055 class ModelRegsitryNodeImpl;
00056 class ConnectionRegsitryNodeImpl;
00057
00058 class ConnectionEndImpl;
00059 class ReferencePortImpl;
00060
00061 class ReferencePortContainerImpl;
00062
00063 class TypeInhObjectImpl;
00064 class TypeImpl;
00065 class InstanceImpl;
00066
00067 typedef Util::ComPtr<IMgaProject> ProjectPtr;
00068 typedef Util::ComPtr<IMgaTerritory> TerritoryPtr;
00069 typedef Util::ComPtr<IMgaObject> ObjectPtr;
00070 typedef Util::ComPtr<IMgaFolder> FolderPtr;
00071 typedef Util::ComPtr<IMgaFCO> FCOPtr;
00072 typedef Util::ComPtr<IMgaAtom> AtomPtr;
00073 typedef Util::ComPtr<IMgaModel> ModelPtr;
00074 typedef Util::ComPtr<IMgaConnection> ConnectionPtr;
00075 typedef Util::ComPtr<IMgaSet> SetPtr;
00076 typedef Util::ComPtr<IMgaReference> ReferencePtr;
00077 typedef Util::ComPtr<IMgaAttribute> AttributePtr;
00078 typedef Util::ComPtr<IMgaRegNode> RegNodePtr;
00079 typedef Util::ComPtr<IMgaConnPoint> ConnPointPtr;
00080 typedef Util::ComPtr<IMgaFCOs> FCOsPtr;
00081 typedef Util::ComPtr<IMgaObjects> ObjsPtr;
00082
00083 typedef Util::ComPtr<IGMEOLEApp> GMEAppPtr;
00084 typedef Util::ComPtr<IGMEOLEColl> GMECollPtr;
00085 typedef Util::ComPtr<IGMEOLEPanel> GMEPanelPtr;
00086
00087 typedef std::set<ObjectImpl*> ObjectSet;
00088 typedef std::pair<bool,ObjectSet> ObjectSetPair;
00089 typedef std::set<FolderImpl*> FolderSet;
00090 typedef std::pair<bool,FolderSet> FolderSetPair;
00091 typedef std::set<FCOImpl*> FCOSet;
00092 typedef std::pair<bool,FCOSet> FCOSetPair;
00093 typedef std::set<SetImpl*> SetSet;
00094 typedef std::pair<bool,SetSet> SetSetPair;
00095 typedef std::set<ReferenceImpl*> ReferenceSet;
00096 typedef std::pair<bool,ReferenceSet> ReferenceSetPair;
00097 typedef std::set<ConnectionImpl*> ConnectionSet;
00098 typedef std::pair<bool,ConnectionSet> ConnectionSetPair;
00099 typedef std::set<ConnectionEndImpl*> ConnectionEndSet;
00100 typedef std::pair<bool,ConnectionEndSet> ConnectionEndSetPair;
00101 typedef std::set<ReferencePortImpl*> ReferencePortSet;
00102
00103
00104
00105
00106
00107
00108
00109 class ProjectImpl
00110 : public Util::GenRefCounted, public EventListenerPool
00111 {
00112
00113 private :
00114 typedef std::map<ProjectPtr, ProjectImpl*> ProjectMap;
00115 typedef std::map<std::string, ObjectImpl*> ObjectMapByID;
00116 typedef std::map<MON::Object, ObjectSetPair> ObjectMapByKind;
00117 typedef std::map<ObjectPtr, ObjectImpl*> ObjectMap;
00118 typedef std::set<Factory*> FactorySet;
00119
00120
00121 private :
00122 static ProjectMap mapProjects;
00123 ProjectPtr m_spProject;
00124 TerritoryPtr m_spTerritory;
00125 MON::Project m_meta;
00126
00127 GMEAppPtr m_gme;
00128
00129 bool m_bAutoCommit;
00130 bool m_bIsDestructionActive;
00131 ObjectMap m_mapObjects;
00132 ObjectMapByID m_mapObjectsByID;
00133 ObjectMapByKind m_mapObjectsByKind;
00134
00135 private :
00136 std::string m_nmsp;
00137
00138
00139
00140 private :
00141 ProjectImpl( IMgaProject* spProject );
00142 public :
00143 ~ProjectImpl();
00144 bool setDeleted();
00145 void finalizeObjects();
00146 static Project attach( IMgaProject* spProject );
00147
00148
00149 public :
00150 bool isAutoCommit() const;
00151 void setAutoCommit( bool bAutoCommit );
00152 void commit();
00153 void commitOnly();
00154 void beginOnly();
00155 void beginOnly(transactiontype_enum mode);
00156 void abort();
00157 void abortOnly();
00158 bool isDestructionActive() const;
00159
00160 ProjectPtr getProjectI() const;
00161 TerritoryPtr getTerritoryI() const;
00162 const MON::Project& getProjectMeta() const;
00163
00164 std::string getName() const;
00165 std::string getAuthor() const;
00166 std::string getComment() const;
00167 std::string getCreationTime() const;
00168 std::string getChangeTime() const;
00169 std::string getGUID() const;
00170 std::string getVersion() const;
00171 std::string getProjectPath() const;
00172 std::string getParadigmPath() const;
00173 void setName( const std::string& strName );
00174 void setAuthor( const std::string& strAuthor );
00175 void setComment( const std::string& strComment );
00176
00177 std::string getInfoString( Util::InfoOptions usOptions = Util::IO_None ) const;
00178 std::string getInfoString( const std::set<Util::InfoOption>& setOptions ) const;
00179
00180 void assignTerritory(TerritoryPtr terr);
00181
00182 bool isGMEAvailable() const;
00183 GMEAppPtr getGMEI();
00184 void consoleClear();
00185 void consoleMsg(const std::string& msg, msgtype_enum type);
00186 std::string getConsoleContents();
00187 void putConsoleContents(const std::string& htmlMsg);
00188
00189 std::string getGMEVersion();
00190 int getGMEVersionMajor();
00191 int getGMEVersionMinor();
00192 int getGMEVersionPatchLevel();
00193
00194
00195
00196
00197
00198
00199 ObjsPtr getSelectedObjsFromBrowser();
00200
00201 void saveProject();
00202 void saveProjectAs(const std::string& connstr);
00203 void exportProject(const std::string& connstr);
00204 void importProject(const std::string& connstr);
00205
00206 void checkConstraints();
00207 void runComponent(const std::string& progID);
00208
00209 void showFCO(FCO fco);
00210
00211
00212 public:
00213 std::string prefixWNmsp( const std::string& pKindOrRole) const;
00214 std::string getNmsp();
00215 void setNmsp( const std::string& pNmsp);
00216
00217 private:
00218 std::string getNmspFrTerritory() const;
00219 bool setNmspInTerritory();
00220
00221
00222
00223 public :
00224 Folder getRootFolder();
00225 std::set<Folder> getLibraries();
00226
00227 Object findByID( const std::string& strID, bool bExc_IfNotExist = false, bool bTolerateZombies = false );
00228 std::set<Object> findByKind( const MON::Object& meta );
00229 std::set<Object> findByKind( const std::string& strKind );
00230
00231
00232 private :
00233 ObjectImpl* findByCOMI( IMgaObject* spObject ) const;
00234 ObjectImpl* findByIDI( const std::string& strID );
00235 ObjectSet findByKindI( const MON::FCO& meta );
00236 ObjectSet findByKindI( const MON::Folder& meta );
00237 void findByKindI( FolderPtr spFolder, const MON::Folder& meta );
00238
00239 GMEAppPtr getGME();
00240
00241
00242 private :
00243 void onObjectRetrieved( ObjectImpl* pObject );
00244 void onObjectReleased( ObjectImpl* pObject, bool bOnlyMemoryFree );
00245
00246
00247 private :
00248 ProjectImpl( const ProjectImpl& pI ) { }
00249 ProjectImpl& operator = ( const ProjectImpl& pI ) { return *this; }
00250
00251
00252 friend class ObjectImpl;
00253 friend class ConnectionEndImpl;
00254 };
00255
00256
00257
00258
00259
00260
00261
00262 class ObjectImpl
00263 : virtual public Util::GenRefCounted, public EventListenerPool
00264 {
00265
00266 private :
00267 typedef std::pair<MON::Folder,FolderImpl*> OneFolderLink;
00268 typedef std::map<RegNodePtr,RegistryNodeImpl*> RegistryMap;
00269
00270
00271 private :
00272 ObjectPtr m_spObject;
00273 ProjectImpl* m_pProject;
00274 MON::Object m_meta;
00275 OneFolderLink m_parentFolder;
00276 bool m_bAllParentFolders;
00277 RegistryMap m_mapNodes;
00278 bool m_bIsDestructionActive;
00279
00280
00281 protected :
00282 ObjectImpl();
00283 static ObjectImpl* attachI( IMgaObject* spObject, ProjectImpl* pProject = NULL, const MON::Object& meta = MON::Object() );
00284 static ObjectImpl* find( ProjectImpl* pProject, IMgaObject* spObject );
00285 static ObjectImpl* getEx( IMgaObject* spObject, ObjectType eType, const MON::Object& meta = MON::Object() );
00286 void doInitialize( IMgaObject* spObject, ProjectImpl* pProject = NULL, const MON::Object& meta = MON::Object() );
00287 public :
00288 virtual ~ObjectImpl();
00289 bool setDeleted();
00290 static Object attach( IMgaObject* spObject );
00291 void destroy();
00292
00293
00294 public :
00295 Project getProject() const;
00296 ObjectPtr getObjectI() const;
00297 const MON::Object& getObjectMeta() const;
00298
00299 bool isDestructionActive() const;
00300 std::string getID() const;
00301 virtual ObjectType getStereotype() const = 0;
00302 ObjectStatus getStatus() const;
00303 bool isReadOnly() const;
00304 bool isInLibrary() const;
00305
00306 std::string getName() const;
00307 void setName( const std::string& strName );
00308 std::string getPath( const std::string& strDelimiter = "/", bool bReverseOrder = false, bool bNeedRootFolder = false ) const;
00309
00310 virtual std::string getInfoString( Util::InfoOptions usOptions = Util::IO_None ) const = 0;
00311 std::string getInfoString( const std::set<Util::InfoOption>& setOptions ) const;
00312
00313
00314 public :
00315 RegistryNode getRegistry() const;
00316
00317 Folder getParentFolder( const MON::Folder& meta = MON::Folder() );
00318 Folder getParentFolder( const std::string& strFolder );
00319 virtual Object getParent();
00320
00321
00322 public :
00323 virtual void accept( Visitor* pVisitor );
00324 virtual void initialize() { }
00325 virtual void finalize() { }
00326
00327
00328 private :
00329 FolderImpl* getParentFolderI( const MON::Folder& meta = MON::Folder() );
00330
00331
00332 private :
00333 std::string getInfoStringHelper( Util::InfoOptions usOptions, const std::string& strStereo ) const;
00334
00335
00336 private :
00337 bool onRetrievedAsFolderChild( FolderImpl* pFolder, bool bCheckAll );
00338 void onReleasedAsFolderChild( FolderImpl* pFolder, bool bOnlyMemoryFree );
00339
00340 public :
00341 virtual void eventPerformedI( const Event& event );
00342 private :
00343 void onObjectCreated();
00344 void onRegistryChanged();
00345 void onObjectMoved( ObjectImpl* pOldParent, ObjectImpl* pNewParent );
00346
00347
00348 private :
00349 ObjectImpl( const ObjectImpl& oI ) { }
00350 ObjectImpl& operator = ( const ObjectImpl& oI ) { return *this; }
00351
00352
00353 friend class ProjectImpl;
00354 friend class FolderImpl;
00355 friend class FCOImpl;
00356 friend class ModelImpl;
00357 friend class FCOImpl;
00358 friend class ModelImpl;
00359 friend class AtomImpl;
00360 friend class SetImpl;
00361 friend class ReferenceImpl;
00362 friend class ConnectionImpl;
00363 friend class RegistryNodeImpl;
00364 friend class ConnectionEndImpl;
00365 friend class CEventSink;
00366 };
00367
00368
00369
00370
00371
00372
00373
00374 class RegistryNodeImpl
00375 : public Util::GenRefCounted
00376 {
00377
00378 private :
00379 ObjectImpl* m_pObject;
00380 RegNodePtr m_spNode;
00381
00382
00383 private :
00384 RegistryNodeImpl( IMgaRegNode* spNode, ObjectImpl* pObject );
00385 static RegistryNodeImpl* attachI( IMgaRegNode* spNode, ObjectImpl* pObject );
00386 public :
00387 virtual ~RegistryNodeImpl();
00388 bool setDeleted();
00389
00390
00391 public :
00392 Project getProject() const;
00393 Object getObject() const;
00394 RegNodePtr getRegNodeI() const;
00395 bool isRootNode() const;
00396
00397 std::string getName() const;
00398 std::string getPath() const;
00399 RegistryNodeStatus getStatus() const;
00400 std::string getValue() const;
00401 void setValue( const std::string& strValue );
00402 long getIntegerValue() const;
00403 void setIntegerValue( long lValue );
00404 double getRealValue() const;
00405 void setRealValue( double dValue );
00406 bool getBoolValue() const;
00407 void setBoolValue( bool bValue );
00408 void clear();
00409
00410 std::string getValueByPath( const std::string& strPath ) const;
00411 void setValueByPath( const std::string& strPath, const std::string& strValue );
00412
00413
00414 public :
00415 RegistryNode getParent() const;
00416 std::set<RegistryNode> getChildren( bool bVirtualsAlso = false ) const;
00417 RegistryNode getChild( const std::string& strName ) const;
00418 void removeTree();
00419
00420 RegistryNode getDescendantByPath( const std::string& strPath ) const;
00421
00422
00423 private :
00424 RegistryNodeImpl( const RegistryNodeImpl& oI );
00425 RegistryNodeImpl& operator = ( const RegistryNodeImpl& oI ) { return *this; }
00426
00427
00428 friend class ObjectImpl;
00429 friend class FCORegistryNodeImpl;
00430 };
00431
00432
00433
00434
00435
00436
00437
00438 class FolderImpl
00439 : public ObjectImpl
00440 {
00441
00442 private :
00443 typedef std::map<MON::Object,ObjectSetPair> ManyObjectLink;
00444
00445
00446 private :
00447 ManyObjectLink m_childObjects;
00448 bool m_bAllChildObjects;
00449
00450
00451 protected :
00452 FolderImpl();
00453 static FolderImpl* attachI( IMgaFolder* spFolder, ProjectImpl* pProject = NULL, const MON::Object& meta = MON::Object() );
00454 static FolderImpl* createI( FolderImpl* pParentFolder, const MON::Folder& meta );
00455 public :
00456 ~FolderImpl();
00457 bool setDeleted();
00458 static Folder attach( IMgaFolder* spFolder );
00459 static Folder create( const Folder& parent, const MON::Folder& meta = MON::Folder() );
00460 static Folder create( const Folder& parent, const std::string& strFolder );
00461
00462
00463 public :
00464 ObjectType getStereotype() const;
00465 FolderPtr getFolderI() const;
00466 MON::Folder getFolderMeta() const;
00467
00468 std::string getInfoString( Util::InfoOptions usOptions = Util::IO_None ) const;
00469
00470
00471 public :
00472 std::set<Object> getChildObjects( const MON::Object& meta = MON::Object() );
00473 std::set<Object> getChildObjects( const std::string& strObject );
00474 std::set<Folder> getChildFolders();
00475 std::set<FCO> getRootFCOs();
00476 std::set<Atom> getChildAtoms();
00477 std::set<Model> getChildModels();
00478
00479 Object findByPath( const std::string& strPath, const std::string& strDelimiter = "/", bool bReverseOrder = false );
00480
00481
00482 public :
00483 virtual void accept( Visitor* pVisitor );
00484
00485
00486 private :
00487 ObjectSet getChildObjectsI( const MON::Object& meta = MON::Object() );
00488
00489 ObjectImpl* createChildObjectI( const MON::Object& meta, MON::ObjectType eType );
00490 FCOImpl* createChildFCOI( const FCO& fco, bool bAsInstance, MON::ObjectType eType );
00491
00492
00493 private :
00494 bool isChildObjectsRetrieved( const MON::Object& meta );
00495 void getChildFolders( std::set<ObjectPtr>& setSPFolders );
00496 void getRootFCOs( std::set<ObjectPtr>& setSPFCOs );
00497 void getChildObjects( const MON::Object& meta, std::set<ObjectPtr>& setSPObjects, bool bErase );
00498
00499
00500 private :
00501 bool onRetrievedAsObjectParent( ObjectImpl* pObject, bool bCheckAll );
00502 void onReleasedAsObjectParent( ObjectImpl* pObject, bool bOnlyMemoryFree );
00503
00504 void eventPerformedI( const Event& event );
00505 void onChildAdded( ObjectImpl* pChild );
00506 void onChildRemoved( ObjectImpl* pChild );
00507
00508
00509 private :
00510 FolderImpl( const FolderImpl& oI ) : ObjectImpl() { }
00511 FolderImpl& operator = ( const FolderImpl& oI ) { return *this; }
00512
00513
00514 friend class ObjectImpl;
00515 friend class FCOImpl;
00516 friend class AtomImpl;
00517 friend class ModelImpl;
00518 friend class SetImpl;
00519 friend class ReferenceImpl;
00520 };
00521
00522
00523
00524
00525
00526
00527
00528 class ConnectionEndImpl
00529 : virtual public Util::GenRefCounted
00530 {
00531
00532 private :
00533 typedef std::map<MON::ConnectionEnd::Pair,ConnectionSetPair> ManyConnectionLink;
00534
00535
00536 private :
00537 ProjectImpl* m_pProject;
00538 ManyConnectionLink m_connections;
00539 bool m_bAllConnections;
00540
00541
00542 protected :
00543 ConnectionEndImpl();
00544 static ConnectionEndImpl* attachI( IMgaConnPoint* spCP, ProjectImpl* pProject = NULL, const MON::Object& meta = MON::Object() );
00545 public :
00546 virtual ~ConnectionEndImpl();
00547 bool setDeleted();
00548
00549
00550 private :
00551 void setProject( ProjectImpl* pProject );
00552
00553
00554 public :
00555 Project getProject() const;
00556 virtual bool isReferencePort() const = 0;
00557
00558 virtual std::string getInfoString( Util::InfoOptions usOptions = Util::IO_None ) const = 0;
00559 std::string getInfoString( const std::set<Util::InfoOption>& setOptions ) const;
00560
00561
00562 public :
00563 std::set<Connection> getConnLinks( const MON::Connection& meta = MON::Connection(), const std::string& strRole = "", bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00564 std::set<Connection> getConnLinks( const std::string& strConnection, const std::string& strRole = "", bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00565 std::set<Connection> getInConnLinks( const MON::Connection& meta = MON::Connection(), bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00566 std::set<Connection> getInConnLinks( const std::string& strConnection, bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00567 std::set<Connection> getOutConnLinks( const MON::Connection& meta = MON::Connection(), bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00568 std::set<Connection> getOutConnLinks( const std::string& strConnection, bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00569
00570 std::multiset<ConnectionEnd> getConnEndsAs( const MON::Connection& meta = MON::Connection(), const std::string& strRole = "", bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00571 std::multiset<ConnectionEnd> getConnEndsAs( const std::string& strConnection, const std::string& strRole = "", bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00572 std::multiset<ConnectionEnd> getInConnEnds( const MON::Connection& meta = MON::Connection(), bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00573 std::multiset<ConnectionEnd> getInConnEnds( const std::string& strConnection, bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00574 std::multiset<ConnectionEnd> getOutConnEnds( const MON::Connection& meta = MON::Connection(), bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00575 std::multiset<ConnectionEnd> getOutConnEnds( const std::string& strConnection, bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00576
00577 std::multiset<ConnectionEnd> getDirectConnEnds( const MON::Connection& meta, const std::string& strRole, bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00578 std::multiset<ConnectionEnd> getDirectConnEnds( const std::string& strConnection, const std::string& strRole, bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00579 std::multiset<ConnectionEnd> getDirectInConnEnds( const MON::Connection& meta, bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00580 std::multiset<ConnectionEnd> getDirectInConnEnds( const std::string& strConnection, bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00581 std::multiset<ConnectionEnd> getDirectOutConnEnds( const MON::Connection& meta, bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00582 std::multiset<ConnectionEnd> getDirectOutConnEnds( const std::string& strConnection, bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00583
00584 std::multiset<ConnectionEnd> getConnEnds( const MON::Connection& meta = MON::Connection(), const std::string& strRole = "", bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00585 std::multiset<ConnectionEnd> getConnEnds( const std::string& strConnection, const std::string& strRole = "", bool bIncludeRefs = true, const MON::Aspect& aspect = MON::Aspect() );
00586
00587
00588 public :
00589 virtual void accept( Visitor* pVisitor );
00590
00591
00592 private :
00593 ConnectionSet getConnectionsI( const std::string& strRole = "", const MON::Connection& meta = MON::Connection(), bool bOnlyCE = false );
00594
00595
00596 private :
00597 bool isConnectionsRetrieved( const MON::ConnectionEnd::Pair& meta );
00598 void getConnections( std::set<ConnPointPtr>& setSPConnPoints );
00599 void getConnections( const MON::ConnectionEnd::Pair& meta, std::set<ConnPointPtr>& setSPConnPoints, bool bErase );
00600 FCOImpl* getFCOHelper() const;
00601 void getDirectConnEndsRec( ConnectionEnd& ce, const MON::Connection& meta, const std::string& strRole, bool bIncludeRefs, std::multiset<ConnectionEnd>& setResult );
00602
00603
00604 private :
00605 bool onRetrievedAsConnectionEnd( ConnectionImpl* pConnection, const std::string& strRole, bool bCheck );
00606 void onReleasedAsConnectionEnd( ConnectionImpl* pConnection, const std::string& strRole, bool bOnlyMemoryFree );
00607
00608
00609 private :
00610 ConnectionEndImpl( const ConnectionEndImpl& pI ) { }
00611 ConnectionEndImpl& operator = ( const ConnectionEndImpl& pI ) { return *this; }
00612
00613
00614 friend class ConnectionImpl;
00615 friend class FCOImpl;
00616 friend class ReferencePortImpl;
00617 };
00618
00619
00620
00621
00622
00623
00624
00625 class ReferencePortImpl
00626 : public ConnectionEndImpl
00627 {
00628
00629 private :
00630 FCOImpl* m_pFCO;
00631 ReferenceImpl* m_pContainer;
00632
00633
00634 private :
00635 ReferencePortImpl( ReferenceImpl* pContainer, FCOImpl* pFCO );
00636 public :
00637 ~ReferencePortImpl();
00638 bool setDeleted();
00639
00640
00641 public :
00642 bool isReferencePort() const;
00643 FCO getFCO() const;
00644 ReferencePortContainer getContainer() const;
00645
00646 std::string getInfoString( Util::InfoOptions usOptions = Util::IO_None ) const;
00647
00648
00649 public :
00650 ReferencePort getParentPort() const;
00651 std::set<ReferencePort> getChildPorts() const;
00652 std::set<ReferencePort> getDescendantPorts() const;
00653
00654
00655 private :
00656 void getDescendantPortsI( std::set<Reference>& setVisited, std::set<ReferencePort>& setPorts ) const;
00657
00658
00659 public :
00660 virtual void accept( Visitor* pVisitor );
00661
00662
00663 private :
00664 ReferencePortImpl( const ReferencePortImpl& pI ) { }
00665 ReferencePortImpl& operator = ( const ReferencePortImpl& pI ) { return *this; }
00666
00667
00668 friend class ReferenceImpl;
00669 friend class ConnectionEndImpl;
00670 };
00671
00672
00673
00674
00675
00676
00677
00678 class FCOImpl
00679 : public ObjectImpl, public ConnectionEndImpl
00680 {
00681
00682 private :
00683 typedef std::pair<MON::Model,ModelImpl*> OneModelLink;
00684 typedef std::map<MON::Set,SetSetPair> ManySetLink;
00685 typedef std::map<MON::Reference,ReferenceSetPair> ManyReferenceLink;
00686 typedef std::map<MON::Attribute,AttributeImpl*> ManyAttributeLink;
00687 typedef std::set< Reference> REFWRAPPERS;
00688
00689
00690 private :
00691 OneModelLink m_parentModel;
00692 bool m_bAllParentModels;
00693 FCOImpl* m_pType;
00694 bool m_bAllTypeFCOs;
00695 FCOSet m_setInstances;
00696 bool m_bAllInstanceFCOs;
00697 FCOSet m_setSubTypes;
00698 bool m_bAllSubTypeFCOs;
00699 ManySetLink m_sets;
00700 bool m_bAllSets;
00701 ManyReferenceLink m_references;
00702 bool m_bAllReferences;
00703 ManyAttributeLink m_attributes;
00704 bool m_bAllAttributes;
00705 ReferencePortSet m_refPorts;
00706 bool m_bAllRefPorts;
00707 TypeInhObjectImpl* m_pTIObject;
00708
00709
00710 protected :
00711 FCOImpl();
00712 static FCOImpl* attachI( IMgaFCO* spFCO, ProjectImpl* pProject = NULL, const MON::Object& meta = MON::Object() );
00713 static void attachIPost( FCOImpl* pFCO );
00714 void doInitialize( ProjectImpl* pProject );
00715 public :
00716 virtual ~FCOImpl();
00717 bool setDeleted();
00718 static FCO attach( IMgaFCO* spFCO );
00719
00720
00721 public :
00722 Project getProject() const;
00723 FCOPtr getFCOI() const;
00724 MON::FCO getFCOMeta() const;
00725
00726 virtual bool isReferencePort() const;
00727
00728 MON::Containment getRole();
00729 bool isPort( const MON::Aspect& meta = MON::Aspect() );
00730 bool isPort( const std::string& strAspect );
00731 bool isVisible( const MON::Aspect& meta, bool bAsContained = false );
00732 bool isVisible( const std::string& strAspect, bool bAsContained = false );
00733
00734 virtual std::string getInfoString( Util::InfoOptions usOptions = Util::IO_None ) const = 0;
00735 std::string getInfoString( const std::set<Util::InfoOption>& setOptions ) const;
00736
00737
00738
00739 public :
00740 std::set<ReferencePort> getReferencePorts( const MON::Aspect& meta = MON::Aspect() );
00741
00742 std::set<Attribute> getAttributes();
00743 Attribute getAttribute( const MON::Attribute& meta );
00744 Attribute getAttribute( const std::string& strName );
00745
00746 Object getParent();
00747 Model getParentModel( const MON::Model& meta = MON::Model() );
00748 Model getParentModel( const std::string& strModel );
00749 Model getParentModelAs( const std::string& strRole );
00750
00751 std::set<Set> getMemberOf( const MON::Set& meta = MON::Set(), const MON::Aspect& aspect = MON::Aspect() );
00752 std::set<Set> getMemberOf( const std::string& strSet, const MON::Aspect& aspect = MON::Aspect() );
00753
00754 std::set<Reference> getReferredBy( const MON::Reference& meta = MON::Reference() );
00755 std::set<Reference> getReferredBy( const std::string& strReference );
00756
00757 TypeInhObject getTypeInhObject() const;
00758
00759 FCO copy( const Folder& parent );
00760 FCO move( const Folder& parent );
00761 FCO copy( const Model& parent, const std::string strRole = "" );
00762 FCO move( const Model& parent, const std::string strRole = "" );
00763
00764
00765 private :
00766 AttributeImpl* getAttributeI( const MON::Attribute& meta );
00767
00768 ModelImpl* getParentModelI( const MON::Model& meta = MON::Model() );
00769
00770 bool isInstance() const;
00771 FCOImpl* getType();
00772 FCOSet getDerivedFCOs( bool bInstance );
00773
00774 ReferencePortSet getRefPortRefsI();
00775 REFWRAPPERS m_storedRefWrappers;
00776
00777 SetSet getSetsI( const MON::Set& meta = MON::Set() );
00778 ReferenceSet getReferencesI( const MON::Reference& meta = MON::Reference() );
00779
00780
00781 private :
00782 bool isSetsRetrieved( const MON::Set& meta );
00783 void getSets( std::set<SetPtr>& setSPSets );
00784 void getSets( const MON::Set& meta, std::set<SetPtr>& setSPSets, bool bErase );
00785 bool isReferencesRetrieved( const MON::Reference& meta );
00786 void getReferences( std::set<ReferencePtr>& setSPReferences );
00787 void getReferences( const MON::Reference& meta, std::set<ReferencePtr>& setSPReferences, bool bErase );
00788
00789
00790 private :
00791 bool onRetrievedAsModelChild( ModelImpl* pModel, bool bCheckAll );
00792 void onReleasedAsModelChild( ModelImpl* pModel, bool bOnlyMemoryFree );
00793 bool onRetrievedAsType( FCOImpl* pFCO, bool bCheckAll );
00794 void onReleasedAsType( FCOImpl* pFCO, bool bOnlyMemoryFree );
00795 bool onRetrievedAsDerived( FCOImpl* pFCO, bool bCheckAll );
00796 void onReleasedAsDerived( FCOImpl* pFCO, bool bOnlyMemoryFree );
00797 bool onRetrievedAsMember( SetImpl* pSet, bool bCheckAll );
00798 void onReleasedAsMember( SetImpl* pSet, bool bOnlyMemoryFree );
00799 bool onRetrievedAsReferred( ReferenceImpl* pReference, bool bCheckAll );
00800 void onReleasedAsReferred( ReferenceImpl* pReference, bool bOnlyMemoryFree );
00801 bool onRetrievedAsReferencePort( ReferencePortImpl* pPort, bool bCheckAll );
00802 void onReleasedAsReferencePort( ReferencePortImpl* pPort, bool bOnlyMemoryFree );
00803
00804 public :
00805 void eventPerformedI( const Event& event );
00806 private :
00807 void onObjectCreated();
00808 void onObjectMoved( ObjectImpl* pOldParent, ObjectImpl* pNewParent );
00809 void onFCOReferenced( ReferenceImpl* pReference );
00810 void onFCOUnreferenced( ReferenceImpl* pReference );
00811 void onFCOIncluded( SetImpl* pSet );
00812 void onFCOExcluded( SetImpl* pSet );
00813 void onObjectDerived( FCOImpl* pFCO );
00814
00815
00816 public :
00817 virtual void accept( Visitor* pVisitor );
00818 FCORegistryNode getRegistry() const;
00819
00820
00821 private :
00822 FCOImpl( const FCOImpl& oI ) : ObjectImpl() { }
00823 FCOImpl& operator = ( const FCOImpl& oI ) { return *this; }
00824
00825
00826 friend class ObjectImpl;
00827 friend class AtomImpl;
00828 friend class FolderImpl;
00829 friend class ModelImpl;
00830 friend class SetImpl;
00831 friend class ConnectionImpl;
00832 friend class ReferenceImpl;
00833 friend class ConnectionEndImpl;
00834 friend class ReferencePortImpl;
00835 friend class AttributeImpl;
00836 friend class TypeInhObjectImpl;
00837 friend class TypeImpl;
00838 };
00839
00840
00841
00842
00843
00844
00845
00846 class AttributeImpl
00847 : public Util::GenRefCounted
00848 {
00849
00850 private :
00851
00852
00853 private :
00854 FCOImpl* m_pFCO;
00855 AttributePtr m_spAttribute;
00856 MON::Attribute m_meta;
00857
00858
00859 protected :
00860 AttributeImpl( IMgaAttribute* spAttribute, FCOImpl* pFCO, const MON::Attribute& meta );
00861 static AttributeImpl* attachI( IMgaAttribute* spAttribute, FCOImpl* pFCO, const MON::Attribute& meta );
00862 public :
00863 ~AttributeImpl();
00864 bool setDeleted();
00865
00866
00867 public :
00868 Project getProject() const;
00869 FCO getFCO() const;
00870 AttributePtr getAttributeI() const;
00871 const MON::Attribute& getAttributeMeta() const;
00872
00873 AttributeStatus getStatus() const;
00874
00875 Util::Variant getValue() const;
00876 void setValue( const Util::Variant& value, bool bTypeTolerant = true );
00877 long getIntegerValue( bool bTypeTolerant = true ) const;
00878 void setIntegerValue( long lValue, bool bTypeTolerant = true );
00879 bool getBooleanValue( bool bTypeTolerant = true ) const;
00880 void setBooleanValue( bool bValue, bool bTypeTolerant = true );
00881 double getRealValue( bool bTypeTolerant = true ) const;
00882 void setRealValue( double dValue, bool bTypeTolerant = true );
00883 std::string getStringValue( bool bTypeTolerant = true ) const;
00884 void setStringValue( const std::string& strValue, bool bTypeTolerant = true );
00885 bool isUndefined() const;
00886 void clear();
00887
00888
00889 private :
00890 void checkTypes( const Util::Variant& value, bool bExc ) const;
00891 Util::Variant checkTypes( Util::Variant::Type eType, const Util::Variant& value, bool bExc ) const;
00892
00893
00894 private :
00895 AttributeImpl( const AttributeImpl& oI );
00896 AttributeImpl& operator = ( const AttributeImpl& oI ) { return *this; }
00897
00898
00899 friend class FCOImpl;
00900 };
00901
00902
00903
00904
00905
00906
00907
00908 class AtomImpl
00909 : virtual public FCOImpl
00910 {
00911
00912 protected :
00913 AtomImpl();
00914 static AtomImpl* attachI( IMgaAtom* spAtom, ProjectImpl* pProject = NULL, const MON::Object& meta = MON::Object() );
00915 public :
00916 ~AtomImpl();
00917 static Atom attach( IMgaAtom* spAtom );
00918 static Atom create( const Folder& parent, const MON::Atom& meta = MON::Atom() );
00919 static Atom create( const Folder& parent, const std::string& strAtom );
00920 static Atom create( const Folder& parent, const Atom& baseType, bool bAsInstance = true );
00921 static Atom create( const Model& parent, const MON::Atom& meta = MON::Atom(), const std::string& strRole = "" );
00922 static Atom create( const Model& parent, const std::string& strAtom, const std::string& strRole = "" );
00923 static Atom create( const Model& parent, const Atom& baseType, bool bAsInstance = true, const std::string& strRole = "" );
00924 static Atom createAs( const Model& parent, const std::string& strRole );
00925
00926
00927 public :
00928 ObjectType getStereotype() const;
00929 AtomPtr getAtomI() const;
00930 MON::Atom getAtomMeta() const;
00931
00932 std::string getInfoString( Util::InfoOptions usOptions = Util::IO_None ) const;
00933
00934
00935 public :
00936 virtual void accept( Visitor* pVisitor );
00937 FCOExRegistryNode getRegistry() const;
00938
00939
00940 private :
00941 AtomImpl( const AtomImpl& oI ) : FCOImpl() { }
00942 AtomImpl& operator = ( const AtomImpl& oI ) { return *this; }
00943
00944
00945 friend class FCOImpl;
00946 };
00947
00948
00949
00950
00951
00952
00953
00954 class ModelImpl
00955 : virtual public FCOImpl
00956 {
00957
00958 private :
00959 typedef std::map<MON::FCO,FCOSetPair> ManyFCOLink;
00960
00961
00962 private :
00963 ManyFCOLink m_childFCOs;
00964 bool m_bAllChildFCOs;
00965
00966
00967 protected :
00968 ModelImpl();
00969 static ModelImpl* attachI( IMgaModel* spModel, ProjectImpl* pProject = NULL, const MON::Object& meta = MON::Object() );
00970 public :
00971 ~ModelImpl();
00972 bool setDeleted();
00973 static Model attach( IMgaModel* spModel );
00974 static Model create( const Folder& parent, const MON::Model& meta = MON::Model() );
00975 static Model create( const Folder& parent, const std::string& strModel );
00976 static Model create( const Folder& parent, const Model& baseType, bool bAsInstance = true );
00977 static Model create( const Model& parent, const MON::Model& meta = MON::Model(), const std::string& strRole = "" );
00978 static Model create( const Model& parent, const std::string& strModel, const std::string& strRole = "" );
00979 static Model create( const Model& parent, const Model& baseType, bool bAsInstance = true, const std::string& strRole = "" );
00980 static Model createAs( const Model& parent, const std::string& strRole );
00981
00982
00983 public :
00984 ObjectType getStereotype() const;
00985 ModelPtr getModelI() const;
00986 MON::Model getModelMeta() const;
00987
00988 std::string getInfoString( Util::InfoOptions usOptions = Util::IO_None ) const;
00989
00990
00991 public :
00992 std::set<FCO> getChildFCOs( const MON::FCO& meta = MON::FCO(), const MON::Aspect& aspect = MON::Aspect() );
00993 std::set<FCO> getChildFCOs( const std::string& strFCO, const MON::Aspect& aspect = MON::Aspect() );
00994 std::set<FCO> getChildFCOsAs( const std::string& strRole, const MON::Aspect& aspect = MON::Aspect() );
00995 std::set<Atom> getChildAtoms( const MON::Aspect& aspect = MON::Aspect() );
00996 std::set<Model> getChildModels( const MON::Aspect& aspect = MON::Aspect() );
00997 std::set<Set> getChildSets( const MON::Aspect& aspect = MON::Aspect() );
00998 std::set<Reference> getChildReferences( const MON::Aspect& aspect = MON::Aspect() );
00999 std::set<Connection> getChildConnections( const MON::Aspect& aspect = MON::Aspect() );
01000
01001 FCO findByPath( const std::string& strPath, const std::string& strDelimiter = "/", bool bReverseOrder = false );
01002 std::set<FCO> findByKind( const MON::Object& meta );
01003 std::set<FCO> findByKind( const std::string& strKind );
01004
01005
01006 public :
01007 virtual void accept( Visitor* pVisitor );
01008 ModelRegistryNode getRegistry() const;
01009
01010
01011 private :
01012 FCOSet getChildFCOsI( const MON::FCO& meta = MON::FCO() );
01013
01014 FCOImpl* createChildFCOI( const std::string& strRole, MON::ObjectType eType );
01015 FCOImpl* createChildFCOI( const MON::FCO& meta, const std::string& strRole, MON::ObjectType eType );
01016 FCOImpl* createChildFCOI( const BON::FCO& fco, bool bAsInstance, const std::string& strRole, MON::ObjectType eType );
01017 std::set<FCO> findByKindHlp( const MON::FCO& meta );
01018
01019
01020 private :
01021 bool isChildFCOsRetrieved( const MON::FCO& meta );
01022 void getChildFCOs( std::set<FCOPtr>& setSPFCOs );
01023 void getChildFCOs( const MON::FCO& meta, std::set<FCOPtr>& setSPFCOs, bool bErase );
01024
01025
01026 private :
01027 bool onRetrievedAsFCOParent( FCOImpl* pFCO, bool bCheckAll );
01028 void onReleasedAsFCOParent( FCOImpl* pFCO, bool bOnlyMemoryFree );
01029
01030 public :
01031 void eventPerformedI( const Event& event );
01032 private :
01033 void onChildAdded( FCOImpl* pChild );
01034 void onChildRemoved( FCOImpl* pChild );
01035 void onObjectDerived( FCOImpl* pFCO );
01036
01037
01038 private :
01039 ModelImpl( const ModelImpl& oI ) : FCOImpl() { }
01040 ModelImpl& operator = ( const ModelImpl& oI ) { return *this; }
01041
01042
01043 friend class FCOImpl;
01044 friend class AtomImpl;
01045 friend class ModelImpl;
01046 friend class SetImpl;
01047 friend class ReferenceImpl;
01048 };
01049
01050
01051
01052
01053
01054
01055
01056 class SetImpl
01057 : virtual public FCOImpl
01058 {
01059
01060 private :
01061 typedef std::map<MON::FCO,FCOSetPair> ManyFCOLink;
01062
01063
01064 private :
01065 ManyFCOLink m_memberFCOs;
01066 bool m_bAllMemberFCOs;
01067
01068
01069 protected :
01070 SetImpl();
01071 static SetImpl* attachI( IMgaSet* spSet, ProjectImpl* pProject = NULL, const MON::Object& meta = MON::Object() );
01072 public :
01073 ~SetImpl();
01074 bool setDeleted();
01075 static Set attach( IMgaSet* spSet );
01076 static Set create( const Folder& parent, const MON::Set& meta = MON::Set() );
01077 static Set create( const Folder& parent, const std::string& strSet );
01078 static Set create( const Folder& parent, const Set& baseType, bool bAsInstance = true );
01079 static Set create( const Model& parent, const MON::Set& meta = MON::Set(), const std::string& strRole = "" );
01080 static Set create( const Model& parent, const std::string& strSet, const std::string& strRole = "" );
01081 static Set create( const Model& parent, const Set& baseType, bool bAsInstance = true, const std::string& strRole = "" );
01082 static Set createAs( const Model& parent, const std::string& strRole );
01083
01084
01085 public :
01086 ObjectType getStereotype() const;
01087 SetPtr getSetI() const;
01088 MON::Set getSetMeta() const;
01089
01090 std::string getInfoString( Util::InfoOptions usOptions = Util::IO_None ) const;
01091
01092
01093 public :
01094 std::set<FCO> getMembers( const MON::FCO& meta = MON::FCO(), const MON::Aspect& aspect = MON::Aspect() );
01095 std::set<FCO> getMembers( const std::string& strFCO, const MON::Aspect& aspect = MON::Aspect() );
01096
01097 void addMember( const BON::FCO& fco );
01098 void removeMember( const BON::FCO& fco );
01099
01100
01101 public :
01102 virtual void accept( Visitor* pVisitor );
01103 FCOExRegistryNode getRegistry() const;
01104
01105
01106 private :
01107 FCOSet getMemberFCOsI( const MON::FCO& meta = MON::FCO() );
01108
01109 void addMemberI( const BON::FCO& fco );
01110 void removeMemberI( const BON::FCO& fco );
01111
01112
01113 private :
01114 bool isMemberFCOsRetrieved( const MON::FCO& meta );
01115 void getMemberFCOs( std::set<FCOPtr>& setSPFCOs );
01116 void getMemberFCOs( const MON::FCO& meta, std::set<FCOPtr>& setSPFCOs, bool bErase );
01117
01118
01119 private :
01120 bool onRetrievedAsSet( FCOImpl* pFCO, bool bCheckAll );
01121 void onReleasedAsSet( FCOImpl* pFCO, bool bOnlyMemoryFree );
01122
01123 public :
01124 virtual void eventPerformedI( const Event& event );
01125 private :
01126 void onRelationChanged();
01127
01128
01129 private :
01130 SetImpl( const SetImpl& oI ) : FCOImpl() { }
01131 SetImpl& operator = ( const SetImpl& oI ) { return *this; }
01132
01133
01134 friend class FCOImpl;
01135 };
01136
01137
01138
01139
01140
01141
01142
01143 class ReferenceImpl
01144 : virtual public FCOImpl
01145 {
01146
01147 private :
01148 typedef std::pair<MON::FCO,FCOImpl*> OneFCOLink;
01149 typedef std::map<FCOImpl*,ReferencePortImpl*> ManyPortLink;
01150
01151
01152 private :
01153 OneFCOLink m_referredFCO;
01154 bool m_bAllReferredFCOs;
01155 ManyPortLink m_childPorts;
01156 bool m_bAllChildPorts;
01157 ReferencePortContainerImpl* m_pContainer;
01158
01159
01160 protected :
01161 ReferenceImpl();
01162 static ReferenceImpl* attachI( IMgaReference* spReference, ProjectImpl* pProject = NULL, const MON::Object& meta = MON::Object() );
01163 public :
01164 ~ReferenceImpl();
01165 bool setDeleted();
01166 static Reference attach( IMgaReference* spReference );
01167 static Reference create( const Folder& parent, const MON::Reference& meta = MON::Reference() );
01168 static Reference create( const Folder& parent, const std::string& strReference );
01169 static Reference create( const Folder& parent, const Reference& baseType, bool bAsInstance = true );
01170 static Reference create( const Model& parent, const MON::Reference& meta = MON::Reference(), const std::string& strRole = "" );
01171 static Reference create( const Model& parent, const std::string& strReference, const std::string& strRole = "" );
01172 static Reference create( const Model& parent, const Reference& baseType, bool bAsInstance = true, const std::string& strRole = "" );
01173 static Reference createAs( const Model& parent, const std::string& strRole );
01174
01175
01176 public :
01177 ObjectType getStereotype() const;
01178 ReferencePtr getReferenceI() const;
01179 MON::Reference getReferenceMeta() const;
01180
01181 std::string getInfoString( Util::InfoOptions usOptions = Util::IO_None ) const;
01182
01183
01184 public :
01185 FCO getReferred( const MON::FCO& meta = MON::FCO() );
01186 FCO getReferred( const std::string& strFCO );
01187 void setReferred( const FCO& fco );
01188
01189 ReferencePortContainer getRefPortContainer();
01190
01191
01192 public :
01193 virtual void accept( Visitor* pVisitor );
01194 FCOExRegistryNode getRegistry() const;
01195
01196
01197 private :
01198 FCOImpl* getReferredFCOI( const MON::FCO& meta = MON::FCO() );
01199 void setReferredFCOI( const BON::FCO& fco );
01200
01201 ReferencePortSet getRefPorts();
01202 ReferencePortImpl* getRefPort( FCOImpl* pFCO );
01203
01204
01205 private :
01206 bool createRefPort( FCOImpl* pFCO );
01207
01208
01209 private :
01210 bool onRetrievedAsReference( FCOImpl* pFCO, bool bCheckAll );
01211 void onReleasedAsReference( FCOImpl* pFCO, bool bOnlyMemoryFree );
01212 void onReleasedAsPortContainer( FCOImpl* pFCO, bool bOnlyMemoryFree );
01213
01214 public :
01215 virtual void eventPerformedI( const Event& event );
01216 private :
01217 void onRelationChanged();
01218
01219
01220 private :
01221 ReferenceImpl( const ReferenceImpl& oI ) : FCOImpl() { }
01222 ReferenceImpl& operator = ( const ReferenceImpl& oI ) { return *this; }
01223
01224
01225 friend class FCOImpl;
01226 friend class ConnectionEndImpl;
01227 friend class ReferencePortContainerImpl;
01228 friend class ReferencePortImpl;
01229 };
01230
01231
01232
01233
01234
01235
01236
01237 class ConnectionImpl
01238 : virtual public FCOImpl
01239 {
01240
01241 private :
01242 typedef std::map<MON::Connection::Pair,ConnectionEndImpl*> ManyFCOLink;
01243
01244
01245 private :
01246 ManyFCOLink m_ends;
01247 bool m_bAllEnds;
01248 typedef std::set< Reference> REFWRAPPERS;
01249 typedef std::set< FCO> FCOWRAPPERS;
01250 REFWRAPPERS m_refWrappers;
01251 FCOWRAPPERS m_fcoWrappers;
01252
01253
01254 protected :
01255 ConnectionImpl();
01256 static ConnectionImpl* attachI( IMgaConnection* spConnection, ProjectImpl* pProject = NULL, const MON::Object& meta = MON::Object() );
01257 public :
01258 ~ConnectionImpl();
01259 bool setDeleted();
01260 static Connection attach( IMgaConnection* spConnection);
01261 static Connection create( const Model& parent, const std::set<Connection::Pair>& ends, const MON::Connection& meta = MON::Connection(), const std::string& strRole = "" );
01262 static Connection create( const Model& parent, const std::set<Connection::Pair>& ends, const std::string& strConnection, const std::string& strRole = "" );
01263 static Connection create( const Model& parent, const ConnectionEnd& srcEnd, const ConnectionEnd& dstEnd, const MON::Connection& meta = MON::Connection(), const std::string& strRole = "" );
01264 static Connection create( const Model& parent, const ConnectionEnd& srcEnd, const ConnectionEnd& dstEnd, const std::string& strConnection, const std::string& strRole = "" );
01265 static Connection createAs( const Model& parent, const std::set<Connection::Pair>& ends, const std::string& strRole );
01266 static Connection createAs( const Model& parent, const ConnectionEnd& srcEnd, const ConnectionEnd& dstEnd, const std::string& strRole );
01267
01268 public :
01269 ObjectType getStereotype() const;
01270 ConnectionPtr getConnectionI() const;
01271 MON::Connection getConnectionMeta() const;
01272
01273 std::string getInfoString( Util::InfoOptions usOptions = Util::IO_None ) const;
01274
01275
01276 public :
01277 std::multiset<ConnectionEnd> getConnEnds( const MON::FCO& meta = MON::FCO() );
01278 std::multiset<ConnectionEnd> getConnEnds( const std::string& strFCO );
01279 ConnectionEnd getConnEnd( const std::string& strRole, const MON::FCO& meta = MON::FCO() );
01280 ConnectionEnd getConnEnd( const std::string& strRole, const std::string& strFCO );
01281 ConnectionEnd getSrc( const MON::FCO& meta = MON::FCO() );
01282 ConnectionEnd getSrc( const std::string& strFCO );
01283 ConnectionEnd getDst( const MON::FCO& meta = MON::FCO() );
01284 ConnectionEnd getDst( const std::string& strFCO );
01285
01286
01287 public :
01288 virtual void accept( Visitor* pVisitor );
01289 ConnectionRegistryNode getRegistry() const;
01290
01291
01292 private :
01293 ConnectionEndImpl* getConnectionEndI( const std::string& strRole = "", const MON::FCO& meta = MON::FCO() );
01294 static ConnectionImpl* createI( const Model& parent, const MON::Containment& meta, const std::set<Connection::Pair>& ends );
01295
01296
01297 private :
01298 bool onRetrievedAsConnection( ConnectionEndImpl* pCE, const std::string& strRole, bool bCheckAll );
01299 void onReleasedAsConnection( ConnectionEndImpl* pCE, const std::string& strRole, bool bOnlyFreeMemory );
01300
01301 public :
01302 virtual void eventPerformedI( const Event& event );
01303 private :
01304 void onObjectCreated();
01305
01306
01307 private :
01308 ConnectionImpl( const ConnectionImpl& oI ) : FCOImpl() { }
01309 ConnectionImpl& operator = ( const ConnectionImpl& oI ) { return *this; }
01310
01311
01312 friend class ConnectionEndImpl;
01313 friend class FCOImpl;
01314 };
01315
01316
01317
01318
01319
01320
01321
01322 class ReferencePortContainerImpl
01323 : public Util::GenRefCounted
01324 {
01325
01326 private :
01327 ReferenceImpl* m_pReference;
01328
01329
01330 private :
01331 ReferencePortContainerImpl( ReferenceImpl* pReference );
01332
01333
01334 public :
01335 Project getProject() const;
01336 Reference getReference() const;
01337
01338 std::set<ReferencePort> getReferencePorts();
01339 ReferencePort getReferencePort( const FCO& fco );
01340
01341
01342 friend class ReferenceImpl;
01343 };
01344
01345
01346
01347
01348
01349
01350
01351 class TypeInhObjectImpl
01352 : public Util::GenRefCounted
01353 {
01354
01355 private :
01356 FCOImpl* m_pFCO;
01357
01358
01359 private :
01360 TypeInhObjectImpl( FCOImpl* pFCO );
01361 public :
01362 bool setDeleted();
01363
01364
01365 public :
01366 Project getProject() const;
01367 FCO getFCO() const;
01368
01369 bool isInstance() const;
01370
01371
01372 public :
01373 Type getType();
01374
01375
01376 friend class TypeImpl;
01377 friend class InstanceImpl;
01378 };
01379
01380
01381
01382
01383
01384
01385
01386 class InstanceImpl
01387 : public TypeInhObjectImpl
01388 {
01389
01390 private :
01391 InstanceImpl( FCOImpl* pFCO );
01392
01393
01394 friend class FCOImpl;
01395 };
01396
01397
01398
01399
01400
01401
01402
01403 class TypeImpl
01404 : public TypeInhObjectImpl
01405 {
01406
01407 private :
01408 TypeImpl( FCOImpl* pFCO );
01409
01410
01411 public :
01412 std::set<Type> getSubTypes();
01413 std::set<Instance> getInstance();
01414 std::set<TypeInhObject> getDerivedObjects();
01415
01416
01417 friend class FCOImpl;
01418 };
01419
01420
01421
01422
01423
01424
01425
01426 class FCORegistryNodeImpl
01427 : public RegistryNodeImpl
01428 {
01429
01430 private :
01431 FCORegistryNodeImpl( FCOImpl* pObject );
01432
01433
01434 public :
01435 COLORREF getColor() const;
01436 void setColor( COLORREF color );
01437
01438 COLORREF getNameColor() const;
01439 void setNameColor( COLORREF color );
01440
01441 bool getNameEnabled() const;
01442 void setNameEnabled( bool bEnabled );
01443
01444 std::string getHelpURL() const;
01445 void setHelpURL( const std::string& strURL );
01446
01447 std::set<AutoRouterPref> getInAutoRouterPref() const;
01448 void setInAutoRouterPref( const std::set<AutoRouterPref>& setPrefs );
01449
01450 std::set<AutoRouterPref> getOutAutoRouterPref() const;
01451 void setOutAutoRouterPref( const std::set<AutoRouterPref>& setPrefs );
01452
01453
01454 friend class RegistryNodeImpl;
01455 friend class FCOExRegistryNodeImpl;
01456 friend class ConnectionRegistryNodeImpl;
01457 };
01458
01459
01460
01461
01462
01463
01464
01465 class FCOExRegistryNodeImpl
01466 : public FCORegistryNodeImpl
01467 {
01468
01469 private :
01470 FCOExRegistryNodeImpl( FCOImpl* pObject );
01471
01472
01473 public :
01474 Point getLocation( const MON::Aspect& aspect = MON::Aspect() ) const;
01475 void setLocation( const Point& point, const MON::Aspect& aspect = MON::Aspect() );
01476 Point getLocation( const std::string& strAspect ) const;
01477 void setLocation( const Point& point, const std::string& strAspect );
01478
01479 NamePosition getNamePosition() const;
01480 void setNamePosition( NamePosition pos );
01481
01482 unsigned short getNameWrap() const;
01483 void setNameWrap( unsigned short usWrap );
01484
01485 bool getHotspotEnabled() const;
01486 void setHotspotEnabled( bool bEnabled );
01487
01488 bool getTypeNameEnabled() const;
01489 void setTypeNameEnabled( bool bEnabled );
01490
01491 bool getTypeInfoEnabled() const;
01492 void setTypeInfoEnabled( bool bEnabled );
01493
01494 bool getModelAutoRoutingEnabled() const;
01495 void setModelAutoRoutingEnabled( bool bEnabled );
01496
01497 std::string getDecorator() const;
01498 void setDecorator( const std::string& strName );
01499
01500 std::string getIcon() const;
01501 void setIcon( const std::string& strName ) const;
01502
01503 std::string getPortIcon() const;
01504 void setPortIcon( const std::string& strName ) const;
01505
01506 std::string getSubTypeIcon() const;
01507 void setSubTypeIcon( const std::string& strName ) const;
01508
01509 std::string getInstanceIcon() const;
01510 void setInstanceIcon( const std::string& strName ) const;
01511
01512
01513 friend class RegistryNodeImpl;
01514 friend class ModelRegistryNodeImpl;
01515 };
01516
01517
01518
01519
01520
01521
01522
01523 class ModelRegistryNodeImpl
01524 : public FCOExRegistryNodeImpl
01525 {
01526
01527 private :
01528 ModelRegistryNodeImpl( ModelImpl* pObject );
01529
01530
01531 public :
01532 COLORREF getBorderColor() const;
01533 void setBorderColor( COLORREF color );
01534
01535 COLORREF getBackgroundColor() const;
01536 void setBackgroundColor( COLORREF color );
01537
01538 COLORREF getPortNameColor() const;
01539 void setPortNameColor( COLORREF color );
01540
01541
01542 friend class RegistryNodeImpl;
01543 };
01544
01545
01546
01547
01548
01549
01550
01551 class ConnectionRegistryNodeImpl
01552 : public FCORegistryNodeImpl
01553 {
01554
01555 private :
01556 ConnectionRegistryNodeImpl( ConnectionImpl* pObject );
01557
01558
01559 public :
01560 LineType getLineType() const;
01561 void setLineType( LineType eType );
01562
01563 LineEndType getSrcLineEndType() const;
01564 void setSrcLineEndType( LineEndType eType );
01565
01566 LineEndType getDstLineEndType() const;
01567 void setDstLineEndType( LineEndType eType );
01568
01569 std::string getLabel() const;
01570 void setLabel( const std::string& strFormat );
01571
01572 std::string getSrcLabel1() const;
01573 void setSrcLabel1( const std::string& strFormat );
01574
01575 std::string getSrcLabel2() const;
01576 void setSrcLabel2( const std::string& strFormat );
01577
01578 std::string getDstLabel1() const;
01579 void setDstLabel1( const std::string& strFormat );
01580
01581 std::string getDstLabel2() const;
01582 void setDstLabel2( const std::string& strFormat );
01583
01584 bool getConnectionAutoRoutingEnabled() const;
01585 void setConnectionAutoRoutingEnabled( bool bEnabled );
01586
01587
01588 friend class RegistryNodeImpl;
01589 };
01590
01591 }
01592
01593 #endif // BONImpl_h