nx_server_plugin_sdk 1.0 Server Plugin SDK

Public Member Functions | List of all members
nxpt::CommonRefManager Class Reference

`#include <plugin_tools.h>`

## Public Member Functions
| CommonRefManager (const CommonRefManager &)=delete
CommonRefManager & | operator= (const CommonRefManager &)=delete
| CommonRefManager (nxpl::PluginInterface *objToWatch)
| CommonRefManager (CommonRefManager *refCountingDelegate)
int | addRef () const
int | releaseRef () const
int | refCount () const

## Detailed Description

Implements nxpl::PluginInterface reference counting. Can delegate reference counting to another CommonRefManager instance.

This class does not inherit nxpl::PluginInterface because it would require virtual inheritance. This class instance is supposed to be nested into a monitored class.

## Constructor & Destructor Documentation

## ◆ CommonRefManager() [1/2]

nxpt::CommonRefManager::CommonRefManager | ( | nxpl::PluginInterface * | objToWatch | ) |
| inline

Use this constructor to delete objToWatch when the reference counter drops to zero. NOTE: After creation, the reference counter is 1.

## ◆ CommonRefManager() [2/2]

nxpt::CommonRefManager::CommonRefManager | ( | CommonRefManager * | refCountingDelegate | ) |
| inline

Use this constructor to delegate reference counting to another object. NOTE: It does not increment refCountingDelegate reference counter.

## Member Function Documentation

## ◆ addRef()

int nxpt::CommonRefManager::addRef | ( |  | ) | const
| inline

Implementation of nxpl::PluginInterface::addRef().

## ◆ releaseRef()

int nxpt::CommonRefManager::releaseRef | ( |  | ) | const
| inline

Implementation of nxpl::PluginInterface::releaseRef(). Deletes the monitored object if the reference counter drops to zero.

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

- src/plugins/plugin_tools.h