mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
git-subtree-dir: login_server git-subtree-mainline: 09ebb40de21084bb10ee466429d900a5e757d349 git-subtree-split: ca71af1817a801db9a108c205bc298250d498c4b
35 lines
606 B
C++
35 lines
606 B
C++
#ifndef __GRADIDO_LOGIN_SERVER_LIB_AUTO_PTR_CONTAINER
|
|
#define __GRADIDO_LOGIN_SERVER_LIB_AUTO_PTR_CONTAINER
|
|
|
|
/*!
|
|
* \author: Dario Rekowski
|
|
*
|
|
* \date: 02.06.2020
|
|
*
|
|
* \brief: keep track over reserved instances, for using with Poco::AutoPtr
|
|
*/
|
|
|
|
#include "Poco/Mutex.h"
|
|
|
|
class AutoPtrContainer
|
|
{
|
|
public:
|
|
AutoPtrContainer();
|
|
AutoPtrContainer(int referenceCount);
|
|
|
|
|
|
|
|
void duplicate();
|
|
void release();
|
|
|
|
protected:
|
|
// called only from release
|
|
virtual ~AutoPtrContainer();
|
|
|
|
private:
|
|
|
|
int mReferenceCount;
|
|
Poco::FastMutex mReferenceCountMutex;
|
|
};
|
|
|
|
#endif //__GRADIDO_LOGIN_SERVER_LIB_AUTO_PTR_CONTAINER
|