nx_server_plugin_sdk 1.0 Server Plugin SDK

ref_counter.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #ifndef DEFAULT_REF_COUNTER_H
4 #define DEFAULT_REF_COUNTER_H
5
6 #include <plugins/plugin_tools.h>
7
8 namespace rpi_cam
9 {
10 template <typename T>
11 class DefaultRefCounter : public T
12 {
13 public:
14 virtual int addRef() const override { return m_refManager.addRef(); }
15 virtual int releaseRef() const override { return m_refManager.releaseRef(); }
16
17 protected:
18 nxpt::CommonRefManager m_refManager;
19
20 DefaultRefCounter()
21 : m_refManager(this)
22 {}
23
24 DefaultRefCounter(nxpt::CommonRefManager * refManager)
25 : m_refManager(refManager)
26 {}
27 };
28 }
29
30 #endif //DEFAULT_REF_COUNTER_H
rpi_cam
Raspberry Pi camera unit and configuration.
Definition: camera_manager.cpp:21
nxpt::CommonRefManager
Definition: plugin_tools.h:67
nxpt::CommonRefManager::addRef
int addRef() const
Definition: plugin_tools.h:96
plugin_tools.h
rpi_cam::DefaultRefCounter
Definition: ref_counter.h:11
nxpt::CommonRefManager::releaseRef
int releaseRef() const
Definition: plugin_tools.h:107