72 lines
1.9 KiB
C++
72 lines
1.9 KiB
C++
/**
|
|
* @file include/ActivMiddleware/ActivBase/SharedAccurateWaitEventFactory.h
|
|
*
|
|
* @brief Header file for the shared event factory class.
|
|
*/
|
|
|
|
#if (!defined ACTIV_BASE_SHARED_ACCURATE_WAIT_EVENT_FACTORY_H)
|
|
#define ACTIV_BASE_SHARED_ACCURATE_WAIT_EVENT_FACTORY_H
|
|
|
|
#include "ActivMiddleware/ActivBase/External.h"
|
|
#include "ActivMiddleware/ActivBase/IEvent.h"
|
|
#include "ActivMiddleware/ActivBase/Timeout.h"
|
|
#include "ActivMiddleware/Misc/Singleton.h"
|
|
|
|
//! Activ namespace.
|
|
namespace Activ
|
|
{
|
|
|
|
/**
|
|
* @brief Shared event factory class.
|
|
*
|
|
* This factory produces an object which has a more accurate Wait() function than the SharedEventFactory.
|
|
*/
|
|
class SharedAccurateWaitEventFactory : public Singleton<SharedAccurateWaitEventFactory>
|
|
{
|
|
public:
|
|
/**
|
|
* @brief Create an event.
|
|
*
|
|
* @param name the event name.
|
|
* @param flags creation flags.
|
|
* @param initialState whether the event is initially set upon creation.
|
|
*
|
|
* @return pointer to an object providing an IEvent interface.
|
|
*
|
|
* @throw Exception
|
|
*/
|
|
ACTIV_BASE_API IEvent *Create(const String &name, const IEvent::Flags::Type flags = IEvent::Flags::None(),
|
|
const bool initialState = false);
|
|
|
|
/**
|
|
* @brief Open an existing event.
|
|
*
|
|
* @param name the event name.
|
|
* @param timeout how long to wait for the object to exist, in ms.
|
|
*
|
|
* @return pointer to an object providing an IEvent interface.
|
|
*
|
|
* @throw Exception
|
|
*/
|
|
ACTIV_BASE_API IEvent *Open(const String &name, Timeout &timeout = Timeout::GetInfinite());
|
|
|
|
/**
|
|
* @brief Get a reference to the singleton instance.
|
|
*
|
|
* @return Reference.
|
|
*/
|
|
ACTIV_BASE_API static SharedAccurateWaitEventFactory &GetInstance();
|
|
|
|
private:
|
|
/**
|
|
* @brief Default constructor.
|
|
*/
|
|
ACTIV_BASE_API SharedAccurateWaitEventFactory();
|
|
|
|
friend class Singleton<SharedAccurateWaitEventFactory>;
|
|
};
|
|
|
|
} // namespace Activ
|
|
|
|
#endif // (!defined ACTIV_BASE_SHARED_ACCURATE_WAIT_EVENT_FACTORY_H)
|