Version: 8.3.0
YACS::ENGINE::RefCounter Class Reference

#include <RefCounter.hxx>

Inheritance diagram for YACS::ENGINE::RefCounter:
Collaboration diagram for YACS::ENGINE::RefCounter:

Public Member Functions

unsigned int getRefCnt () const
 
void incrRef () const
 
bool decrRef ()
 

Static Public Attributes

static unsigned int _totalCnt =0
 

Protected Member Functions

 RefCounter ()
 
 RefCounter (const RefCounter &other)
 
virtual ~RefCounter ()
 

Protected Attributes

unsigned int _cnt
 

Detailed Description

Definition at line 29 of file RefCounter.hxx.

Constructor & Destructor Documentation

RefCounter::RefCounter ( )
protected

Definition at line 61 of file RefCounter.cxx.

References _totalCnt.

61  :_cnt(1)
62 {
63 #ifdef REFCNT
65 #endif
66 }
RefCounter::RefCounter ( const RefCounter other)
protected

Definition at line 68 of file RefCounter.cxx.

68  :_cnt(1)
69 {
70 }
RefCounter::~RefCounter ( )
protectedvirtual

Definition at line 72 of file RefCounter.cxx.

References _cnt, AttachDebugger(), and DEBTRACE.

73 {
74 #ifdef REFCNT
75  if(_cnt > 0)
76  {
77  DEBTRACE("Ref count > 0: " << this << " " << _cnt);
79  }
80 #endif
81 }

Member Function Documentation

bool RefCounter::decrRef ( )

Definition at line 48 of file RefCounter.cxx.

References _cnt, _globalMutexForTS, _totalCnt, and PMMLBasicsTestLauncher::ret.

Referenced by YACS::ENGINE::DynParaLoop::cloneAndPlaceNodesCoherently(), YACS::servicetypeParser< T >::component(), YACS::proctypeParser< T >::componentinstance(), YACS::ENGINE::ComposedAny::ComposedAny(), YACS::ENGINE::SequenceAny::destroyReprAtPlace(), YACS::ENGINE::InputPort::edInit(), YACS::ENGINE::InputPort::edRemoveManInit(), YACS::ENGINE::DataPort::edSetType(), YACS::ENGINE::CppNode::execute(), YACS::ENGINE::AnyInputPort::exRestoreInit(), YACS::ENGINE::ConditionInputPort::exRestoreInit(), YACS::ENGINE::InputPort4DF2DS::exRestoreInit(), YACS::ENGINE::AnyInputPort::exSaveInit(), YACS::ENGINE::ConditionInputPort::exSaveInit(), YACS::ENGINE::InputPort4DF2DS::exSaveInit(), SalomeEventLoop::get(), YACS::ENGINE::ForLoop::init(), YACS::servertypeParser< T >::loadcontainer(), YACS::proctypeParser< T >::objref(), YACS::ENGINE::ComposedNode::performDuplicationOfPlacement(), YACS::ENGINE::PluginSimplex::PluginSimplex(), YACS::ENGINE::Pool::pushInSample(), YACS::ENGINE::CppNeutral::put(), YACS::ENGINE::XmlCpp::put(), YACS::ENGINE::XmlNeutral::put(), YACS::ENGINE::PyNeutral::put(), YACS::ENGINE::PyCpp::put(), YACS::ENGINE::CorbaCpp::put(), YACS::ENGINE::CorbaNeutral::put(), YACS::ENGINE::CppCpp::put(), YACS::ENGINE::NeutralCpp::put(), YACS::ENGINE::AnyInputPort::put(), YACS::ENGINE::InputPort4DF2DS::put(), YACS::ENGINE::InPropertyPort::put(), YACS::ENGINE::OutputPort4DS2DF::put(), YACS::ENGINE::SplitterNode::putSplittedValueOnRankTo(), YACS::ENGINE::DynParaLoop::putValueOnBranch(), YACS::ENGINE::Proc::removeComponentInstance(), YACS::ENGINE::Proc::removeContainer(), YACS::ENGINE::SalomeProc::SalomeProc(), YACS::ENGINE::SeqAnyInputPort::SeqAnyInputPort(), YACS::proctypeParser< T >::sequence(), YACS::ENGINE::OptimizerLoop::setAlgorithm(), YACS::ENGINE::ServiceNode::setComponent(), YACS::ENGINE::CppNode::setFunc(), YACS::ENGINE::SalomeContainer::setProperty(), YACS::ENGINE::ServiceNode::setRef(), YACS::ENGINE::AnyOutputPort::setValue(), YACS::proctypeParser< T >::struct_(), YACS::proctypeParser< T >::type(), YACS::ENGINE::ForLoop::updateStateOnFinishedEventFrom(), YACS::ENGINE::Any::~Any(), YACS::ENGINE::AnyInputPort::~AnyInputPort(), YACS::ENGINE::AnyOutputPort::~AnyOutputPort(), YACS::ENGINE::ComponentInstance::~ComponentInstance(), YACS::ENGINE::ConditionInputPort::~ConditionInputPort(), YACS::ENGINE::ForEachLoopPassedData::~ForEachLoopPassedData(), YACS::ENGINE::InputCppPort::~InputCppPort(), YACS::ENGINE::InputPort::~InputPort(), YACS::ENGINE::InputPort4DF2DS::~InputPort4DF2DS(), YACS::ENGINE::OptimizerLoop::~OptimizerLoop(), YACS::ENGINE::OutputCppPort::~OutputCppPort(), YACS::ENGINE::OutputPort4DS2DF::~OutputPort4DS2DF(), YACS::ENGINE::PluginSimplex::~PluginSimplex(), YACS::ENGINE::Runtime::~Runtime(), YACS::ENGINE::SalomeContainer::~SalomeContainer(), YACS::ENGINE::ServiceNode::~ServiceNode(), and YACS::HMI::SubjectComponent::~SubjectComponent().

