00001 #ifndef INCLUDE_MARKER_H
00002 #define INCLUDE_MARKER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include <functional>
00039 #include <string>
00040 #include <vector>
00041
00042
00043 namespace Loris {
00044
00045
00046
00047
00053
00054 class Marker
00055 {
00056
00057 public:
00058
00059
00061 Marker( void );
00062
00067 Marker( double t, const std::string & s );
00068
00073 Marker( const Marker & other );
00074
00080 Marker & operator=( const Marker & rhs );
00081
00082
00083
00091 bool operator< ( const Marker & rhs ) const;
00092
00093
00094
00097 std::string & name( void );
00098
00101 const std::string & name( void ) const;
00102
00104 double time( void ) const;
00105
00106
00107
00109 void setName( const std::string & s );
00110
00112 void setTime( double t );
00113
00114
00115
00119 struct compareNameLess :
00120 public std::binary_function< const Marker, const Marker, bool >
00121 {
00125 bool operator()( const Marker & lhs, const Marker & rhs ) const
00126 { return lhs.name() < rhs.name(); }
00127 };
00128
00131 typedef compareNameLess sortByName;
00132
00133
00137 struct compareTimeLess :
00138 public std::binary_function< const Marker, const Marker, bool >
00139 {
00143 bool operator()( const Marker & lhs, const Marker & rhs ) const
00144 { return lhs.time() < rhs.time(); }
00145 };
00146
00149 typedef compareTimeLess sortByTime;
00150
00153 class isNameEqual : public std::unary_function< const Marker, bool >
00154 {
00155 public:
00157 isNameEqual( const std::string & s ) : name(s) {}
00158
00160 bool operator()( const Marker & m ) const
00161 { return m.name() == name; }
00162
00163 private:
00164 std::string name;
00165 };
00166
00167 private:
00168
00169
00170
00171 double m_time;
00172 std::string m_name;
00173
00174 };
00175
00176 }
00177
00178 #endif