Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SkillerDebugInterface.h
1 
2 /***************************************************************************
3  * SkillerDebugInterface.h - Fawkes BlackBoard Interface - SkillerDebugInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2008 Tim Niemueller
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __INTERFACES_SKILLERDEBUGINTERFACE_H_
25 #define __INTERFACES_SKILLERDEBUGINTERFACE_H_
26 
27 #include <interface/interface.h>
28 #include <interface/message.h>
29 #include <interface/field_iterator.h>
30 
31 namespace fawkes {
32 
34 {
35  /// @cond INTERNALS
36  INTERFACE_MGMT_FRIENDS(SkillerDebugInterface)
37  /// @endcond
38  public:
39  /* constants */
40 
41  /** Primary direction of the graph. */
42  typedef enum {
43  GD_TOP_BOTTOM /**< From top to bottom. */,
44  GD_BOTTOM_TOP /**< From bottom to top. */,
45  GD_LEFT_RIGHT /**< From left to right. */,
46  GD_RIGHT_LEFT /**< From left to right. */
48  const char * tostring_GraphDirectionEnum(GraphDirectionEnum value) const;
49 
50  private:
51 #pragma pack(push,4)
52  /** Internal data storage, do NOT modify! */
53  typedef struct {
54  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
55  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
56  char graph_fsm[32]; /**<
57  The finite state machine (FSM) the current graph has been updated for.
58  */
59  char graph[8192]; /**<
60  The selected graph in a dot string representation.
61  */
62  int32_t graph_dir; /**<
63  Primary direction of current graph.
64  */
65  bool graph_colored; /**<
66  True if the graph is colored, false otherwise.
67  */
68  } SkillerDebugInterface_data_t;
69 #pragma pack(pop)
70 
71  SkillerDebugInterface_data_t *data;
72 
73  public:
74  /* messages */
75  class SetGraphMessage : public Message
76  {
77  private:
78 #pragma pack(push,4)
79  /** Internal data storage, do NOT modify! */
80  typedef struct {
81  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
82  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
83  char graph_fsm[32]; /**<
84  The finite state machine (FSM) the current graph has been updated for.
85  */
86  } SetGraphMessage_data_t;
87 #pragma pack(pop)
88 
89  SetGraphMessage_data_t *data;
90 
91  public:
92  SetGraphMessage(const char * ini_graph_fsm);
95 
97  /* Methods */
98  char * graph_fsm() const;
99  void set_graph_fsm(const char * new_graph_fsm);
100  size_t maxlenof_graph_fsm() const;
101  virtual Message * clone() const;
102  };
103 
105  {
106  private:
107 #pragma pack(push,4)
108  /** Internal data storage, do NOT modify! */
109  typedef struct {
110  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
111  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
112  int32_t graph_dir; /**<
113  Primary direction of current graph.
114  */
115  } SetGraphDirectionMessage_data_t;
116 #pragma pack(pop)
117 
118  SetGraphDirectionMessage_data_t *data;
119 
120  public:
121  SetGraphDirectionMessage(const GraphDirectionEnum ini_graph_dir);
124 
126  /* Methods */
128  void set_graph_dir(const GraphDirectionEnum new_graph_dir);
129  size_t maxlenof_graph_dir() const;
130  virtual Message * clone() const;
131  };
132 
134  {
135  private:
136 #pragma pack(push,4)
137  /** Internal data storage, do NOT modify! */
138  typedef struct {
139  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
140  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
141  bool graph_colored; /**<
142  True if the graph is colored, false otherwise.
143  */
144  } SetGraphColoredMessage_data_t;
145 #pragma pack(pop)
146 
147  SetGraphColoredMessage_data_t *data;
148 
149  public:
150  SetGraphColoredMessage(const bool ini_graph_colored);
153 
155  /* Methods */
156  bool is_graph_colored() const;
157  void set_graph_colored(const bool new_graph_colored);
158  size_t maxlenof_graph_colored() const;
159  virtual Message * clone() const;
160  };
161 
162  virtual bool message_valid(const Message *message) const;
163  private:
166 
167  public:
168  /* Methods */
169  char * graph_fsm() const;
170  void set_graph_fsm(const char * new_graph_fsm);
171  size_t maxlenof_graph_fsm() const;
172  char * graph() const;
173  void set_graph(const char * new_graph);
174  size_t maxlenof_graph() const;
176  void set_graph_dir(const GraphDirectionEnum new_graph_dir);
177  size_t maxlenof_graph_dir() const;
178  bool is_graph_colored() const;
179  void set_graph_colored(const bool new_graph_colored);
180  size_t maxlenof_graph_colored() const;
181  virtual Message * create_message(const char *type) const;
182 
183  virtual void copy_values(const Interface *other);
184  virtual const char * enum_tostring(const char *enumtype, int val) const;
185 
186 };
187 
188 } // end namespace fawkes
189 
190 #endif