00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #include "stdafx.h"
00023 #include "BON.h"
00024 #include "BONImpl.h"
00025 
00026 
00027 #pragma warning(disable:4073) 
00028 #pragma init_seg(lib) 
00029 #pragma warning(default:4073) 
00030 
00031 namespace BON
00032 {
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040         Project::Project( ProjectImpl* pProject )
00041                 : Util::GenRefCounter( pProject )
00042         {
00043         }
00044 
00045         Project::Project( const Project& project )
00046                 : Util::GenRefCounter( project )
00047         {
00048         }
00049 
00050         Project& Project::operator = ( const Project& project )
00051         {
00052                 using namespace Util;
00053                 GenRefCounter::operator=( project );
00054                 return *this;
00055         }
00056 
00057         Project Project::attach( IMgaProject* spProject )
00058         {
00059                 return Project( ProjectImpl::attach( spProject ) );
00060         }
00061 
00062         ProjectImpl* Project::operator -> () const
00063         {
00064                 return (ProjectImpl*) getCounted();
00065         }
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073         Object::Object( ObjectImpl* pObject )
00074         {
00075                 setCounted( pObject );
00076         }
00077 
00078         Object::Object( const Object& object )
00079         {
00080                 setCounted( object.getCounted( false ) );
00081         }
00082 
00083         Object& Object::operator = ( const Object& object )
00084         {
00085                 using namespace Util;
00086                 GenRefCounter::operator=( object );
00087                 return *this;
00088         }
00089 
00090         bool Object::castObjectImpl( ObjectType eType, ObjectType eType2 )
00091         {
00092                 if ( getCounted( false ) ) {
00093                         ObjectType oType = dynamic_cast<ObjectImpl*>( getCounted() )->getStereotype();
00094                         if ( eType2 == OT_Null && oType != eType || eType2 != OT_Null && ( oType < eType || oType > eType2 ) ) {
00095                                 setCounted( NULL );
00096                                 return false;
00097                         }
00098                 }
00099                 return true;
00100         }
00101 
00102         Object Object::attach( IMgaObject* spObject )
00103         {
00104                 return Object( ObjectImpl::attach( spObject ) );
00105         }
00106 
00107         ObjectImpl* Object::operator -> () const
00108         {
00109                 return dynamic_cast<ObjectImpl*>( getCounted() );
00110         }
00111 
00112 
00113 
00114 
00115 
00116 
00117 
00118         RegistryNode::RegistryNode( const RegistryNode& node )
00119                 : Util::GenRefCounter( node )
00120         {
00121         }
00122 
00123         RegistryNode::RegistryNode( RegistryNodeImpl* pNode )
00124                 : Util::GenRefCounter( pNode )
00125         {
00126         }
00127 
00128         RegistryNode& RegistryNode::operator = ( const RegistryNode& object )
00129         {
00130                 using namespace Util;
00131                 GenRefCounter::operator=( object );
00132                 return *this;
00133         }
00134 
00135         RegistryNodeImpl* RegistryNode::operator -> () const
00136         {
00137                 return (RegistryNodeImpl*) getCounted();
00138         }
00139 
00140 
00141 
00142 
00143 
00144 
00145 
00146         const ObjectType Folder::type = OT_Folder;
00147         const std::string Folder::string_type = "BON::Folder";
00148         std::vector<std::string> Folder::vecDerivedKinds;
00149         const int Folder::inheritance_level = 1;
00150 
00151         void Folder::addDerivedKinds( const std::vector<std::string>& vecKinds )
00152         {
00153                 for ( std::vector<std::string>::const_iterator it = vecKinds.begin() ; it != vecKinds.end() ; it++ )
00154                         vecDerivedKinds.push_back( *it );
00155         }
00156 
00157         Folder::Folder( FolderImpl* pObject )
00158                 : Object( pObject )
00159         {
00160         }
00161 
00162         Folder::Folder( const Object& object )
00163                 : Object( object )
00164         {
00165                 castObjectImpl( OT_Folder );
00166         }
00167 
00168         Folder& Folder::operator = ( const Object& object )
00169         {
00170                 Object::operator=( object );
00171                 castObjectImpl( OT_Folder );
00172                 return *this;
00173         }
00174 
00175         Folder Folder::attach( IMgaObject* spObject )
00176         {
00177                 CComQIPtr<IMgaFolder> spFolder = spObject;
00178                 return Folder( ( spFolder ) ? FolderImpl::attach( spFolder ) : NULL );
00179         }
00180 
00181         Folder Folder::create( const Folder& parent, const MON::Folder& meta )
00182         {
00183                 return FolderImpl::create( parent, meta );
00184         }
00185 
00186         Folder Folder::create( const Folder& parent, const std::string& strFolder )
00187         {
00188                 return FolderImpl::create( parent, strFolder );
00189         }
00190 
00191         FolderImpl* Folder::operator -> () const
00192         {
00193                 return dynamic_cast<FolderImpl*>( getCounted() );
00194         }
00195 
00196 
00197 
00198 
00199 
00200 
00201         ConnectionEnd::ConnectionEnd( ConnectionEndImpl* pObject )
00202         {
00203                 setCounted( pObject );
00204         }
00205 
00206         ConnectionEnd::ConnectionEnd( const ConnectionEnd& object )
00207         {
00208                 setCounted( object.getCounted( false ) );
00209         }
00210 
00211         ConnectionEnd& ConnectionEnd::operator = ( const ConnectionEnd& object )
00212         {
00213                 using namespace Util;
00214                 GenRefCounter::operator=( object );
00215                 return *this;
00216         }
00217 
00218         ConnectionEndImpl* ConnectionEnd::operator -> () const
00219         {
00220                 return dynamic_cast<ConnectionEndImpl*>( getCounted() );
00221         }
00222 
00223 
00224 
00225 
00226 
00227 
00228 
00229         ReferencePort::ReferencePort( ReferencePortImpl* pObject )
00230                 : ConnectionEnd( pObject )
00231         {
00232         }
00233 
00234         ReferencePort::ReferencePort( const ConnectionEnd& object )
00235                 : ConnectionEnd( object )
00236         {
00237                 if ( getCounted( false ) && ! dynamic_cast<ConnectionEndImpl*>( getCounted() )->isReferencePort() )
00238                         setCounted( NULL );
00239         }
00240 
00241         ReferencePort& ReferencePort::operator = ( const ConnectionEnd& object )
00242         {
00243                 ConnectionEnd::operator=( object );
00244                 if ( this != &object && getCounted( false ) && ! dynamic_cast<ConnectionEndImpl*>( getCounted() )->isReferencePort()  )
00245                         setCounted( NULL );
00246                 return *this;
00247         }
00248 
00249         ReferencePortImpl* ReferencePort::operator -> () const
00250         {
00251                 return dynamic_cast<ReferencePortImpl*>( getCounted() );
00252         }
00253 
00254 
00255 
00256 
00257 
00258 
00259 
00260         const ObjectType FCO::type = OT_Null;
00261         const std::string FCO::string_type = "BON::FCO";
00262         std::vector<std::string> FCO::vecDerivedKinds;
00263         const int FCO::inheritance_level = 0;
00264 
00265         void FCO::addDerivedKinds( const std::vector<std::string>& vecKinds )
00266         {
00267                 for ( std::vector<std::string>::const_iterator it = vecKinds.begin() ; it != vecKinds.end() ; it++ )
00268                         vecDerivedKinds.push_back( *it );
00269         }
00270 
00271         FCO::FCO( FCOImpl* pObject )
00272                 : Object(), ConnectionEnd()
00273         {
00274                 setCounted( pObject );
00275         }
00276 
00277         FCO::FCO( const Object& object )
00278                 : Object(), ConnectionEnd()
00279         {
00280                 setCounted( object.getCounted( false ) );
00281                 castObjectImpl( OT_Model, OT_Set );
00282         }
00283 
00284         FCO::FCO( const ConnectionEnd& object )
00285                 : Object(), ConnectionEnd()
00286         {
00287                 if ( object && ! object->isReferencePort() )
00288                         setCounted( object.getCounted( false ) );
00289         }
00290 
00291         FCO::FCO( const FCO& object )
00292                 : Object(), ConnectionEnd()
00293         {
00294                 setCounted( object.getCounted( false ) );
00295         }
00296 
00297         FCO& FCO::operator = ( const Object& object )
00298         {
00299                 if ( this != &object ) {
00300                         setCounted( object.getCounted( false ) );
00301                         castObjectImpl( OT_Model, OT_Set );
00302                 }
00303                 return *this;
00304         }
00305 
00306         FCO& FCO::operator = ( const ConnectionEnd& object )
00307         {
00308                 if ( this != &object ) {
00309                         if ( object && ! object->isReferencePort() )
00310                                 setCounted( object.getCounted( false ) );
00311                 }
00312                 return *this;
00313         }
00314 
00315         FCO& FCO::operator = ( const FCO& object )
00316         {
00317                 if ( this != &object )
00318                         setCounted( object.getCounted( false ) );
00319                 return *this;
00320         }
00321 
00322         FCO FCO::attach( IMgaObject* spObject )
00323         {
00324                 CComQIPtr<IMgaFCO> spFCO = spObject;
00325                 return FCO( ( spFCO ) ? FCOImpl::attach( spFCO ) : NULL );
00326         }
00327 
00328         FCO::operator bool () const
00329         {
00330                 return Object::getCounted( false ) != NULL;
00331         }
00332 
00333         bool FCO::operator ! () const
00334         {
00335                 return Object::getCounted( false ) == NULL;
00336         }
00337 
00338         FCOImpl* FCO::operator -> () const
00339         {
00340                 return dynamic_cast<FCOImpl*>( getCounted() );
00341         }
00342 
00343 
00344 
00345 
00346 
00347 
00348 
00349         Attribute::Attribute( AttributeImpl* pObject )
00350                 : Util::GenRefCounter( pObject )
00351         {
00352         }
00353 
00354         Attribute::Attribute( const Attribute& object )
00355                 : Util::GenRefCounter( object )
00356         {
00357         }
00358 
00359         Attribute& Attribute::operator = ( const Attribute& object )
00360         {
00361                 using namespace Util;
00362                 GenRefCounter::operator=( object );
00363                 return *this;
00364         }
00365 
00366         AttributeImpl* Attribute::operator -> () const
00367         {
00368                 return (AttributeImpl*) getCounted();
00369         }
00370 
00371 
00372 
00373 
00374 
00375 
00376 
00377         const ObjectType Atom::type = OT_Atom;
00378         const std::string Atom::string_type = "BON::Atom";
00379         std::vector<std::string> Atom::vecDerivedKinds;
00380         const int Atom::inheritance_level = 1;
00381 
00382         void Atom::addDerivedKinds( const std::vector<std::string>& vecKinds )
00383         {
00384                 for ( std::vector<std::string>::const_iterator it = vecKinds.begin() ; it != vecKinds.end() ; it++ )
00385                         vecDerivedKinds.push_back( *it );
00386         }
00387 
00388         Atom::Atom( AtomImpl* pObject )
00389                 : FCO( pObject )
00390         {
00391         }
00392 
00393         Atom::Atom( const Object& object )
00394                 : FCO()
00395         {
00396                 setCounted( object.getCounted( false ) );
00397                 castObjectImpl( OT_Atom );
00398         }
00399 
00400         Atom::Atom( const FCO& object )
00401                 : FCO()
00402         {
00403                 setCounted( object.getCounted( false ) );
00404                 castObjectImpl( OT_Atom );
00405         }
00406 
00407         Atom& Atom::operator = ( const Object& object )
00408         {
00409                 if ( this != &object ) {
00410                         setCounted( object.getCounted( false ) );
00411                         castObjectImpl( OT_Atom );
00412                 }
00413                 return *this;
00414         }
00415 
00416         Atom& Atom::operator = ( const FCO& object )
00417         {
00418                 if ( this != &object ) {
00419                         setCounted( object.getCounted( false ) );
00420                         castObjectImpl( OT_Atom );
00421                 }
00422                 return *this;
00423         }
00424 
00425         Atom::Atom( const ConnectionEnd& object )
00426                 : FCO()
00427         {
00428                 if ( object && ! object->isReferencePort() )
00429                         setCounted( object.getCounted( false ) );
00430                 castObjectImpl( OT_Atom );
00431         }
00432 
00433         Atom& Atom::operator = ( const ConnectionEnd& object )
00434         {
00435                 if ( this != &object ) {
00436                         if ( object && ! object->isReferencePort() )
00437                                 setCounted( object.getCounted( false ) );
00438                         castObjectImpl( OT_Atom );
00439                 }
00440                 return *this;
00441         }
00442 
00443         Atom Atom::attach( IMgaObject* spObject )
00444         {
00445                 CComQIPtr<IMgaAtom> spAtom = spObject;
00446                 return Atom( ( spAtom ) ? AtomImpl::attach( spAtom ) : NULL );
00447         }
00448 
00449         Atom Atom::create( const Folder& parent, const MON::Atom& meta )
00450         {
00451                 return AtomImpl::create( parent, meta );
00452         }
00453 
00454         Atom Atom::create( const Folder& parent, const std::string& strAtom )
00455         {
00456                 return AtomImpl::create( parent, strAtom );
00457         }
00458 
00459         Atom Atom::create( const Folder& parent, const Atom& baseType, bool bAsInstance )
00460         {
00461                 return AtomImpl::create( parent, baseType, bAsInstance );
00462         }
00463 
00464         Atom Atom::create( const Model& parent, const MON::Atom& meta, const std::string& strRole )
00465         {
00466                 return AtomImpl::create( parent, meta, strRole );
00467         }
00468 
00469         Atom Atom::create( const Model& parent, const std::string& strAtom, const std::string& strRole )
00470         {
00471                 return AtomImpl::create( parent, strAtom, strRole );
00472         }
00473 
00474         Atom Atom::create( const Model& parent, const Atom& baseType, bool bAsInstance, const std::string& strRole )
00475         {
00476                 return AtomImpl::create( parent, baseType, bAsInstance, strRole );
00477         }
00478 
00479         Atom Atom::createAs( const Model& parent, const std::string& strRole )
00480         {
00481                 return AtomImpl::createAs( parent, strRole );
00482         }
00483 
00484         AtomImpl* Atom::operator -> () const
00485         {
00486                 return dynamic_cast<AtomImpl*>( getCounted() );
00487         }
00488 
00489 
00490 
00491 
00492 
00493 
00494 
00495         const ObjectType Model::type = OT_Model;
00496         const std::string Model::string_type = "BON::Model";
00497         std::vector<std::string> Model::vecDerivedKinds;
00498         const int Model::inheritance_level = 1;
00499 
00500         void Model::addDerivedKinds( const std::vector<std::string>& vecKinds )
00501         {
00502                 for ( std::vector<std::string>::const_iterator it = vecKinds.begin() ; it != vecKinds.end() ; it++ )
00503                         vecDerivedKinds.push_back( *it );
00504         }
00505 
00506         Model::Model( ModelImpl* pObject )
00507                 : FCO( pObject )
00508         {
00509         }
00510 
00511         Model::Model( const Object& object )
00512                 : FCO()
00513         {
00514                 setCounted( object.getCounted( false ) );
00515                 castObjectImpl( OT_Model );
00516         }
00517 
00518         Model& Model::operator = ( const Object& object )
00519         {
00520                 if ( this != &object ) {
00521                         setCounted( object.getCounted( false ) );
00522                         castObjectImpl( OT_Model );
00523                 }
00524                 return *this;
00525         }
00526 
00527         Model::Model( const ConnectionEnd& object )
00528                 : FCO()
00529         {
00530                 if ( object && ! object->isReferencePort() )
00531                         setCounted( object.getCounted( false ) );
00532                 castObjectImpl( OT_Model );
00533         }
00534 
00535         Model& Model::operator = ( const ConnectionEnd& object )
00536         {
00537                 if ( this != &object ) {
00538                         if ( object && ! object->isReferencePort() )
00539                                 setCounted( object.getCounted( false ) );
00540                         castObjectImpl( OT_Model );
00541                 }
00542                 return *this;
00543         }
00544 
00545         Model::Model( const FCO& object )
00546                 : FCO()
00547         {
00548                 setCounted( object.getCounted( false ) );
00549                 castObjectImpl( OT_Model );
00550         }
00551 
00552         Model& Model::operator = ( const FCO& object )
00553         {
00554                 if ( this != &object ) {
00555                         setCounted( object.getCounted( false ) );
00556                         castObjectImpl( OT_Model );
00557                 }
00558                 return *this;
00559         }
00560 
00561         Model Model::attach( IMgaObject* spObject )
00562         {
00563                 CComQIPtr<IMgaModel> spModel = spObject;
00564                 return Model( ( spModel ) ? ModelImpl::attach( spModel ) : NULL );
00565         }
00566 
00567         Model Model::create( const Folder& parent, const MON::Model& meta )
00568         {
00569                 return ModelImpl::create( parent, meta );
00570         }
00571 
00572         Model Model::create( const Folder& parent, const std::string& strModel )
00573         {
00574                 return ModelImpl::create( parent, strModel );
00575         }
00576 
00577         Model Model::create( const Folder& parent, const Model& baseType, bool bAsInstance )
00578         {
00579                 return ModelImpl::create( parent, baseType, bAsInstance );
00580         }
00581 
00582         Model Model::create( const Model& parent, const MON::Model& meta, const std::string& strRole )
00583         {
00584                 return ModelImpl::create( parent, meta, strRole );
00585         }
00586 
00587         Model Model::create( const Model& parent, const std::string& strModel, const std::string& strRole )
00588         {
00589                 return ModelImpl::create( parent, strModel, strRole );
00590         }
00591 
00592         Model Model::create( const Model& parent, const Model& baseType, bool bAsInstance, const std::string& strRole )
00593         {
00594                 return ModelImpl::create( parent, baseType, bAsInstance, strRole );
00595         }
00596 
00597         Model Model::createAs( const Model& parent, const std::string& strRole )
00598         {
00599                 return ModelImpl::createAs( parent, strRole );
00600         }
00601 
00602         ModelImpl* Model::operator -> () const
00603         {
00604                 return dynamic_cast<ModelImpl*>( getCounted() );
00605         }
00606 
00607 
00608 
00609 
00610 
00611 
00612 
00613         const ObjectType Set::type = OT_Set;
00614         const std::string Set::string_type = "BON::Set";
00615         std::vector<std::string> Set::vecDerivedKinds;
00616         const int Set::inheritance_level = 1;
00617 
00618         void Set::addDerivedKinds( const std::vector<std::string>& vecKinds )
00619         {
00620                 for ( std::vector<std::string>::const_iterator it = vecKinds.begin() ; it != vecKinds.end() ; it++ )
00621                         vecDerivedKinds.push_back( *it );
00622         }
00623 
00624         Set::Set( SetImpl* pObject )
00625                 : FCO( pObject )
00626         {
00627         }
00628 
00629         Set::Set( const Object& object )
00630                 : FCO()
00631         {
00632                 setCounted( object.getCounted( false ) );
00633                 castObjectImpl( OT_Set );
00634         }
00635 
00636         Set::Set( const FCO& object )
00637                 : FCO()
00638         {
00639                 setCounted( object.getCounted( false ) );
00640                 castObjectImpl( OT_Set );
00641         }
00642 
00643         Set& Set::operator = ( const Object& object )
00644         {
00645                 if ( this != &object ) {
00646                         setCounted( object.getCounted( false ) );
00647                         castObjectImpl( OT_Set );
00648                 }
00649                 return *this;
00650         }
00651 
00652         Set& Set::operator = ( const FCO& object )
00653         {
00654                 if ( this != &object ) {
00655                         setCounted( object.getCounted( false ) );
00656                         castObjectImpl( OT_Set );
00657                 }
00658                 return *this;
00659         }
00660 
00661         Set::Set( const ConnectionEnd& object )
00662                 : FCO()
00663         {
00664                 if ( object && ! object->isReferencePort() )
00665                         setCounted( object.getCounted( false ) );
00666                 castObjectImpl( OT_Set );
00667         }
00668 
00669         Set& Set::operator = ( const ConnectionEnd& object )
00670         {
00671                 if ( this != &object ) {
00672                         if ( object && ! object->isReferencePort() )
00673                                 setCounted( object.getCounted( false ) );
00674                         castObjectImpl( OT_Set );
00675                 }
00676                 return *this;
00677         }
00678 
00679         Set Set::attach( IMgaObject* spObject )
00680         {
00681                 CComQIPtr<IMgaSet> spSet = spObject;
00682                 return Set( ( spSet ) ? SetImpl::attach( spSet ) : NULL );
00683         }
00684 
00685         Set Set::create( const Folder& parent, const MON::Set& meta )
00686         {
00687                 return SetImpl::create( parent, meta );
00688         }
00689 
00690         Set Set::create( const Folder& parent, const std::string& strSet )
00691         {
00692                 return SetImpl::create( parent, strSet );
00693         }
00694 
00695         Set Set::create( const Folder& parent, const Set& baseType, bool bAsInstance )
00696         {
00697                 return SetImpl::create( parent, baseType, bAsInstance );
00698         }
00699 
00700         Set Set::create( const Model& parent, const MON::Set& meta, const std::string& strRole )
00701         {
00702                 return SetImpl::create( parent, meta, strRole );
00703         }
00704 
00705         Set Set::create( const Model& parent, const std::string& strSet, const std::string& strRole )
00706         {
00707                 return SetImpl::create( parent, strSet, strRole );
00708         }
00709 
00710         Set Set::create( const Model& parent, const Set& baseType, bool bAsInstance, const std::string& strRole )
00711         {
00712                 return SetImpl::create( parent, baseType, bAsInstance, strRole );
00713         }
00714 
00715         Set Set::createAs( const Model& parent, const std::string& strRole )
00716         {
00717                 return SetImpl::createAs( parent, strRole );
00718         }
00719 
00720         SetImpl* Set::operator -> () const
00721         {
00722                 return dynamic_cast<SetImpl*>( getCounted() );
00723         }
00724 
00725 
00726 
00727 
00728 
00729 
00730 
00731         const ObjectType Reference::type = OT_Reference;
00732         const std::string Reference::string_type = "BON::Reference";
00733         std::vector<std::string> Reference::vecDerivedKinds;
00734         const int Reference::inheritance_level = 1;
00735 
00736         void Reference::addDerivedKinds( const std::vector<std::string>& vecKinds )
00737         {
00738                 for ( std::vector<std::string>::const_iterator it = vecKinds.begin() ; it != vecKinds.end() ; it++ )
00739                         vecDerivedKinds.push_back( *it );
00740         }
00741 
00742         Reference::Reference( ReferenceImpl* pObject )
00743                 : FCO( pObject )
00744         {
00745         }
00746 
00747         Reference::Reference( const Object& object )
00748                 : FCO()
00749         {
00750                 setCounted( object.getCounted( false ) );
00751                 castObjectImpl( OT_Reference );
00752         }
00753 
00754         Reference::Reference( const FCO& object )
00755                 : FCO()
00756         {
00757                 setCounted( object.getCounted( false ) );
00758                 castObjectImpl( OT_Reference );
00759         }
00760 
00761         Reference& Reference::operator = ( const Object& object )
00762         {
00763                 if ( this != &object ) {
00764                         setCounted( object.getCounted( false ) );
00765                         castObjectImpl( OT_Reference );
00766                 }
00767                 return *this;
00768         }
00769 
00770         Reference& Reference::operator = ( const FCO& object )
00771         {
00772                 if ( this != &object ) {
00773                         setCounted( object.getCounted( false ) );
00774                         castObjectImpl( OT_Reference );
00775                 }
00776                 return *this;
00777         }
00778 
00779         Reference::Reference( const ConnectionEnd& object )
00780                 : FCO()
00781         {
00782                 if ( object && ! object->isReferencePort() )
00783                         setCounted( object.getCounted( false ) );
00784                 castObjectImpl( OT_Reference );
00785         }
00786 
00787         Reference& Reference::operator = ( const ConnectionEnd& object )
00788         {
00789                 if ( this != &object ) {
00790                         if ( object && ! object->isReferencePort() )
00791                                 setCounted( object.getCounted( false ) );
00792                         castObjectImpl( OT_Reference );
00793                 }
00794                 return *this;
00795         }
00796 
00797         Reference Reference::attach( IMgaObject* spObject )
00798         {
00799                 CComQIPtr<IMgaReference> spReference = spObject;
00800                 return Reference( ( spReference ) ? ReferenceImpl::attach( spReference ) : NULL );
00801         }
00802 
00803         Reference Reference::create( const Folder& parent, const MON::Reference& meta )
00804         {
00805                 return ReferenceImpl::create( parent, meta );
00806         }
00807 
00808         Reference Reference::create( const Folder& parent, const std::string& strReference )
00809         {
00810                 return ReferenceImpl::create( parent, strReference );
00811         }
00812 
00813         Reference Reference::create( const Folder& parent, const Reference& baseType, bool bAsInstance )
00814         {
00815                 return ReferenceImpl::create( parent, baseType, bAsInstance );
00816         }
00817 
00818         Reference Reference::create( const Model& parent, const MON::Reference& meta, const std::string& strRole )
00819         {
00820                 return ReferenceImpl::create( parent, meta, strRole );
00821         }
00822 
00823         Reference Reference::create( const Model& parent, const std::string& strReference, const std::string& strRole )
00824         {
00825                 return ReferenceImpl::create( parent, strReference, strRole );
00826         }
00827 
00828         Reference Reference::create( const Model& parent, const Reference& baseType, bool bAsInstance, const std::string& strRole )
00829         {
00830                 return ReferenceImpl::create( parent, baseType, bAsInstance, strRole );
00831         }
00832 
00833         Reference Reference::createAs( const Model& parent, const std::string& strRole )
00834         {
00835                 return ReferenceImpl::createAs( parent, strRole );
00836         }
00837 
00838         ReferenceImpl* Reference::operator -> () const
00839         {
00840                 return dynamic_cast<ReferenceImpl*>( getCounted() );
00841         }
00842 
00843 
00844 
00845 
00846 
00847 
00848 
00849         const ObjectType Connection::type = OT_Connection;
00850         const std::string Connection::string_type = "BON::Connection";
00851         std::vector<std::string> Connection::vecDerivedKinds;
00852         const int Connection::inheritance_level = 1;
00853 
00854         void Connection::addDerivedKinds( const std::vector<std::string>& vecKinds )
00855         {
00856                 for ( std::vector<std::string>::const_iterator it = vecKinds.begin() ; it != vecKinds.end() ; it++ )
00857                         vecDerivedKinds.push_back( *it );
00858         }
00859 
00860         Connection::Connection( ConnectionImpl* pObject )
00861                 : FCO( pObject )
00862         {
00863         }
00864 
00865         Connection::Connection( const Object& object )
00866                 : FCO()
00867         {
00868                 setCounted( object.getCounted( false ) );
00869                 castObjectImpl( OT_Connection );
00870         }
00871 
00872         Connection& Connection::operator = ( const Object& object )
00873         {
00874                 if ( this != &object ) {
00875                         setCounted( object.getCounted( false ) );
00876                         castObjectImpl( OT_Connection );
00877                 }
00878                 return *this;
00879         }
00880 
00881         Connection::Connection( const FCO& object )
00882                 : FCO()
00883         {
00884                 setCounted( object.getCounted( false ) );
00885                 castObjectImpl( OT_Connection );
00886         }
00887 
00888         Connection& Connection::operator = ( const FCO& object )
00889         {
00890                 if ( this != &object ) {
00891                         setCounted( object.getCounted( false ) );
00892                         castObjectImpl( OT_Connection );
00893                 }
00894                 return *this;
00895         }
00896 
00897         Connection::Connection( const ConnectionEnd& object )
00898                 : FCO()
00899         {
00900                 if ( object && ! object->isReferencePort() )
00901                         setCounted( object.getCounted( false ) );
00902                 castObjectImpl( OT_Connection );
00903         }
00904 
00905         Connection& Connection::operator = ( const ConnectionEnd& object )
00906         {
00907                 if ( this != &object ) {
00908                         if ( object && ! object->isReferencePort() )
00909                                 setCounted( object.getCounted( false ) );
00910                         castObjectImpl( OT_Connection );
00911                 }
00912                 return *this;
00913         }
00914 
00915         Connection Connection::attach( IMgaObject* spObject )
00916         {
00917                 CComQIPtr<IMgaConnection> spConnection = spObject;
00918                 return Connection( ( spConnection ) ? ConnectionImpl::attach( spConnection ) : NULL );
00919         }
00920 
00921         Connection Connection::create( const Model& parent, const std::set<Connection::Pair>& ends, const MON::Connection& meta, const std::string& strRole )
00922         {
00923                 return ConnectionImpl::create( parent, ends, meta, strRole );
00924         }
00925         Connection Connection::create( const Model& parent, const std::set<Connection::Pair>& ends, const std::string& strConnection, const std::string& strRole )
00926         {
00927                 return ConnectionImpl::create( parent, ends, strConnection, strRole );
00928         }
00929 
00930         Connection Connection::create( const Model& parent, const ConnectionEnd& srcEnd, const ConnectionEnd& dstEnd, const MON::Connection& meta, const std::string& strRole )
00931         {
00932                 return ConnectionImpl::create( parent, srcEnd, dstEnd, meta, strRole );
00933         }
00934 
00935         Connection Connection::create( const Model& parent, const ConnectionEnd& srcEnd, const ConnectionEnd& dstEnd, const std::string& strConnection, const std::string& strRole )
00936         {
00937                 return ConnectionImpl::create( parent, srcEnd, dstEnd, strConnection, strRole );
00938         }
00939 
00940         Connection Connection::createAs( const Model& parent, const std::set<Connection::Pair>& ends, const std::string& strRole )
00941         {
00942                 return ConnectionImpl::create( parent, ends, strRole );
00943         }
00944 
00945         Connection Connection::createAs( const Model& parent, const ConnectionEnd& srcEnd, const ConnectionEnd& dstEnd, const std::string& strRole )
00946         {
00947                 return ConnectionImpl::create( parent, srcEnd, dstEnd, strRole );
00948         }
00949 
00950         ConnectionImpl* Connection::operator -> () const
00951         {
00952                 return dynamic_cast<ConnectionImpl*>( getCounted() );
00953         }
00954 
00955 
00956 
00957 
00958 
00959 
00960 
00961         ReferencePortContainer::ReferencePortContainer( const ReferencePortContainer& object )
00962                 : Util::GenRefCounter( object )
00963         {
00964         }
00965 
00966         ReferencePortContainer::ReferencePortContainer( ReferencePortContainerImpl* pObject )
00967                 : Util::GenRefCounter( pObject )
00968         {
00969         }
00970 
00971         ReferencePortContainer& ReferencePortContainer::operator = ( const ReferencePortContainer& object )
00972         {
00973                 using namespace Util;
00974                 GenRefCounter::operator=( object );
00975                 return *this;
00976         }
00977 
00978         ReferencePortContainerImpl* ReferencePortContainer::operator -> () const
00979         {
00980                 return (ReferencePortContainerImpl*) getCounted();
00981         }
00982 
00983 
00984 
00985 
00986 
00987 
00988 
00989         TypeInhObject::TypeInhObject( const TypeInhObject& object )
00990                 : Util::GenRefCounter( object )
00991         {
00992         }
00993 
00994         TypeInhObject::TypeInhObject( TypeInhObjectImpl* pObject )
00995                 : Util::GenRefCounter( pObject )
00996         {
00997         }
00998 
00999         TypeInhObject& TypeInhObject::operator = ( const TypeInhObject& object )
01000         {
01001                 using namespace Util;
01002                 GenRefCounter::operator=( object );
01003                 return *this;
01004         }
01005 
01006         TypeInhObjectImpl* TypeInhObject::operator -> () const
01007         {
01008                 return (TypeInhObjectImpl*) getCounted();
01009         }
01010 
01011 
01012 
01013 
01014 
01015 
01016 
01017         Type::Type( const TypeInhObject& object )
01018                 : TypeInhObject( object )
01019         {
01020                 TypeInhObjectImpl* pImpl = (TypeInhObjectImpl*) getCounted( false );
01021                 if ( pImpl && pImpl->isInstance() )
01022                         setCounted( NULL );
01023         }
01024 
01025         Type::Type( TypeImpl* pObject )
01026                 : TypeInhObject( pObject )
01027         {
01028         }
01029 
01030         Type& Type::operator = ( const TypeInhObject& object )
01031         {
01032                 TypeInhObject::operator=( object );
01033                 if ( this != &object ) {
01034                         TypeInhObjectImpl* pImpl = (TypeInhObjectImpl*) getCounted( false );
01035                         if ( pImpl && pImpl->isInstance() )
01036                                 setCounted( NULL );
01037                 }
01038                 return *this;
01039         }
01040 
01041         TypeImpl* Type::operator -> () const
01042         {
01043                 return (TypeImpl*) getCounted();
01044         }
01045 
01046 
01047 
01048 
01049 
01050 
01051 
01052         Instance::Instance( const TypeInhObject& object )
01053                 : TypeInhObject( object )
01054         {
01055                 TypeInhObjectImpl* pImpl = (TypeInhObjectImpl*) getCounted( false );
01056                 if ( pImpl && ! pImpl->isInstance() )
01057                         setCounted( NULL );
01058         }
01059 
01060         Instance::Instance( InstanceImpl* pObject )
01061                 : TypeInhObject( pObject )
01062         {
01063         }
01064 
01065         Instance& Instance::operator = ( const TypeInhObject& object )
01066         {
01067                 TypeInhObject::operator=( object );
01068                 if ( this != &object ) {
01069                         TypeInhObjectImpl* pImpl = (TypeInhObjectImpl*) getCounted( false );
01070                         if ( pImpl && ! pImpl->isInstance() )
01071                                 setCounted( NULL );
01072                 }
01073                 return *this;
01074         }
01075 
01076         InstanceImpl* Instance::operator -> () const
01077         {
01078                 return (InstanceImpl*) getCounted();
01079         }
01080 
01081 
01082 
01083 
01084 
01085 
01086 
01087         FCORegistryNode::FCORegistryNode( const RegistryNode& node )
01088                 : RegistryNode( node )
01089         {
01090                 RegistryNodeImpl* pNode = (RegistryNodeImpl*) getCounted( false );
01091                 if ( pNode && ( ! pNode->isRootNode() || pNode->getObject()->getStereotype() == OT_Folder ) )
01092                         setCounted( NULL );
01093         }
01094 
01095         FCORegistryNode::FCORegistryNode( RegistryNodeImpl* pNode )
01096                 : RegistryNode( pNode )
01097         {
01098                 if ( pNode && ( ! pNode->isRootNode() || pNode->getObject()->getStereotype() == OT_Folder ) )
01099                         setCounted( NULL );
01100         }
01101 
01102         FCORegistryNode& FCORegistryNode::operator = ( const RegistryNode& object )
01103         {
01104                 RegistryNode::operator=( object );
01105                 if ( this != &object ) {
01106                         RegistryNodeImpl* pNode = (RegistryNodeImpl*) getCounted( false );
01107                         if ( pNode && ( ! pNode->isRootNode() || pNode->getObject()->getStereotype() == OT_Folder ) )
01108                                 setCounted( NULL );
01109                 }
01110                 return *this;
01111         }
01112 
01113         FCORegistryNodeImpl* FCORegistryNode::operator -> () const
01114         {
01115                 return (FCORegistryNodeImpl*) getCounted();
01116         }
01117 
01118 
01119 
01120 
01121 
01122 
01123 
01124         FCOExRegistryNode::FCOExRegistryNode( const RegistryNode& node )
01125                 : FCORegistryNode( node )
01126         {
01127                 RegistryNodeImpl* pNode = (RegistryNodeImpl*) getCounted( false );
01128                 if ( pNode && pNode->getObject()->getStereotype() == OT_Connection )
01129                         setCounted( NULL );
01130         }
01131 
01132         FCOExRegistryNode::FCOExRegistryNode( RegistryNodeImpl* pNode )
01133                 : FCORegistryNode( pNode )
01134         {
01135                 pNode = (RegistryNodeImpl*) getCounted( false );
01136                 if ( pNode && pNode->getObject()->getStereotype() == OT_Connection )
01137                         setCounted( NULL );
01138         }
01139 
01140         FCOExRegistryNode& FCOExRegistryNode::operator = ( const RegistryNode& object )
01141         {
01142                 FCORegistryNode::operator=( object );
01143                 RegistryNodeImpl* pNode = (RegistryNodeImpl*) getCounted( false );
01144                 if ( pNode && pNode->getObject()->getStereotype() == OT_Connection )
01145                         setCounted( NULL );
01146 
01147                 return *this;
01148         }
01149 
01150         FCOExRegistryNodeImpl* FCOExRegistryNode::operator -> () const
01151         {
01152                 return (FCOExRegistryNodeImpl*) getCounted();
01153         }
01154 
01155 
01156 
01157 
01158 
01159 
01160 
01161         ModelRegistryNode::ModelRegistryNode( const RegistryNode& node )
01162                 : FCOExRegistryNode( node )
01163         {
01164                 RegistryNodeImpl* pNode = (RegistryNodeImpl*) getCounted( false );
01165                 if ( pNode && pNode->getObject()->getStereotype() != OT_Model )
01166                         setCounted( NULL );
01167         }
01168 
01169         ModelRegistryNode::ModelRegistryNode( RegistryNodeImpl* pNode )
01170                 : FCOExRegistryNode( pNode )
01171         {
01172                 pNode = (RegistryNodeImpl*) getCounted( false );
01173                 if ( pNode && pNode->getObject()->getStereotype() != OT_Model )
01174                         setCounted( NULL );
01175         }
01176 
01177         ModelRegistryNode& ModelRegistryNode::operator = ( const RegistryNode& object )
01178         {
01179                 FCOExRegistryNode::operator=( object );
01180                 RegistryNodeImpl* pNode = (RegistryNodeImpl*) getCounted( false );
01181                 if ( pNode && pNode->getObject()->getStereotype() != OT_Model )
01182                         setCounted( NULL );
01183 
01184                 return *this;
01185         }
01186 
01187         ModelRegistryNodeImpl* ModelRegistryNode::operator -> () const
01188         {
01189                 return (ModelRegistryNodeImpl*) getCounted();
01190         }
01191 
01192 
01193 
01194 
01195 
01196 
01197 
01198         ConnectionRegistryNode::ConnectionRegistryNode( const RegistryNode& node )
01199                 : FCORegistryNode( node )
01200         {
01201                 RegistryNodeImpl* pNode = (RegistryNodeImpl*) getCounted( false );
01202                 if ( pNode && pNode->getObject()->getStereotype() != OT_Connection )
01203                         setCounted( NULL );
01204         }
01205 
01206         ConnectionRegistryNode::ConnectionRegistryNode( RegistryNodeImpl* pNode )
01207                 : FCORegistryNode( pNode )
01208         {
01209                 pNode = (RegistryNodeImpl*) getCounted( false );
01210                 if ( pNode && pNode->getObject()->getStereotype() != OT_Connection )
01211                         setCounted( NULL );
01212         }
01213 
01214         ConnectionRegistryNode& ConnectionRegistryNode::operator = ( const RegistryNode& object )
01215         {
01216                 FCORegistryNode::operator=( object );
01217                 RegistryNodeImpl* pNode = (RegistryNodeImpl*) getCounted( false );
01218                 if ( pNode && pNode->getObject()->getStereotype() != OT_Connection )
01219                         setCounted( NULL );
01220 
01221                 return *this;
01222         }
01223 
01224         ConnectionRegistryNodeImpl* ConnectionRegistryNode::operator -> () const
01225         {
01226                 return (ConnectionRegistryNodeImpl*) getCounted();
01227         }
01228 
01229 
01230 
01231 
01232 
01233 
01234 
01235         void Visitor::visitFolder( const Folder& folder )
01236         {
01237                 visitObjectImpl( folder );
01238                 visitFolderImpl( folder );
01239         }
01240 
01241         void Visitor::visitAtom( const Atom& atom )
01242         {
01243                 visitObjectImpl( atom );
01244                 visitConnectionEndImpl( atom );
01245                 visitFCOImpl( atom );
01246                 visitAtomImpl( atom );
01247         }
01248 
01249         void Visitor::visitModel( const Model& model )
01250         {
01251                 visitObjectImpl( model );
01252                 visitConnectionEndImpl( model );
01253                 visitFCOImpl( model );
01254                 visitModelImpl( model );
01255         }
01256 
01257         void Visitor::visitConnection( const Connection& connection )
01258         {
01259                 visitObjectImpl( connection );
01260                 visitConnectionEndImpl( connection );
01261                 visitFCOImpl( connection );
01262                 visitConnectionImpl( connection );
01263         }
01264 
01265         void Visitor::visitSet( const Set& set )
01266         {
01267                 visitObjectImpl( set );
01268                 visitConnectionEndImpl( set );
01269                 visitFCOImpl( set );
01270                 visitSetImpl( set);
01271         }
01272 
01273         void Visitor::visitReference( const Reference& reference )
01274         {
01275                 visitObjectImpl( reference );
01276                 visitConnectionEndImpl( reference );
01277                 visitFCOImpl( reference );
01278                 visitReferenceImpl( reference );
01279         }
01280 
01281         void Visitor::visitReferencePort( const ReferencePort& port )
01282         {
01283                 visitConnectionEndImpl( port );
01284                 visitReferencePortImpl( port );
01285         }
01286 
01287 };