Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * Position2DTrackInterface.h - Fawkes BlackBoard Interface - Position2DTrackInterface 00004 * 00005 * Templated created: Thu Oct 12 10:49:19 2006 00006 * Copyright 2009 Masrur Doostdar 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_POSITION2DTRACKINTERFACE_H_ 00025 #define __INTERFACES_POSITION2DTRACKINTERFACE_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 Position2DTrackInterface : public Interface 00034 { 00035 /// @cond INTERNALS 00036 INTERFACE_MGMT_FRIENDS(Position2DTrackInterface) 00037 /// @endcond 00038 public: 00039 /* constants */ 00040 00041 private: 00042 #pragma pack(push,4) 00043 /** Internal data storage, do NOT modify! */ 00044 typedef struct { 00045 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */ 00046 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */ 00047 float track_x_positions[30]; /**< 00048 X-Positions of the track. The first array-element is the oldest position of the track, 00049 the last is the newest. 00050 */ 00051 float track_y_positions[30]; /**< 00052 Y-Positions of the track. The first array-element is the oldest position of the track, 00053 the last is the newest. 00054 */ 00055 int32_t track_timestamps[30]; /**< 00056 Timestamps of the track. The first array-element is the oldest position of the track, 00057 the last is the newest. 00058 */ 00059 bool valid; /**< True, if this track is valid. */ 00060 uint32_t length; /**< Length of the Tracks (i.e. up to which index there are valid positions). */ 00061 uint32_t track_id; /**< The ID of the Track. */ 00062 } Position2DTrackInterface_data_t; 00063 #pragma pack(pop) 00064 00065 Position2DTrackInterface_data_t *data; 00066 00067 public: 00068 /* messages */ 00069 virtual bool message_valid(const Message *message) const; 00070 private: 00071 Position2DTrackInterface(); 00072 ~Position2DTrackInterface(); 00073 00074 public: 00075 /* Methods */ 00076 float * track_x_positions() const; 00077 float track_x_positions(unsigned int index) const; 00078 void set_track_x_positions(unsigned int index, const float new_track_x_positions); 00079 void set_track_x_positions(const float * new_track_x_positions); 00080 size_t maxlenof_track_x_positions() const; 00081 float * track_y_positions() const; 00082 float track_y_positions(unsigned int index) const; 00083 void set_track_y_positions(unsigned int index, const float new_track_y_positions); 00084 void set_track_y_positions(const float * new_track_y_positions); 00085 size_t maxlenof_track_y_positions() const; 00086 int32_t * track_timestamps() const; 00087 int32_t track_timestamps(unsigned int index) const; 00088 void set_track_timestamps(unsigned int index, const int32_t new_track_timestamps); 00089 void set_track_timestamps(const int32_t * new_track_timestamps); 00090 size_t maxlenof_track_timestamps() const; 00091 bool is_valid() const; 00092 void set_valid(const bool new_valid); 00093 size_t maxlenof_valid() const; 00094 uint32_t length() const; 00095 void set_length(const uint32_t new_length); 00096 size_t maxlenof_length() const; 00097 uint32_t track_id() const; 00098 void set_track_id(const uint32_t new_track_id); 00099 size_t maxlenof_track_id() const; 00100 virtual Message * create_message(const char *type) const; 00101 00102 virtual void copy_values(const Interface *other); 00103 virtual const char * enum_tostring(const char *enumtype, int val) const; 00104 00105 }; 00106 00107 } // end namespace fawkes 00108 00109 #endif