Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Device.h

Go to the documentation of this file.
00001 #ifndef DEVICE_H
00002 #define DEVICE_H
00003 
00004 #include "MessageList.h"
00005 #include <iostream>
00006 #include <queue>
00007 #include "Utility.h"
00008 namespace rwil {
00009   namespace ExecuteReturns{
00011     enum Returns { PleaseRetry = 0, DontRetry };
00012   }
00013 
00015 
00019   class Device
00020     {
00021     public:
00023 
00027       Device(const std::string &name, MessageList& output);
00028 
00029       virtual ~Device();
00030 
00032 
00035       virtual std::string GetStatus() const = 0;
00036 
00038 
00041       const std::string &GetName() const;
00042 
00044 
00047       void AddToQueue(const Message &msg);
00048 
00049 
00051 
00054       virtual bool Tick();
00055 
00056     protected:
00058       MessageList &m_output;
00059 
00061 
00068       virtual ExecuteReturns::Returns ExecuteMessage(const Message & msg) = 0;
00069 
00070     private:
00072       const std::string m_name;
00074       std::queue<Message> m_queue;
00076       unsigned m_retries;
00078       unsigned m_currentRetry;
00079     };
00080 }
00081 #endif

Generated on Tue Apr 9 13:53:07 2002 for RWIL - Real World Interface Library by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001