00001 #ifndef __MI_OBJECT_INSTANCE_H
00002 #define __MI_OBJECT_INSTANCE_H
00003
00004 #include <boost/smart_ptr.hpp>
00005 #include <map>
00006 #include <mimas/mm_object.h>
00007 #include <utility>
00008 #include "instance_data.hh"
00009 #include "mi_object_type.hh"
00010 #include "mi_pose.hh"
00011 #include "vision_type.hh"
00012
00024 class mi_object_instance: public mimas::mm_object
00025 {
00026 public:
00036 mi_object_instance( const std::string &_type, int _nr,
00037 double _timestamp,
00038 mi_pose _pose,
00039 vision_type type,
00040 instance_data_ptr _data ):
00041 id( _type, _nr ), timestamp( _timestamp ), pose( _pose )
00042 { internal_data[ type ] = _data; }
00048 std::string get_type(void) const { return id.first; }
00051 int get_id(void) const { return id.second; }
00057 double get_timestamp(void) const { return timestamp; }
00065 const mi_pose &get_pose(void) const { return pose; }
00067 instance_data_ptr data( vision_type type ) { return internal_data[ type ]; }
00068 protected:
00070 std::pair< std::string, int > id;
00072 double timestamp;
00074 mi_pose pose;
00076 std::map< vision_type, instance_data_ptr > internal_data;
00077 };
00078
00080 typedef boost::shared_ptr< mi_object_instance > mi_object_instance_ptr;
00081
00083
00084 #endif