Fawkes API  Fawkes Development Version
PclDatabaseStoreInterface.h
1 
2 /***************************************************************************
3  * PclDatabaseStoreInterface.h - Fawkes BlackBoard Interface - PclDatabaseStoreInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2012-2014 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_PCLDATABASESTOREINTERFACE_H_
25 #define __INTERFACES_PCLDATABASESTOREINTERFACE_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(PclDatabaseStoreInterface)
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  uint32_t msgid; /**<
47  The ID of the message that is currently being processed, or 0 if
48  no message is being processed.
49  */
50  bool final; /**<
51  True, if the last goto command has been finished, false if it is
52  still running.
53  */
54  char error[256]; /**<
55  Error description if reconstruction fails.
56  */
57  } PclDatabaseStoreInterface_data_t;
58 
59  PclDatabaseStoreInterface_data_t *data;
60 
61  public:
62  /* messages */
63  class StoreMessage : public Message
64  {
65  private:
66  /** Internal data storage, do NOT modify! */
67  typedef struct __attribute__((packed)) {
68  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
69  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
70  char pcl_id[64]; /**<
71  ID of the point cloud to store.
72  */
73  char database[64]; /**<
74  Database name from which to read the point clouds. If empty will
75  use plugin-configured default.
76  */
77  char collection[128]; /**<
78  Collection name from which to read the point clouds. May NOT
79  include the database name.
80  */
81  } StoreMessage_data_t;
82 
83  StoreMessage_data_t *data;
84 
85  public:
86  StoreMessage(const char * ini_pcl_id, const char * ini_database, const char * ini_collection);
87  StoreMessage();
88  ~StoreMessage();
89 
90  StoreMessage(const StoreMessage *m);
91  /* Methods */
92  char * pcl_id() const;
93  void set_pcl_id(const char * new_pcl_id);
94  size_t maxlenof_pcl_id() const;
95  char * database() const;
96  void set_database(const char * new_database);
97  size_t maxlenof_database() const;
98  char * collection() const;
99  void set_collection(const char * new_collection);
100  size_t maxlenof_collection() const;
101  virtual Message * clone() const;
102  };
103 
104  virtual bool message_valid(const Message *message) const;
105  private:
108 
109  public:
110  /* Methods */
111  uint32_t msgid() const;
112  void set_msgid(const uint32_t new_msgid);
113  size_t maxlenof_msgid() const;
114  bool is_final() const;
115  void set_final(const bool new_final);
116  size_t maxlenof_final() const;
117  char * error() const;
118  void set_error(const char * new_error);
119  size_t maxlenof_error() const;
120  virtual Message * create_message(const char *type) const;
121 
122  virtual void copy_values(const Interface *other);
123  virtual const char * enum_tostring(const char *enumtype, int val) const;
124 
125 };
126 
127 } // end namespace fawkes
128 
129 #endif
void set_msgid(const uint32_t new_msgid)
Set msgid value.
virtual Message * create_message(const char *type) const
Create message based on type name.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
void set_final(const bool new_final)
Set final value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
void set_error(const char *new_error)
Set error value.
Fawkes library namespace.
size_t maxlenof_msgid() const
Get maximum length of msgid value.
char * error() const
Get error value.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:79
const char * type() const
Get type of interface.
Definition: interface.cpp:651
size_t maxlenof_final() const
Get maximum length of final value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
uint32_t msgid() const
Get msgid value.
StoreMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_error() const
Get maximum length of error value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
PclDatabaseStoreInterface Fawkes BlackBoard Interface.