49 {
50  _globalMutexForTS.lock();
51 #ifdef REFCNT
53 #endif
54  bool ret=(--_cnt==0);
55  _globalMutexForTS.unLock();
56  if(ret)
57  delete this;
58  return ret;
59 }
void RefCounter::incrRef ( ) const

Definition at line 38 of file RefCounter.cxx.

References _cnt, _globalMutexForTS, and _totalCnt.

Referenced by YACS::ENGINE::Runtime::addCatalog(), YACS::ENGINE::Proc::addComponentInstance(), YACS::ENGINE::TypeCodeStruct::addMember(), YACS::ENGINE::Any::Any(), YACS::objtypeParser::base(), YACS::ENGINE::SalomePythonComponent::clone(), YACS::ENGINE::SalomeHPComponent::clone(), YACS::ENGINE::CORBAComponent::clone(), YACS::ENGINE::SalomeComponent::clone(), YACS::ENGINE::SalomeContainer::clone(), YACS::ENGINE::CppComponent::clone(), YACS::ENGINE::SalomeHPContainer::clone(), YACS::ENGINE::CppContainer::clone(), YACS::seqtypeParser::content(), YACS::ENGINE::convertNeutralNeutral(), YACS::ENGINE::Proc::createContainer(), YACS::ENGINE::Proc::createInterfaceTc(), YACS::ENGINE::Proc::createSequenceTc(), YACS::ENGINE::Proc::createStructTc(), YACS::ENGINE::Proc::createType(), YACS::ENGINE::DataPort::DataPort(), YACS::ENGINE::DataPort::edSetType(), YACS::ENGINE::Pool::ExpData::ExpData(), YACS::ENGINE::AnyInputPort::exRestoreInit(), YACS::ENGINE::ConditionInputPort::exRestoreInit(), YACS::ENGINE::InputPort4DF2DS::exRestoreInit(), YACS::ENGINE::AnyInputPort::exSaveInit(), YACS::ENGINE::ConditionInputPort::exSaveInit(), YACS::ENGINE::InputPort4DF2DS::exSaveInit(), YACS::ENGINE::ForEachLoopPassedData::ForEachLoopPassedData(), YACS::ENGINE::SequenceAny::getOrBuildFromData(), YACS::inlinetypeParser< T >::inport(), YACS::servertypeParser< T >::instream(), YACS::servicetypeParser< T >::instream(), YACS::ENGINE::SalomeOptimizerLoop::loadAlgorithm(), YACS::ENGINE::SessionCataLoader::loadTypes(), YACS::structtypeParser::member(), YACS::inlinetypeParser< T >::outport(), YACS::servertypeParser< T >::outstream(), YACS::servicetypeParser< T >::outstream(), YACS::outnodetypeParser< T >::parameter(), YACS::presettypeParser< T >::parameter(), YACS::ENGINE::ServiceNode::performShallowDuplicationOfPlacement(), YACS::ENGINE::InlineNode::performShallowDuplicationOfPlacement(), YACS::foreachlooptypeParser< T >::postAttr(), YACS::ENGINE::Proc::Proc(), YACS::ENGINE::AnyInputPort::put(), YACS::ENGINE::InputPort4DF2DS::put(), YACS::ENGINE::InPropertyPort::put(), YACS::ENGINE::OutputPort4DS2DF::put(), YACS::ENGINE::SequenceAny::putMyReprAtPlace(), YACS::ENGINE::SequenceAny::putReprAtPlace(), YACS::ENGINE::Runtime::Runtime(), YACS::ENGINE::SalomeContainer::SalomeContainer(), YACS::ENGINE::ComponentInstance::setContainer(), YACS::ENGINE::InlineNode::setContainer(), YACS::ENGINE::Pool::ExpData::setOutValue(), YACS::ENGINE::Proc::setTypeCode(), YACS::ENGINE::AnyOutputPort::setValue(), YACS::HMI::SubjectComponent::SubjectComponent(), YACS::ENGINE::TypeCodeArray::TypeCodeArray(), YACS::ENGINE::TypeCodeObjref::TypeCodeObjref(), YACS::ENGINE::TypeCodeSeq::TypeCodeSeq(), YACS::ENGINE::TypeCodeStruct::TypeCodeStruct(), and YACS::ENGINE::Proc::updateContainersAndComponents().

39 {
40  _globalMutexForTS.lock();
41 #ifdef REFCNT
43 #endif
44  _cnt++;
45  _globalMutexForTS.unLock();
46 }

Member Data Documentation

unsigned int YACS::ENGINE::RefCounter::_cnt
mutableprotected

Definition at line 41 of file RefCounter.hxx.

Referenced by decrRef(), incrRef(), and ~RefCounter().

unsigned int RefCounter::_totalCnt =0
static

Definition at line 35 of file RefCounter.hxx.

Referenced by decrRef(), incrRef(), RefCounter(), and YACS::ENGINE::Runtime::~Runtime().


The documentation for this class was generated from the following files: