Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ippServerQueues.h

Go to the documentation of this file.
00001 // 
00002 // DISCLAIMER: 
00003 //  This software was produced by the National Institute of Standards 
00004 //  and Technology (NIST), an agency of the U.S. government, and by statute is 
00005 //  not subject to copyright in the United States.  Recipients of this 
00006 //  software assume all responsibility associated with its operation,
00007 //  modification,maintenance, and subsequent redistribution. 
00008 //
00009 //  See NIST Administration Manual 4.09.07 b and Appendix I. 
00010 #ifndef __ippServerQueues_H
00011 #define __ippServerQueues_H
00012 
00013 #include "ippdme/ippdme.h"
00014 
00015 #include "ippdme/Response/ippResponse.h"
00016 
00017 
00018 #include <queue>
00019 
00020 
00021 class IPPDME_EXT_CLASS ippServerQueues
00022 {
00023 private:
00024 
00025   std::vector<int> _tagList;               //<! List of tag numbers in use
00026   std::queue<std::string> _fastQueue;      //<! Event commands go here
00027   std::queue<std::string> _slowQueue;      //<! Command commands go here
00028   std::queue<std::string> _responseQueue;  //<! All responses go here
00029   
00030 public:
00031 
00032   ippServerQueues();
00033 
00034   virtual ~ippServerQueues();
00035 
00039   void addTag(int tag_num);
00040 
00044   void delTag(int tag_num);
00045 
00049   bool tagInList(int tag_num) const;
00050 
00051   
00052   // Put an event on the event queue ( fast queue ) 
00053   void EnqueueEvent(const char * a_string);
00054 
00055   // Put a command on the command queue (slow queue)
00056   void EnqueueCommand(const char * a_string);
00057 
00058   // Put a response on the response queue
00059   void EnqueueResponse(const char * a_string);
00060 
00061   // Remove an event from the event queue ( fast queue )
00062   std::string DequeueEvent();
00063   
00064   // Remove a command from the command queue ( slow queue)
00065   std::string DequeueCommand();
00066 
00067   // Remove a response from the response queue 
00068   std::string DequeueResponse();
00069 
00070   // Check for data on a queue
00071   bool EventQueueHasData()const { return !_fastQueue.empty(); }
00072   bool CommandQueueHasData()const { return !_slowQueue.empty(); }
00073   bool ResponseQueueHasData()const { return !_responseQueue.empty(); }
00074   
00075 
00076   // Clear all queues in the case of an abort or a mid session client disconnect
00077   void ClearAllQueues();
00078 private:
00079   ippServerQueues(const ippServerQueues&);
00080   void operator=(const ippServerQueues&);
00081 };
00082 
00083 #endif /* #ifndef __ippServerQueues_H */

Generated on Wed Nov 8 00:20:00 2006 for IPPDME by  doxygen 1.4.1