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

#include <ticpprc.h>

Collaboration diagram for TiCppRCImp:

Public Member Functions

 TiCppRCImp (TiCppRC *tiCppRC)
 Initializes m_tiCppRC pointer, and set reference count to 1.
void Nullify ()
 Allows the TiCppRC object to set the pointer to itself ( m_tiCppRc ) to nullptr when the TiCppRC object is deleted.
void IncRef ()
 Increment Reference Count.
void DecRef ()
 Decrement Reference Count.
void InitRef ()
 Set Reference Count to 1 - dangerous!
TiCppRCGet ()
 Get internal pointer to the TiCppRC object - not reference counted, use at your own risk.
bool IsNull ()
 Returns state of internal pointer - will be null if the object was deleted.

Private Attributes

int m_count
 Holds reference count to me, and to the node I point to.
TiCppRCm_tiCppRC
 Holds pointer to an object inheriting TiCppRC.

Detailed Description

Definition at line 74 of file ticpprc.h.

Constructor & Destructor Documentation

◆ TiCppRCImp()

TiCppRCImp::TiCppRCImp ( TiCppRC * tiCppRC)

Initializes m_tiCppRC pointer, and set reference count to 1.

Definition at line 952 of file ticpp.cpp.

953 : m_count(1)
954 , m_tiCppRC(tiCppRC) {}
TiCppRC * m_tiCppRC
Holds pointer to an object inheriting TiCppRC.
Definition ticpprc.h:78
int m_count
Holds reference count to me, and to the node I point to.
Definition ticpprc.h:76

References m_count, and m_tiCppRC.

Member Function Documentation

◆ DecRef()

void TiCppRCImp::DecRef ( )

Decrement Reference Count.

Definition at line 958 of file ticpp.cpp.

958 {
959 m_count--;
960
961 if (0 == m_count) {
962 delete m_tiCppRC;
963 delete this;
964 }
965}

References m_count, and m_tiCppRC.

◆ Get()

TiCppRC * TiCppRCImp::Get ( )

Get internal pointer to the TiCppRC object - not reference counted, use at your own risk.

Definition at line 971 of file ticpp.cpp.

971{ return m_tiCppRC; }

References m_tiCppRC.

◆ IncRef()

void TiCppRCImp::IncRef ( )

Increment Reference Count.

Definition at line 956 of file ticpp.cpp.

956{ m_count++; }

References m_count.

Referenced by ticpp::Node::InsertAfterChild(), ticpp::Node::InsertBeforeChild(), ticpp::Node::LinkEndChild(), and ticpp::Node::ReplaceChild().

Here is the caller graph for this function:

◆ InitRef()

void TiCppRCImp::InitRef ( )

Set Reference Count to 1 - dangerous!

  • Use only if you are sure of the consequences

Definition at line 967 of file ticpp.cpp.

967{ m_count = 1; }

References m_count.

◆ IsNull()

bool TiCppRCImp::IsNull ( )

Returns state of internal pointer - will be null if the object was deleted.

Definition at line 973 of file ticpp.cpp.

973{ return 0 == m_tiCppRC; }

References m_tiCppRC.

◆ Nullify()

void TiCppRCImp::Nullify ( )

Allows the TiCppRC object to set the pointer to itself ( m_tiCppRc ) to nullptr when the TiCppRC object is deleted.

Definition at line 969 of file ticpp.cpp.

969{ m_tiCppRC = 0; }

References m_tiCppRC.

Member Data Documentation

◆ m_count

int TiCppRCImp::m_count
private

Holds reference count to me, and to the node I point to.

Definition at line 76 of file ticpprc.h.

Referenced by TiCppRCImp(), DecRef(), IncRef(), and InitRef().

◆ m_tiCppRC

TiCppRC* TiCppRCImp::m_tiCppRC
private

Holds pointer to an object inheriting TiCppRC.

Definition at line 78 of file ticpprc.h.

Referenced by TiCppRCImp(), DecRef(), Get(), IsNull(), and Nullify().


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