Torc  0.1
torcdevicehandler.h
Go to the documentation of this file.
1 #ifndef TORCDEVICEHANDLER_H
2 #define TORCDEVICEHANDLER_H
3 
4 // Qt
5 #include <QHash>
6 #include <QMutex>
7 #include <QReadWriteLock>
8 #include <QVariant>
9 
11 {
12  public:
14  virtual ~TorcDeviceHandler() = default;
15 
16  static void Start (const QVariantMap &Details);
17  static void Stop (void);
18 
19  protected:
20  virtual void Create (const QVariantMap &Details) = 0;
21  virtual void Destroy (void) = 0;
22  static TorcDeviceHandler* GetDeviceHandler (void);
24 
25  protected:
26  QReadWriteLock m_handlerLock;
27 
28  private:
29  static QList<TorcDeviceHandler*> gTorcDeviceHandlers;
30  static TorcDeviceHandler *gTorcDeviceHandler;
31  static QMutex *gTorcDeviceHandlersLock;
32  TorcDeviceHandler *m_nextTorcDeviceHandler;
33 
34  private:
35  Q_DISABLE_COPY(TorcDeviceHandler)
36 };
37 
38 #endif // TORCDEVICEHANDLER_H
static void Stop(void)
static TorcDeviceHandler * GetDeviceHandler(void)
static void Start(const QVariantMap &Details)
virtual ~TorcDeviceHandler()=default
virtual void Create(const QVariantMap &Details)=0
QReadWriteLock m_handlerLock
TorcDeviceHandler * GetNextHandler(void)
virtual void Destroy(void)=0