aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
TiCppRC Class Reference

Base class for reference counting functionality. More...

#include <ticpprc.h>

Inheritance diagram for TiCppRC:
Collaboration diagram for TiCppRC:

Public Member Functions

 TiCppRC ()
 Constructor Spawns new reference counter with a pointer to this.
virtual ~TiCppRC ()
 Destructor Nullifies the pointer to this held by the reference counter Decrements reference count.
void DeleteSpawnedWrappers ()
 Delete all container objects we've spawned with 'new'.

Public Attributes

std::vector< ticpp::Base * > m_spawnedWrappers
 Remember all wrappers that we've created with 'new' - ( e.g.

Private Attributes

TiCppRCImpm_tiRC
 Pointer to reference counter.

Friends

class ticpp::Base

Detailed Description

Base class for reference counting functionality.

Definition at line 41 of file ticpprc.h.

Constructor & Destructor Documentation

◆ TiCppRC()

TiCppRC::TiCppRC ( )

Constructor Spawns new reference counter with a pointer to this.

Definition at line 924 of file ticpp.cpp.

924 {
925 // Spawn reference counter for this object
926 m_tiRC = new TiCppRCImp(this);
927}
TiCppRCImp * m_tiRC
Pointer to reference counter.
Definition ticpprc.h:46

◆ ~TiCppRC()

TiCppRC::~TiCppRC ( )
virtual

Destructor Nullifies the pointer to this held by the reference counter Decrements reference count.

Definition at line 940 of file ticpp.cpp.

940 {
942
943 // Set pointer held by reference counter to nullptr
944 this->m_tiRC->Nullify();
945
946 // Decrement reference - so reference counter will delete itself if necessary
947 this->m_tiRC->DecRef();
948}
void DeleteSpawnedWrappers()
Delete all container objects we've spawned with 'new'.
Definition ticpp.cpp:929

Member Function Documentation

◆ DeleteSpawnedWrappers()

void TiCppRC::DeleteSpawnedWrappers ( )

Delete all container objects we've spawned with 'new'.

Definition at line 929 of file ticpp.cpp.

929 {
930 std::vector< Base* >::reverse_iterator wrapper;
931
932 for (wrapper = m_spawnedWrappers.rbegin(); wrapper != m_spawnedWrappers.rend();
933 ++wrapper) {
934 delete *wrapper;
935 }
936
937 m_spawnedWrappers.clear();
938}
std::vector< ticpp::Base * > m_spawnedWrappers
Remember all wrappers that we've created with 'new' - ( e.g.
Definition ticpprc.h:63

References m_spawnedWrappers.

◆ ticpp::Base

friend class ticpp::Base
friend

Definition at line 43 of file ticpprc.h.

Member Data Documentation

◆ m_spawnedWrappers

std::vector< ticpp::Base* > TiCppRC::m_spawnedWrappers

Remember all wrappers that we've created with 'new' - ( e.g.

NodeFactory, FirstChildElement, etc. )

Definition at line 63 of file ticpprc.h.

Referenced by DeleteSpawnedWrappers(), ticpp::Element::LastAttribute(), ticpp::Attribute::Next(), ticpp::Node::NodeFactory(), ticpp::Attribute::Previous(), ticpp::Node::ToComment(), ticpp::Node::ToDocument(), and ticpp::Node::ToElement().

◆ m_tiRC

TiCppRCImp* TiCppRC::m_tiRC
private

Pointer to reference counter.

Definition at line 46 of file ticpprc.h.

Referenced by ticpp::Base::SetImpRC().


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