#include <vector2.h>
Public Types | |
typedef vector2< _Ty, _Alloc > | _Myt |
typedef vector< _Ty, _Alloc > | _Mybase |
Public Member Functions | |
virtual void | limit (size_type _Limit) |
pair< size_type, bool > | position (const _Ty &_Val) const |
bool | contains (const _Ty &_Val) const |
bool | contains_no (const _Ty &_Val) const |
virtual bool | add_if_new (const _Ty &_Val) |
operator bool () | |
void | sort () |
Static Public Member Functions | |
static _Myt __cdecl | dyn_create (size_type _Count,...) |
Related Functions | |
(Note that these are not member functions.) | |
template<class _Ty_a, class _Alloc_a, class _Ty_b, class _Alloc_b> | |
vector2< _Ty_a, _Alloc_a > & | operator+= (vector2< _Ty_a, _Alloc_a > &container, const vector< _Ty_b, _Alloc_b > &values) |
template<class _Ty_a, class _Alloc_a, class _Ty_b, class _Alloc_b> | |
vector2< _Ty_a, _Alloc_a > & | operator<< (vector2< _Ty_a, _Alloc_a > &container, const vector< _Ty_b, _Alloc_b > &values) |
This specialisation supports:
__Ty | element/value type | |
__Alloc | element/value allocator |
Definition at line 75 of file vector2.h.
typedef vector2<_Ty, _Alloc> std::vector2< _Ty, _Alloc >::_Myt |
typedef vector<_Ty, _Alloc> std::vector2< _Ty, _Alloc >::_Mybase |
virtual void std::vector2< _Ty, _Alloc >::limit | ( | size_type | _Limit | ) | [inline, virtual] |
pair<size_type, bool> std::vector2< _Ty, _Alloc >::position | ( | const _Ty & | _Val | ) | const [inline] |
Brute force evaluation of element index in container. -1 is returned if element is not contained.
_Val | element to search for |
Definition at line 103 of file vector2.h.
00106 { 00107 size_type _Index = 0; 00108 for (const_iterator iter = begin(); iter != end(); ++iter, ++_Index) 00109 { 00110 if (*iter == _Val) 00111 { 00112 return pair<size_type, bool>(_Index, true); 00113 } 00114 } 00115 return pair<size_type, bool>(-1, false); 00116 }
bool std::vector2< _Ty, _Alloc >::contains | ( | const _Ty & | _Val | ) | const [inline] |
Brute force test to check whether or not a specific value is contained in the vector.
_Val | element to check for |
Definition at line 124 of file vector2.h.
Referenced by std::vector2< _Ty, _Alloc >::add_if_new().
bool std::vector2< _Ty, _Alloc >::contains_no | ( | const _Ty & | _Val | ) | const [inline] |
Brute force test to check whether or not a specific value is contained in the vector. The inverted result is returned this can be used for map2 values(check_fun_t) to return a unique list.
_Val | element to check for |
Definition at line 138 of file vector2.h.
virtual bool std::vector2< _Ty, _Alloc >::add_if_new | ( | const _Ty & | _Val | ) | [inline, virtual] |
Add _Val if it is not already contained in the vector Returns wether or not _Val was added
_Val | element to add |
Definition at line 151 of file vector2.h.
References std::vector2< _Ty, _Alloc >::contains().
00154 { 00155 if (!contains(_Val)) 00156 { 00157 push_back(_Val); 00158 return true; 00159 } 00160 return false; 00161 }
std::vector2< _Ty, _Alloc >::operator bool | ( | ) | [inline] |
void std::vector2< _Ty, _Alloc >::sort | ( | ) | [inline] |
static _Myt __cdecl std::vector2< _Ty, _Alloc >::dyn_create | ( | size_type | _Count, | |
... | ||||
) | [inline, static] |
Dynamic vector creation.
_Count | number of elemnts to put into vector2 | |
... | elements to put into the vector each of type _Ty (_Count times) |
Definition at line 187 of file vector2.h.
00191 { 00192 _Myt _Vector; 00193 va_list _Args; 00194 00195 va_start(_Args, _Count); 00196 while(_Count--) 00197 { 00198 _Vector.push_back(va_arg(_Args, const _Ty)); 00199 } 00200 va_end(_Args); 00201 return _Vector; 00202 }
vector2< _Ty_a, _Alloc_a > & operator+= | ( | vector2< _Ty_a, _Alloc_a > & | container, | |
const vector< _Ty_b, _Alloc_b > & | values | |||
) | [related] |
add (not store) the values of a container to another container
_Ty_b
to _Ty_a
exists _Ty_a | element/value type of receiver container | |
_Alloc_a | element/value allocator of receiver container | |
_Ty_b | element/value type of input container | |
_Alloc_b | element/value allocator of input container | |
container | container that receives th e input values | |
values | container input values |
Definition at line 223 of file vector2.h.
00227 { 00228 // NO clear 00229 for (vector<_Ty_b, _Alloc_b>::const_iterator it = values.begin(); it != values.end(); ++it) 00230 { 00231 container.push_back((_Ty_a)*it); 00232 } 00233 return container; 00234 };
vector2< _Ty_a, _Alloc_a > & operator<< | ( | vector2< _Ty_a, _Alloc_a > & | container, | |
const vector< _Ty_b, _Alloc_b > & | values | |||
) | [related] |
store (not add) the values of a container to another containert
_Ty_b
to _Ty_a
exists _Ty_a | element/value type of receiver container | |
_Alloc_a | element/value allocator of receiver container | |
_Ty_b | element/value type of input container | |
_Alloc_b | element/value allocator of input container | |
container | container that receives th e input values | |
values | container input values |
Definition at line 254 of file vector2.h.
Hosted on code.google.com | © Marcus Börger | Generated on Fri Jan 18 21:21:15 2008 for MBO-lib by ![]() |