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
00049  private:
00050   /** Internal data storage, do NOT modify! */
00051   typedef struct {
00052     bool graph_colored; /**< 
00053       True if the graph is colored, false otherwise.
00054      */
00055     char graph_fsm[32]; /**< 
00056       The finite state machine (FSM) the current graph has been updated for.
00057      */
00058     char graph[8192]; /**< 
00059       The selected graph in a dot string representation.
00060      */
00061     GraphDirectionEnum graph_dir; /**< 
00062       Primary direction of current graph.
00063      */
00064   } SkillerDebugInterface_data_t;
00065
00066   SkillerDebugInterface_data_t *data;
00067
00068  public:
00069   /* messages */
00070   class SetGraphMessage : public Message
00071   {
00072    private:
00073     /** Internal data storage, do NOT modify! */
00074     typedef struct {
00075       char graph_fsm[32]; /**< 
00076       The finite state machine (FSM) the current graph has been updated for.
00077      */
00078     } SetGraphMessage_data_t;
00079
00080     SetGraphMessage_data_t *data;
00081
00082    public:
00083     SetGraphMessage(const char * ini_graph_fsm);
00084     SetGraphMessage();
00085     ~SetGraphMessage();
00086
00087     SetGraphMessage(const SetGraphMessage *m);
00088     /* Methods */
00089     char * graph_fsm() const;
00090     void set_graph_fsm(const char * new_graph_fsm);
00091     size_t maxlenof_graph_fsm() const;
00092     virtual Message * clone() const;
00093   };
00094
00095   class SetGraphDirectionMessage : public Message
00096   {
00097    private:
00098     /** Internal data storage, do NOT modify! */
00099     typedef struct {
00100       GraphDirectionEnum graph_dir; /**< 
00101       Primary direction of current graph.
00102      */
00103     } SetGraphDirectionMessage_data_t;
00104
00105     SetGraphDirectionMessage_data_t *data;
00106
00107    public:
00108     SetGraphDirectionMessage(const GraphDirectionEnum ini_graph_dir);
00109     SetGraphDirectionMessage();
00110     ~SetGraphDirectionMessage();
00111
00112     SetGraphDirectionMessage(const SetGraphDirectionMessage *m);
00113     /* Methods */
00114     GraphDirectionEnum graph_dir() const;
00115     void set_graph_dir(const GraphDirectionEnum new_graph_dir);
00116     size_t maxlenof_graph_dir() const;
00117     virtual Message * clone() const;
00118   };
00119
00120   class SetGraphColoredMessage : public Message
00121   {
00122    private:
00123     /** Internal data storage, do NOT modify! */
00124     typedef struct {
00125       bool graph_colored; /**< 
00126       True if the graph is colored, false otherwise.
00127      */
00128     } SetGraphColoredMessage_data_t;
00129
00130     SetGraphColoredMessage_data_t *data;
00131
00132    public:
00133     SetGraphColoredMessage(const bool ini_graph_colored);
00134     SetGraphColoredMessage();
00135     ~SetGraphColoredMessage();
00136
00137     SetGraphColoredMessage(const SetGraphColoredMessage *m);
00138     /* Methods */
00139     bool is_graph_colored() const;
00140     void set_graph_colored(const bool new_graph_colored);
00141     size_t maxlenof_graph_colored() const;
00142     virtual Message * clone() const;
00143   };
00144
00145   virtual bool message_valid(const Message *message) const;
00146  private:
00147   SkillerDebugInterface();
00148   ~SkillerDebugInterface();
00149
00150  public:
00151   /* Methods */
00152   char * graph_fsm() const;
00153   void set_graph_fsm(const char * new_graph_fsm);
00154   size_t maxlenof_graph_fsm() const;
00155   char * graph() const;
00156   void set_graph(const char * new_graph);
00157   size_t maxlenof_graph() const;
00158   GraphDirectionEnum graph_dir() const;
00159   void set_graph_dir(const GraphDirectionEnum new_graph_dir);
00160   size_t maxlenof_graph_dir() const;
00161   bool is_graph_colored() const;
00162   void set_graph_colored(const bool new_graph_colored);
00163   size_t maxlenof_graph_colored() const;
00164   virtual Message * create_message(const char *type) const;
00165
00166   virtual void copy_values(const Interface *other);
00167
00168 };
00169
00170 } // end namespace fawkes
00171
00172 #endif