Server
API Reference Guide
Product Documentation:

Visualization Server
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlsRefCounted Class Reference

Base class for object with reference counting used by IlsSmartPointer. More...

#include <ilserver/refcount.h>

Inheritance diagram for IlsRefCounted:
IlsRpModel IlsViewed

Public Member Functions

 IlsRefCounted ()
 This is the default constructor of the class.
 
 IlsRefCounted (const IlsRefCounted &)
 This is the copy constructor of IlsRefCounted. More...
 
virtual ~IlsRefCounted ()
 This is the virtual destructor for IlsRefCounted.
 
IlsRefCount getRefCount ()
 This member function returns the reference counter of an object.
 
IlsRefCountedoperator= (const IlsRefCounted &)
 This is the assignment operator of IlsRefcounted.
 
IlsRefCount refcountDecr ()
 This member function decrements the reference counter. More...
 
void refcountIncr ()
 This member function increments the reference counter. More...
 

Static Public Member Functions

static void SetMT ()
 This static member function activates the multithread-safe facility. More...
 

Detailed Description

Base class for object with reference counting used by IlsSmartPointer.

Library: server
and mvcomp

IlsRefCounted includes a reference counter as a data member and supports smart pointers. Smart pointers automatically delete objects to which they point when the reference counters of those objects return to zero.

Warning
In case of multiple inheritance, we recommend that you make the derivation virtual in order to avoid the duplication of reference counters to an object.
Related Pattern
Proxy, flyweight
See also
IlsEntity, IlsObject, IlsRefCount, IlsSmartPointer.

Constructor & Destructor Documentation

◆ IlsRefCounted()

IlsRefCounted::IlsRefCounted ( const IlsRefCounted )

This is the copy constructor of IlsRefCounted.

It is designed to avoid copying the reference counter. The copied object gets a null reference counter, that is, one whose initial value is 0.

Member Function Documentation

◆ refcountDecr()

IlsRefCount IlsRefCounted::refcountDecr ( )

This member function decrements the reference counter.

It is seldom used. We recommend that you exclusively rely on smart pointers for reference counting.

◆ refcountIncr()

void IlsRefCounted::refcountIncr ( )

This member function increments the reference counter.

It is seldom used. We recommend that you exclusively rely on smart pointers for reference counting.

◆ SetMT()

static void IlsRefCounted::SetMT ( )
static

This static member function activates the multithread-safe facility.

For details, see the static function IlsMvServer::Initialize().