Version: 9.15.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 () const
 

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() [1/2]

RefCounter::RefCounter ( )
protected

Definition at line 61 of file RefCounter.cxx.

61  :_cnt(1)
62 {
63 #ifdef REFCNT
65 #endif
66 }
static unsigned int _totalCnt
Definition: RefCounter.hxx:35

References _totalCnt.

◆ RefCounter() [2/2]

RefCounter::RefCounter ( const RefCounter other)
protected

Definition at line 68 of file RefCounter.cxx.

68  :_cnt(1)
69 {
70 }

◆ ~RefCounter()

RefCounter::~RefCounter ( )
protectedvirtual

Definition at line 72 of file RefCounter.cxx.

73 {
74 #ifdef REFCNT
75  if(_cnt > 0)
76  {
77  DEBTRACE("Ref count > 0: " << this << " " << _cnt);
79  }
80 #endif
81 }
void AttachDebugger()
Definition: YacsTrace.cxx:52
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31

References _cnt, AttachDebugger(), and DEBTRACE.

Member Function Documentation

◆ decrRef()

bool RefCounter::decrRef ( ) const

Definition at line 48 of file RefCounter.cxx.

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 }
static YACS::BASES::Mutex _globalMutexForTS
Definition: RefCounter.cxx:36

References _cnt, _globalMutexForTS, and _totalCnt.

Referenced by YACS::ENGINE::ForEachLoopGen::buildDelegateOf(), YACS::ENGINE::DynParaLoop::cloneAndPlaceNodesCoherently(), YACS::servicetypeParser< T >::component(), YACS::proctypeParser< T >::componentinstance(), YACS::ENGINE::ComposedAny::ComposedAny(), YACS::proctypeParser< T >::container(), 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::ENGINE::ComposedNode::performDuplicationOfPlacement(), YACS::ENGINE::PluginSimplex::PluginSimplex(), YACS::ENGINE::Pool::pushInSample(), YACS::ENGINE::OutputPort4DS2DF::put(), YACS::ENGINE::CppNeutral::put(), YACS::ENGINE::XmlCpp::put(), YACS::ENGINE::XmlNeutral::put(), YACS::ENGINE::CorbaCpp::put(), YACS::ENGINE::CorbaNeutral::put(), YACS::ENGINE::PyNeutral::put(), YACS::ENGINE::OutputCppPort::put(), YACS::ENGINE::SplitterNode::putSplittedValueOnRankTo(), YACS::ENGINE::DynParaLoop::putValueOnBranch(), YACS::ENGINE::ConditionInputPort::releaseData(), YACS::ENGINE::InPropertyPort::releaseData(), YACS::ENGINE::InputPort4DF2DS::releaseData(), YACS::ENGINE::InputCppPort::releaseData(), YACS::ENGINE::AnyInputPort::releaseDataUnsafe(), YACS::ENGINE::Proc::removeComponentInstance(), YACS::ENGINE::Proc::removeContainer(), YACS::HMI::SubjectProc::removeSubjectDataType(), YACS::ENGINE::SalomeProc::SalomeProc(), YACS::ENGINE::SeqAnyInputPort::SeqAnyInputPort(), 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 >::type(), YACS::ENGINE::ForLoop::updateStateOnFinishedEventFrom(), YACS::ENGINE::Any::~Any(), YACS::ENGINE::AnyInputPort::~AnyInputPort(), YACS::ENGINE::AnyOutputPort::~AnyOutputPort(), YACS::ENGINE::Catalog::~Catalog(), 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().

◆ getRefCnt()

◆ incrRef()

void RefCounter::incrRef ( ) const

Definition at line 38 of file RefCounter.cxx.

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

References _cnt, _globalMutexForTS, and _totalCnt.

Referenced by YACS::ENGINE::Runtime::addCatalog(), YACS::ENGINE::Proc::addComponentInstance(), YACS::ENGINE::TypeCodeStruct::addMember(), YACS::ENGINE::Any::Any(), YACS::ENGINE::CORBAComponent::clone(), YACS::ENGINE::CppComponent::clone(), YACS::ENGINE::CppContainer::clone(), YACS::ENGINE::SalomeComponent::clone(), YACS::ENGINE::SalomeContainer::clone(), YACS::ENGINE::SalomeHPComponent::clone(), YACS::ENGINE::SalomeHPContainer::clone(), YACS::ENGINE::SalomePythonComponent::clone(), YACS::ENGINE::convertNeutralNeutral(), YACS::ENGINE::Proc::createContainer(), 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::ENGINE::InlineNode::performShallowDuplicationOfPlacement(), YACS::ENGINE::ServiceNode::performShallowDuplicationOfPlacement(), YACS::ENGINE::Proc::Proc(), YACS::ENGINE::AnyInputPort::put(), YACS::ENGINE::ConditionInputPort::put(), YACS::ENGINE::InputPort4DF2DS::put(), YACS::ENGINE::OutputPort4DS2DF::put(), YACS::ENGINE::InPropertyPort::put(), YACS::ENGINE::InputCppPort::put(), YACS::ENGINE::OutputCppPort::put(), YACS::ENGINE::SequenceAny::putMyReprAtPlace(), YACS::ENGINE::SequenceAny::putReprAtPlace(), YACS::ENGINE::Runtime::Runtime(), YACS::ENGINE::SalomeContainer::SalomeContainer(), YACS::ENGINE::ServiceNode::setComponent(), YACS::ENGINE::ComponentInstance::setContainer(), YACS::ENGINE::InlineNode::setContainer(), YACS::ENGINE::Pool::ExpData::setOutValue(), 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().

Member Data Documentation

◆ _cnt

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

Definition at line 41 of file RefCounter.hxx.

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

◆ _totalCnt

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: