#ifndef CHANNEL_HH #define CHANNEL_HH /* * Channel.hh */ #ifdef FreeBSD #include #endif #include #include #include #include "Constants.hh" #include "Semaphore.hh" /** * The Channel classes are designed to unify the input and output functions. * This is done by creating an abstract Channel class with virtual Read, * Write and Open methods. These methods are implemented for each specific * channel (serial, parallel, etc.) that we need. */ template class Channel { public: int debugLevel; Channel (const char* name = "Channel"); virtual ~Channel (); void Name (const char* name); const char* Name (); virtual STATUS Open (); virtual STATUS Close (); virtual STATUS Read (Dtype message, long length, int timeout); /* timeout is in microseconds */ virtual STATUS Read (Dtype message, long length); virtual STATUS Write (Dtype message, long length); protected: const char* channelName; Semaphore* readSem; Semaphore* writeSem; }; #include "Channel.icc" #endif /* CHANNEL_HH */