SkillerDebugInterface.h

00001 
00002 /***************************************************************************
00003  *  SkillerDebugInterface.h - Fawkes BlackBoard Interface - SkillerDebugInterface
00004  *
00005  *  Templated created:   Thu Oct 12 10:49:19 2006
00006  *  Copyright  2008  Tim Niemueller
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #ifndef __INTERFACES_SKILLERDEBUGINTERFACE_H_
00025 #define __INTERFACES_SKILLERDEBUGINTERFACE_H_
00026 
00027 #include <interface/interface.h>
00028 #include <interface/message.h>
00029 #include <interface/field_iterator.h>
00030 
00031 namespace fawkes {
00032 
00033 class SkillerDebugInterface : public Interface
00034 {
00035  /// @cond INTERNALS
00036  INTERFACE_MGMT_FRIENDS(SkillerDebugInterface)
00037  /// @endcond
00038  public:
00039   /* constants */
00040 
00041   /** Primary direction of the graph. */
00042   typedef enum {
00043     GD_TOP_BOTTOM /**< From top to bottom. */,
00044     GD_BOTTOM_TOP /**< From bottom to top. */,
00045     GD_LEFT_RIGHT /**< From left to right. */,
00046     GD_RIGHT_LEFT /**< From left to right. */
00047   } GraphDirectionEnum;
00048   const char * tostring_GraphDirectionEnum(GraphDirectionEnum value) const;
00049 
00050  private:
00051 #pragma pack(push,4)
00052   /** Internal data storage, do NOT modify! */
00053   typedef struct {
00054     int64_t timestamp_sec;  /**< Interface Unix timestamp, seconds */
00055     int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
00056     char graph_fsm[32]; /**< 
00057       The finite state machine (FSM) the current graph has been updated for.
00058      */
00059     char graph[8192]; /**< 
00060       The selected graph in a dot string representation.
00061      */
00062     GraphDirectionEnum graph_dir; /**< 
00063       Primary direction of current graph.
00064      */
00065     bool graph_colored; /**< 
00066       True if the graph is colored, false otherwise.
00067      */
00068   } SkillerDebugInterface_data_t;
00069 #pragma pack(pop)
00070 
00071   SkillerDebugInterface_data_t *data;
00072 
00073  public:
00074   /* messages */
00075   class SetGraphMessage : public Message
00076   {
00077    private:
00078 #pragma pack(push,4)
00079     /** Internal data storage, do NOT modify! */
00080     typedef struct {
00081       int64_t timestamp_sec;  /**< Interface Unix timestamp, seconds */
00082       int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
00083       char graph_fsm[32]; /**< 
00084       The finite state machine (FSM) the current graph has been updated for.
00085      */
00086     } SetGraphMessage_data_t;
00087 #pragma pack(pop)
00088 
00089     SetGraphMessage_data_t *data;
00090 
00091    public:
00092     SetGraphMessage(const char * ini_graph_fsm);
00093     SetGraphMessage();
00094     ~SetGraphMessage();
00095 
00096     SetGraphMessage(const SetGraphMessage *m);
00097     /* Methods */
00098     char * graph_fsm() const;
00099     void set_graph_fsm(const char * new_graph_fsm);
00100     size_t maxlenof_graph_fsm() const;
00101     virtual Message * clone() const;
00102   };
00103 
00104   class SetGraphDirectionMessage : public Message
00105   {
00106    private:
00107 #pragma pack(push,4)
00108     /** Internal data storage, do NOT modify! */
00109     typedef struct {
00110       int64_t timestamp_sec;  /**< Interface Unix timestamp, seconds */
00111       int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
00112       GraphDirectionEnum graph_dir; /**< 
00113       Primary direction of current graph.
00114      */
00115     } SetGraphDirectionMessage_data_t;
00116 #pragma pack(pop)
00117 
00118     SetGraphDirectionMessage_data_t *data;
00119 
00120    public:
00121     SetGraphDirectionMessage(const GraphDirectionEnum ini_graph_dir);
00122     SetGraphDirectionMessage();
00123     ~SetGraphDirectionMessage();
00124 
00125     SetGraphDirectionMessage(const SetGraphDirectionMessage *m);
00126     /* Methods */
00127     GraphDirectionEnum graph_dir() const;
00128     void set_graph_dir(const GraphDirectionEnum new_graph_dir);
00129     size_t maxlenof_graph_dir() const;
00130     virtual Message * clone() const;
00131   };
00132 
00133   class SetGraphColoredMessage : public Message
00134   {
00135    private:
00136 #pragma pack(push,4)
00137     /** Internal data storage, do NOT modify! */
00138     typedef struct {
00139       int64_t timestamp_sec;  /**< Interface Unix timestamp, seconds */
00140       int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
00141       bool graph_colored; /**< 
00142       True if the graph is colored, false otherwise.
00143      */
00144     } SetGraphColoredMessage_data_t;
00145 #pragma pack(pop)
00146 
00147     SetGraphColoredMessage_data_t *data;
00148 
00149    public:
00150     SetGraphColoredMessage(const bool ini_graph_colored);
00151     SetGraphColoredMessage();
00152     ~SetGraphColoredMessage();
00153 
00154     SetGraphColoredMessage(const SetGraphColoredMessage *m);
00155     /* Methods */
00156     bool is_graph_colored() const;
00157     void set_graph_colored(const bool new_graph_colored);
00158     size_t maxlenof_graph_colored() const;
00159     virtual Message * clone() const;
00160   };
00161 
00162   virtual bool message_valid(const Message *message) const;
00163  private:
00164   SkillerDebugInterface();
00165   ~SkillerDebugInterface();
00166 
00167  public:
00168   /* Methods */
00169   char * graph_fsm() const;
00170   void set_graph_fsm(const char * new_graph_fsm);
00171   size_t maxlenof_graph_fsm() const;
00172   char * graph() const;
00173   void set_graph(const char * new_graph);
00174   size_t maxlenof_graph() const;
00175   GraphDirectionEnum graph_dir() const;
00176   void set_graph_dir(const GraphDirectionEnum new_graph_dir);
00177   size_t maxlenof_graph_dir() const;
00178   bool is_graph_colored() const;
00179   void set_graph_colored(const bool new_graph_colored);
00180   size_t maxlenof_graph_colored() const;
00181   virtual Message * create_message(const char *type) const;
00182 
00183   virtual void copy_values(const Interface *other);
00184   virtual const char * enum_tostring(const char *enumtype, int val) const;
00185 
00186 };
00187 
00188 } // end namespace fawkes
00189 
00190 #endif

Generated on Tue Feb 22 13:31:24 2011 for Fawkes API by  doxygen 1.4.7