Fawkes API  Fawkes Development Version
PclDatabaseMergeInterface.h
1 
2 /***************************************************************************
3  * PclDatabaseMergeInterface.h - Fawkes BlackBoard Interface - PclDatabaseMergeInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2012 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_PCLDATABASEMERGEINTERFACE_H_
25 #define __INTERFACES_PCLDATABASEMERGEINTERFACE_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(PclDatabaseMergeInterface)
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  } PclDatabaseMergeInterface_data_t;
58 
59  PclDatabaseMergeInterface_data_t *data;
60 
61  public:
62  /* messages */
63  class MergeMessage : 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  int64_t timestamps[12]; /**<
71  Timestamps for which to retrieve the most recent point clouds
72  and merge them.
73  */
74  char database[64]; /**<
75  Database name from which to read the point clouds. If empty will
76  use plugin-configured default.
77  */
78  char collection[128]; /**<
79  Collection name from which to read the point clouds. May NOT
80  include the database name.
81  */
82  } MergeMessage_data_t;
83 
84  MergeMessage_data_t *data;
85 
86  public:
87  MergeMessage(const int64_t * ini_timestamps, const char * ini_database, const char * ini_collection);
88  MergeMessage();
89  ~MergeMessage();
90 
91  MergeMessage(const MergeMessage *m);
92  /* Methods */
93  int64_t * timestamps() const;
94  int64_t timestamps(unsigned int index) const;
95  void set_timestamps(unsigned int index, const int64_t new_timestamps);
96  void set_timestamps(const int64_t * new_timestamps);
97  size_t maxlenof_timestamps() const;
98  char * database() const;
99  void set_database(const char * new_database);
100  size_t maxlenof_database() const;
101  char * collection() const;
102  void set_collection(const char * new_collection);
103  size_t maxlenof_collection() const;
104  virtual Message * clone() const;
105  };
106 
107  virtual bool message_valid(const Message *message) const;
108  private:
111 
112  public:
113  /* Methods */
114  uint32_t msgid() const;
115  void set_msgid(const uint32_t new_msgid);
116  size_t maxlenof_msgid() const;
117  bool is_final() const;
118  void set_final(const bool new_final);
119  size_t maxlenof_final() const;
120  char * error() const;
121  void set_error(const char * new_error);
122  size_t maxlenof_error() const;
123  virtual Message * create_message(const char *type) const;
124 
125  virtual void copy_values(const Interface *other);
126  virtual const char * enum_tostring(const char *enumtype, int val) const;
127 
128 };
129 
130 } // end namespace fawkes
131 
132 #endif
PclDatabaseMergeInterface Fawkes BlackBoard Interface.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
size_t maxlenof_error() const
Get maximum length of error value.
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.
Fawkes library namespace.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:79
MergeMessage Fawkes BlackBoard Interface Message.
virtual void copy_values(const Interface *other)
Copy values from other interface.
const char * type() const
Get type of interface.
Definition: interface.cpp:651
uint32_t msgid() const
Get msgid value.
void set_msgid(const uint32_t new_msgid)
Set msgid value.
void set_error(const char *new_error)
Set error value.
size_t maxlenof_final() const
Get maximum length of final value.
virtual Message * create_message(const char *type) const
Create message based on type name.
size_t maxlenof_msgid() const
Get maximum length of msgid value.
char * error() const
Get error value.