tobicore  7.0.0
 All Classes Functions Variables Typedefs Enumerator Friends Groups Pages
IDAsClient.hpp
1 /*/*
2  Copyright (C) 2009-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne)
3  Michele Tavella <michele.tavella@epfl.ch>
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef IDASCLIENT_HPP
20 #define IDASCLIENT_HPP
21 
22 #include "IDTypes.hpp"
23 #include "IDMessage.hpp"
24 #include "IDSerializer.hpp"
25 #include <tobicore/TCException.hpp>
26 #include <tobicore/TCBlock.hpp>
27 #include <vector>
28 
38 class IDAsClient : public TCBlock {
39  public:
41  IDAsClient(void);
42 
44  virtual ~IDAsClient(void);
45 
51  virtual void Enqueue(const IDMessage message, bool updatefidx = false);
52 
53 
61  virtual bool Dequeue(IDMessage* message = NULL,
62  const IDFtype type = IDMessage::FamilyUndef,
63  const IDevent event = IDMessage::EventNull,
64  const int direction = IDAsClient::BlockAll);
65 
70  virtual unsigned int Size(void) const;
71 
76  virtual unsigned int Clear(void);
77 
79  virtual void Dump(void) const;
80 
81  public:
89  enum {
93  BlockThis = 0,
104  };
105  private:
107  std::vector<IDMessage> _queue;
108 };
109 
110 #endif