00001 #ifndef __INSTANTIO_SLOT_H
00002 #define __INSTANTIO_SLOT_H
00003
00004 #ifdef _MSC_VER
00005 # pragma once
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "InstantIODef.h"
00027 #include <string>
00028 #include <typeinfo>
00029 namespace Medusa
00030 {
00031 class Mutex;
00032 }
00033
00034
00035 namespace InstantIO
00036 {
00037
00038
00049 class INSTANTIO_DLLMAPPING Slot
00050 {
00051 public:
00052
00056 virtual ~Slot();
00057
00065 inline const std::string &getDescription() const
00066 { return description_; }
00067
00077 virtual const char *getTypeName() const = 0;
00078
00084 virtual const std::type_info &getTypeID() const = 0;
00085
00087 typedef enum { In, Out } Direction;
00088
00093 virtual Direction getDirection() const = 0;
00094
00095 protected:
00096
00104 explicit Slot(const std::string &description = std::string());
00105
00107 void listenersLock() const;
00108
00110 void listenersUnlock() const;
00111
00113 void lock() const;
00114
00116 void unlock() const;
00117
00119 std::string description_;
00120
00122 Medusa::Mutex *listenerMutex_;
00123
00125 Medusa::Mutex *mutex_;
00126
00127 private:
00128
00130 Slot(const Slot &);
00131
00133 const Slot &operator=(const Slot &);
00134 };
00135
00136
00137 }
00138
00139
00140 #endif //__INSTANTIO_SLOT_H