Position2DTrackInterface.h

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   /** Internal data storage, do NOT modify! */
00043   typedef struct {
00044     unsigned int length; /**< Length of the Tracks (i.e. up to which index there are valid positions). */
00045     unsigned int track_id; /**< The ID of the Track. */
00046     int track_timestamps[30]; /**< 
00047       Timestamps of the track. The first array-element is the oldest position of the track, 
00048       the last is the newest.
00049      */
00050     float track_x_positions[30]; /**< 
00051       X-Positions of the track. The first array-element is the oldest position of the track, 
00052       the last is the newest.
00053      */
00054     float track_y_positions[30]; /**< 
00055       Y-Positions of the track. The first array-element is the oldest position of the track, 
00056       the last is the newest.
00057      */
00058     bool valid; /**< True, if this track is valid. */
00059   } Position2DTrackInterface_data_t;
00060
00061   Position2DTrackInterface_data_t *data;
00062
00063  public:
00064   /* messages */
00065   virtual bool message_valid(const Message *message) const;
00066  private:
00067   Position2DTrackInterface();
00068   ~Position2DTrackInterface();
00069
00070  public:
00071   /* Methods */
00072   float * track_x_positions() const;
00073   float track_x_positions(unsigned int index) const;
00074   void set_track_x_positions(unsigned int index, const float new_track_x_positions);
00075   void set_track_x_positions(const float * new_track_x_positions);
00076   size_t maxlenof_track_x_positions() const;
00077   float * track_y_positions() const;
00078   float track_y_positions(unsigned int index) const;
00079   void set_track_y_positions(unsigned int index, const float new_track_y_positions);
00080   void set_track_y_positions(const float * new_track_y_positions);
00081   size_t maxlenof_track_y_positions() const;
00082   int * track_timestamps() const;
00083   int track_timestamps(unsigned int index) const;
00084   void set_track_timestamps(unsigned int index, const int new_track_timestamps);
00085   void set_track_timestamps(const int * new_track_timestamps);
00086   size_t maxlenof_track_timestamps() const;
00087   bool is_valid() const;
00088   void set_valid(const bool new_valid);
00089   size_t maxlenof_valid() const;
00090   unsigned int length() const;
00091   void set_length(const unsigned int new_length);
00092   size_t maxlenof_length() const;
00093   unsigned int track_id() const;
00094   void set_track_id(const unsigned int new_track_id);
00095   size_t maxlenof_track_id() const;
00096   virtual Message * create_message(const char *type) const;
00097
00098   virtual void copy_values(const Interface *other);
00099
00100 };
00101
00102 } // end namespace fawkes
00103
00104 #endif