54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
/**
|
|
* @file include/ActivMiddleware/ActivBase/PrivateSemaphoreFactory.h
|
|
*
|
|
* @brief Header file for the private semaphore factory class.
|
|
*/
|
|
|
|
#if (!defined ACTIV_BASE_PRIVATE_SEMAPHORE_FACTORY_H)
|
|
#define ACTIV_BASE_PRIVATE_SEMAPHORE_FACTORY_H
|
|
|
|
#include "ActivMiddleware/ActivBase/External.h"
|
|
#include "ActivMiddleware/ActivBase/ISemaphore.h"
|
|
#include "ActivMiddleware/Misc/Singleton.h"
|
|
|
|
//! Activ namespace.
|
|
namespace Activ
|
|
{
|
|
|
|
/**
|
|
* @brief Private semaphore factory class.
|
|
*
|
|
* A private semaphore cannot be shared across process boundaries.
|
|
*/
|
|
class PrivateSemaphoreFactory : public Singleton<PrivateSemaphoreFactory>
|
|
{
|
|
public:
|
|
/**
|
|
* @brief Create a private semaphore.
|
|
*
|
|
* @return pointer to an object providing an ISemaphore interface.
|
|
*
|
|
* @throw Exception
|
|
*/
|
|
ACTIV_BASE_API ISemaphore *Create();
|
|
|
|
/**
|
|
* @brief Get a reference to the singleton instance.
|
|
*
|
|
* @return Reference.
|
|
*/
|
|
ACTIV_BASE_API static PrivateSemaphoreFactory &GetInstance();
|
|
|
|
private:
|
|
/**
|
|
* @brief Default constructor.
|
|
*/
|
|
ACTIV_BASE_API PrivateSemaphoreFactory();
|
|
|
|
friend class Singleton<PrivateSemaphoreFactory>;
|
|
};
|
|
|
|
} // namespace Activ
|
|
|
|
#endif // (!defined ACTIV_BASE_PRIVATE_SEMAPHORE_FACTORY_H)
|