Fawkes API  Fawkes Development Version
EclipseDebuggerInterface.h
1 
2 /***************************************************************************
3  * EclipseDebuggerInterface.h - Fawkes BlackBoard Interface - EclipseDebuggerInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2012 Gesche Gierse
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_ECLIPSEDEBUGGERINTERFACE_H_
25 #define __INTERFACES_ECLIPSEDEBUGGERINTERFACE_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(EclipseDebuggerInterface)
37  /// @endcond
38  public:
39  /* constants */
40 
41  private:
42  /** Internal data storage, do NOT modify! */
43  typedef struct __attribute__((packed)) {
44  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
45  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
46  uint16_t port; /**< Port where to connect to */
47  char host[100]; /**< Host where to connect to */
48  } EclipseDebuggerInterface_data_t;
49 
50  EclipseDebuggerInterface_data_t *data;
51 
52  public:
53  /* messages */
54  class ConnectionMessage : public Message
55  {
56  private:
57  /** Internal data storage, do NOT modify! */
58  typedef struct __attribute__((packed)) {
59  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
60  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
61  } ConnectionMessage_data_t;
62 
63  ConnectionMessage_data_t *data;
64 
65  public:
68 
70  /* Methods */
71  virtual Message * clone() const;
72  };
73 
74  virtual bool message_valid(const Message *message) const;
75  private:
78 
79  public:
80  /* Methods */
81  uint16_t port() const;
82  void set_port(const uint16_t new_port);
83  size_t maxlenof_port() const;
84  char * host() const;
85  void set_host(const char * new_host);
86  size_t maxlenof_host() const;
87  virtual Message * create_message(const char *type) const;
88 
89  virtual void copy_values(const Interface *other);
90  virtual const char * enum_tostring(const char *enumtype, int val) const;
91 
92 };
93 
94 } // end namespace fawkes
95 
96 #endif
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
Fawkes library namespace.
size_t maxlenof_host() const
Get maximum length of host value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:79
void set_host(const char *new_host)
Set host value.
size_t maxlenof_port() const
Get maximum length of port value.
const char * type() const
Get type of interface.
Definition: interface.cpp:651
EclipseDebuggerInterface Fawkes BlackBoard Interface.
uint16_t port() const
Get port value.
char * host() const
Get host value.
virtual Message * create_message(const char *type) const
Create message based on type name.
ConnectionMessage Fawkes BlackBoard Interface Message.
void set_port(const uint16_t new_port)
Set port value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.