00001
00002
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 #if !defined(__DATAPOINT_STL_VECTOR_HPP)
00033 #define __DATAPOINT_STL_VECTOR_HPP
00034
00035 #include <vector>
00036 #include <algorithm>
00037
00038 #include "libecs.hpp"
00039
00040 #include "DataPoint.hpp"
00041
00042 namespace libecs
00043 {
00044
00045
00046
00047
00048
00049
00050
00051
00052 DECLARE_CLASS(DataPointStlVector);
00053 DECLARE_TYPE(DataPoint,Containee);
00054 DECLARE_VECTOR(Containee,Container);
00055
00056
00057 class DataPointStlVector
00058 {
00059
00060 public:
00061
00062 typedef Container::const_iterator const_iterator;
00063 typedef Container::iterator iterator;
00064 typedef Container::const_reference const_reference;
00065 typedef Container::reference reference;
00066 typedef Container::size_type size_type;
00067
00068 explicit DataPointStlVector( void )
00069 {
00070 ;
00071 }
00072
00073 DataPointStlVector( const_iterator start, const_iterator end )
00074 :
00075 theContainer( start, end )
00076 {
00077 ;
00078 }
00079
00080
00081 DataPointStlVector( DataPointStlVectorCref vector )
00082 :
00083 theContainer( vector.getContainer() )
00084 {
00085 ;
00086 }
00087
00088 DataPointStlVector( DataPointStlVectorRef vector )
00089 :
00090 theContainer( vector.getContainer() )
00091 {
00092 ;
00093 }
00094
00095
00096 ~DataPointStlVector(void);
00097
00098 ContainerCref getContainer() const
00099 {
00100 return theContainer;
00101 }
00102
00103 bool empty() const
00104 {
00105 return theContainer.empty();
00106 }
00107
00108 size_type size() const
00109 {
00110 return theContainer.size();
00111 }
00112
00113 const_iterator begin() const
00114 {
00115 return theContainer.begin();
00116 }
00117
00118 const_iterator end() const
00119 {
00120 return theContainer.end();
00121 }
00122
00123 const_reference front() const
00124 {
00125 return theContainer.front();
00126 }
00127
00128 const_reference back() const
00129 {
00130 return theContainer.back();
00131 }
00132
00133 iterator begin()
00134 {
00135 return theContainer.begin();
00136 }
00137
00138 iterator end()
00139 {
00140 return theContainer.end();
00141 }
00142
00143 reference back()
00144 {
00145 return theContainer.back();
00146 }
00147
00148
00149 void push( ContaineeRef aRef )
00150 {
00151 theContainer.push_back( aRef );
00152 }
00153
00154 void push( ContaineeCref aCref )
00155 {
00156 theContainer.push_back( aCref );
00157 }
00158
00159 void push( ContaineePtr aPtr )
00160 {
00161 theContainer.push_back( *aPtr );
00162 }
00163
00164
00165 void push( RealParam t, PolymorphCref v )
00166 {
00167 theContainer.push_back( Containee( t, v ) );
00168 }
00169
00170 void push( RealParam t, RealParam v )
00171 {
00172 theContainer.push_back( Containee( t, v ) );
00173 }
00174
00175 static const_iterator lower_bound( const_iterator first,
00176 const_iterator last,
00177 RealParam aTime )
00178 {
00179 return std::lower_bound( first, last, aTime );
00180 }
00181
00182 static const_iterator upper_bound( const_iterator first,
00183 const_iterator last,
00184 RealParam aTime )
00185 {
00186 return std::upper_bound( first, last, aTime );
00187 }
00188
00189
00190 private:
00191 Container theContainer;
00192
00193
00194 };
00195
00196
00197
00198 }
00199
00200 #endif