[GME-commit]
GMESRC/SDK/BON BONImpl.cpp,1.26,1.27 BONImpl.h,1.14,1.15
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Mon Aug 8 16:49:16 CDT 2005
Update of /project/gme-repository/GMESRC/SDK/BON
In directory escher:/tmp/cvs-serv1663
Modified Files:
BONImpl.cpp BONImpl.h
Log Message:
Add-on aggregate refcounting errors hacked/fixed by storing some important pointers in member variables in FCOImpl and ConnectionImpl.
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: BONImpl.h
===================================================================
RCS file: /project/gme-repository/GMESRC/SDK/BON/BONImpl.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** BONImpl.h 26 Jul 2004 08:30:16 -0000 1.14
--- BONImpl.h 8 Aug 2005 15:49:13 -0000 1.15
***************
*** 650,653 ****
--- 650,654 ----
typedef std::map<MON::Reference,ReferenceSetPair> ManyReferenceLink;
typedef std::map<MON::Attribute,AttributeImpl*> ManyAttributeLink;
+ typedef std::set< Reference> REFWRAPPERS;
// Member variables
***************
*** 735,739 ****
FCOSet getDerivedFCOs( bool bInstance );
! ReferencePortSet getRefPortRefsI();
SetSet getSetsI( const MON::Set& meta = MON::Set() );
--- 736,741 ----
FCOSet getDerivedFCOs( bool bInstance );
! ReferencePortSet getRefPortRefsI();
! REFWRAPPERS m_storedRefWrappers;
SetSet getSetsI( const MON::Set& meta = MON::Set() );
***************
*** 1205,1208 ****
--- 1207,1214 ----
ManyFCOLink m_ends;
bool m_bAllEnds;
+ typedef std::set< Reference> REFWRAPPERS;
+ typedef std::set< FCO> FCOWRAPPERS;
+ REFWRAPPERS m_refWrappers;
+ FCOWRAPPERS m_fcoWrappers;
// Costruction and Destruction
Index: BONImpl.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/SDK/BON/BONImpl.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** BONImpl.cpp 29 Jun 2005 19:16:34 -0000 1.26
--- BONImpl.cpp 8 Aug 2005 15:49:13 -0000 1.27
***************
*** 2978,2981 ****
--- 2978,2982 ----
m_sets.clear();
m_refPorts.clear();
+ m_storedRefWrappers.clear();
}
***************
*** 3044,3048 ****
THROW_METAPROJECT_BELONG( meta );
! getParentModel();
if ( m_parentModel.first ) {
if ( meta ) {
--- 3045,3049 ----
THROW_METAPROJECT_BELONG( meta );
! Model parm = getParentModel();
if ( m_parentModel.first ) {
if ( meta ) {
***************
*** 3540,3544 ****
{
FCO( this->getType() );
! getReferencePorts();
// Temporary Solution ... Eliminate If Event Paremeters Available
--- 3541,3558 ----
{
FCO( this->getType() );
! try {
! std::set<ReferencePort> rps = getReferencePorts();
! for( std::set<ReferencePort>::const_iterator it = rps.begin(); it != rps.end(); ++it)
! {
! Reference ref = (*it)->getContainer()->getReference();
! m_storedRefWrappers.insert( ref);
! }
! rps.clear();
! // exception when releasing the set?
! } catch(...) {
! bool b = true;
! b = !b;
! ASSERT(0);
! }
// Temporary Solution ... Eliminate If Event Paremeters Available
***************
*** 5465,5472 ****
{
ManyPortLink::iterator it = m_childPorts.find( pFCO );
! if ( it == m_childPorts.end() ) {
! if ( pFCO->isPort() ) {
ReferencePortImpl* pPort = new ReferencePortImpl( this, pFCO );
! m_childPorts[ pFCO ] = pPort;
pFCO->onRetrievedAsReferencePort( pPort, false );
return true;
--- 5479,5486 ----
{
ManyPortLink::iterator it = m_childPorts.find( pFCO );
! if ( it == m_childPorts.end() ) {
! if ( pFCO->isPort() ) {
ReferencePortImpl* pPort = new ReferencePortImpl( this, pFCO );
! m_childPorts[ pFCO ] = pPort;
pFCO->onRetrievedAsReferencePort( pPort, false );
return true;
***************
*** 5480,5489 ****
{
if ( ! m_bAllChildPorts ) {
! m_bAllChildPorts = NULL;
CComQIPtr<IMgaReference> spRef = getReferenceI().p;
FCOPtr spFCO;
do {
! COMTHROW( spRef->get_Referred( spFCO.Addr() ) );
} while ( spRef = spFCO.p );
--- 5494,5505 ----
{
if ( ! m_bAllChildPorts ) {
! m_bAllChildPorts = true; //zolmol mod, WAS: m_bAllChildPorts = NULL
CComQIPtr<IMgaReference> spRef = getReferenceI().p;
FCOPtr spFCO;
do {
! FCOPtr spFCO_temp;
! COMTHROW( spRef->get_Referred( spFCO_temp.Addr() ) );
! spFCO = spFCO_temp;
} while ( spRef = spFCO.p );
***************
*** 5803,5806 ****
--- 5819,5824 ----
m_ends.clear();
+ m_refWrappers.clear();
+ m_fcoWrappers.clear();
}
***************
*** 5887,5891 ****
ConnectionEndImpl* pCE = ConnectionEndImpl::attachI( MGACOLL_ITER, ObjectImpl::m_pProject, key.second );
m_ends[ key ] = pCE;
! pCE->onRetrievedAsConnectionEnd( this, Util::Copy( bstrRole ), false );
}
} MGACOLL_ITERATE_END;
--- 5905,5910 ----
ConnectionEndImpl* pCE = ConnectionEndImpl::attachI( MGACOLL_ITER, ObjectImpl::m_pProject, key.second );
m_ends[ key ] = pCE;
! if( !pCE) ASSERT(0);
! else pCE->onRetrievedAsConnectionEnd( this, Util::Copy( bstrRole ), false );
}
} MGACOLL_ITERATE_END;
***************
*** 6009,6013 ****
void ConnectionImpl::onObjectCreated()
{
! getConnEnds();
}
--- 6028,6043 ----
void ConnectionImpl::onObjectCreated()
{
! std::multiset<ConnectionEnd> ss = getConnEnds();
! for( std::multiset<ConnectionEnd>::const_iterator it = ss.begin(); it != ss.end(); ++it)
! {
! ReferencePort rpi( *it);
! if( rpi) // if it's a referenceport
! {
! Reference the_ref = rpi->getContainer()->getReference();
! m_refWrappers.insert( the_ref );
! FCO the_target = rpi->getFCO();
! m_fcoWrappers.insert( the_target);
! }
! }
}
More information about the GME-commit
mailing list