#include "CTBvector.hxx"
Inheritance diagram for CTBvector:
Public Types | |
typedef T | Elem_t |
typedef CTBretObj< CTBvector< T > > | RetObj |
Public Methods | |
CTBvector () | |
CTBvector (CTBint i_size) | |
CTBvector (CTBint i_size, const T &def) | |
CTBvector (const CTBvector< T > &rhs) | |
CTBvector (CTBvector< T > &rhs, bool b_grab) | |
CTBvector (CTBvector< T >::RetObj &rhs) | |
virtual | ~CTBvector () |
CTBint | Size () const |
CTBint | Capacity () const |
CTBvectorDsc< T > | Reverse () |
CTBvectorCDsc< T > | Reverse () const |
T & | At (CTBint i_ind) |
const T & | At (CTBint i_ind) const |
void | Resize (CTBint i_size) |
void | Resize (CTBint i_size, const T &def) |
void | Insert (CTBint i_ind, const T &rhs) |
void | Remove (CTBint i_ind, T &rhs) |
void | Delete (CTBint i_ind) |
void | InsertHead (const T &rhs) |
bool | RemoveHead (T &rhs) |
void | InsertTail (const T &rhs) |
bool | RemoveTail (T &rhs) |
void | EnsureCapacity (CTBint i_cap) |
void | IncreaseCapacity (CTBint i_cap) |
void | TrimCapacity () |
void | Grab (CTBvector< T > &rhs) |
const T * | Data () const |
CTBint | Stride () const |
void | Dump (int i_indent=0, ostream &os=cout, const char *p_text=0) const |
T & | operator[] (CTBint i_ind) |
const T & | operator[] (CTBint i_ind) const |
T & | operator() (CTBint i_ind) |
const T & | operator() (CTBint i_ind) const |
CTBvectorDsc< T > | operator() (const CTBrange &ran) |
CTBvectorCDsc< T > | operator() (const CTBrange &ran) const |
bool | operator! () const |
operator T * () | |
operator const T * () const | |
operator CTBvectorDsc () | |
operator CTBvectorCDsc () const | |
CTBvector< T > & | operator= (const T &rhs) |
CTBvector< T > & | operator= (const CTBvector< T > &rhs) |
CTBvector< T > & | operator= (const CTBvectorCDsc< T > &rhs) |
CTBvector< T > & | operator= (CTBvector< T >::RetObj &rhs) |
CTBvector< T > & | operator<< (const T &rhs) |
CTBvector< T > & | operator>> (T &rhs) |
Private Methods | |
void | ChangeCapacity (CTBint i_cap) |
Private Attributes | |
CTBrawBuffer< T > | m_rbuf |
CTBint | mi_nuse |
Related Functions | |
(Note that these are not member functions.) | |
ostream & | operator<< (ostream &os, const CTBvector< T > &obj) |
bool
conversion operator. This lead to ambiguous overload errors when a CTBvector<int>
was assigned to a CTBvectorDsc<int>
because the bool
, promoted to int
and than assigned to the vectorDsc.bool)
and the explicit bool
converter is thus redundant, and contraproductive.if()
whether it's empty or not. It is essential to have a matching operator!().
Definition at line 23 of file CTBvector.hxx.
|
vector element type.
Definition at line 27 of file CTBvector.hxx. |
|
Definition at line 28 of file CTBvector.hxx. |
|
Construct empty (size=0) vector.
Definition at line 20 of file CTBvector.icc. |
|
Construct with size i_size.
Definition at line 55 of file CTBvector.cxx. |
|
Construct with size i_size and default value def.
Definition at line 69 of file CTBvector.cxx. |
|
Copy constructor.
Definition at line 83 of file CTBvector.cxx. |
|
Definition at line 29 of file CTBvector.icc. |
|
Construct from return object.
Definition at line 40 of file CTBvector.icc. |
|
Definition at line 97 of file CTBvector.cxx. |
|
Returns size of vector.
Definition at line 51 of file CTBvector.icc. Referenced by CTBstack::At(), CTBadd(), CTBdot(), CTBsub(), ChangeCapacity(), CTBstack::Delete(), CTBprintfVV::Dimension1(), CTBprintfVM::Dimension1(), CTBprintfVV::Dimension2(), CTBattrList::Find(), CTBattrList::FindOrCreate(), CTBxmlIStream::GetTagFromLexer(), CTBstack::Insert(), CTBxmlToken::NAttribute(), CTBxmlOStream::PutEmptyTag(), CTBxmlOStream::PutEndTag(), CTBxmlOStream::PutStartTag(), CTBstack::Remove(), CTBattrList::Size(), CTBxmlToken::ToStream(), CTBattrList::ToStream(), CTBattrList::ToXStream(), TrimCapacity(), operator *=(), CTBattrList::operator void *(), CTBattrList::operator!(), CTBsortS::operator()(), CTBsortQ::operator()(), CTBsortI::operator()(), operator+=(), operator-=(), operator/=(), operator=(), CTBstack::operator[](), and CTBattrList::operator[]().
|
|
Returns capacity of vector.
Definition at line 60 of file CTBvector.icc. Referenced by EnsureCapacity(), IncreaseCapacity(), Insert(), InsertTail(), Resize(), and TrimCapacity().
|
|
Returns vector descriptor for vector with reversed indexing.
Definition at line 69 of file CTBvector.icc. |
|
Returns constant vector descriptor for vector with reversed indexing.
Definition at line 78 of file CTBvector.icc. |
|
Access vector element with index range check.
Reimplemented in CTBstack. Definition at line 112 of file CTBvector.cxx. Referenced by CTBstack::At(), operator()(), and operator[]().
|
|
Constant access vector element with index range check.
Reimplemented in CTBstack. Definition at line 127 of file CTBvector.cxx. |
|
Change size of vector to i_size.
Reimplemented in CTBstack. Definition at line 139 of file CTBvector.cxx. Referenced by CTBadd(), CTBdot(), CTBsub(), CTBxmlToken::Clear(), CTBattrList::Clear(), CTBxmlIStream::GetTagFromLexer(), CTBstack::Resize(), CTBsortS::operator()(), CTBsortQ::operator()(), CTBsortI::operator()(), CTBcallbackSource1R::operator()(), and CTBcallbackSource0R::operator()().
|
|
Change size of vector to i_size, set new elements to def.
Reimplemented in CTBstack. Definition at line 159 of file CTBvector.cxx. |
|
Insert a new element.
Reimplemented in CTBstack. Definition at line 179 of file CTBvector.cxx. Referenced by CTBstack::Insert(), and InsertHead().
|
|
Remove element.
Reimplemented in CTBstack. Definition at line 87 of file CTBvector.icc. Referenced by CTBstack::Remove(), and RemoveHead().
|
|
Delete element.
Reimplemented in CTBstack. Definition at line 204 of file CTBvector.cxx. Referenced by CTBstack::Delete(), and Remove().
|
|
Insert at begin of vector.
Reimplemented in CTBstack. Definition at line 98 of file CTBvector.icc. Referenced by CTBstack::InsertTail().
|
|
Remove from begin of vector, returns
If the vector is not empty, the element at the begin of the vector is copied to rhs and Reimplemented in CTBstack. Definition at line 113 of file CTBvector.icc. Referenced by CTBstack::RemoveTail().
|
|
Insert at end of vector.
Reimplemented in CTBstack. Definition at line 124 of file CTBvector.icc. Referenced by CTBstack::InsertHead(), and operator<<().
|
|
Remove from end of vector, returns
If the vector is not empty, the element at the end of the vector is copied to rhs and Reimplemented in CTBstack. Definition at line 146 of file CTBvector.icc. Referenced by CTBstack::RemoveHead(), and operator>>().
|
|
Ensure capacity of at least i_cap elements.
Definition at line 163 of file CTBvector.icc. Referenced by CTBstack::CTBstack(), CTBcallbackSource1R::operator()(), CTBcallbackSource0R::operator()(), and operator=().
|
|
Increase capacity to i_cap, at least double it.
Definition at line 221 of file CTBvector.cxx. Referenced by Insert(), and InsertTail().
|
|
Definition at line 173 of file CTBvector.icc. |
|
Grab resources. The resources allocated for rhs will be transfered to the calling object. Definition at line 234 of file CTBvector.cxx. Referenced by CTBxmlToken::Grab(), CTBstack::Grab(), and operator=().
|
|
Returns pointer to first element of vector.
This method is equivalent to operator T *() and has only been added to provide the interface used by Definition at line 187 of file CTBvector.icc. |
|
Returns stride of vector (returns always 1).
This method returns always Definition at line 200 of file CTBvector.icc. |
|
Dump.
Definition at line 249 of file CTBvector.cxx. Referenced by CTBxmlOStream::Dump(), CTBxmlIStream::Dump(), and CTBxmlToken::Dump().
|
|
Access element (index checked ifdef CTB__IndexCheck).
Reimplemented in CTBstack. Definition at line 209 of file CTBvector.icc. Referenced by CTBstack::operator[]().
|
|
Constant access element (index checked ifdef CTB__IndexCheck).
Reimplemented in CTBstack. Definition at line 222 of file CTBvector.icc. |
|
Access element (index checked ifdef CTB__IndexCheck).
Definition at line 235 of file CTBvector.icc. |
|
Constant access element (index checked ifdef CTB__IndexCheck).
Definition at line 248 of file CTBvector.icc. |
|
Acess vector subrange (index checked ifdef CTB__IndexCheck).
Definition at line 261 of file CTBvector.icc. |
|
Constant acess vector subrange (index checked ifdef CTB__IndexCheck).
Definition at line 273 of file CTBvector.icc. |
|
Returns
Definition at line 285 of file CTBvector.icc. |
|
Convert to pointer to data, returns null if Size()==0.
Definition at line 294 of file CTBvector.icc. |
|
Constant convert to pointer to data, returns null if Size()==0.
Definition at line 303 of file CTBvector.icc. |
|
Convert to vector descriptor.
Definition at line 312 of file CTBvector.icc. |
|
Convert to constant vector descriptor.
Definition at line 321 of file CTBvector.icc. |
|
Set all elements to the scalar value rhs.
Reimplemented in CTBstack. Definition at line 265 of file CTBvector.cxx. |
|
Copy elements of vector rhs.
Definition at line 285 of file CTBvector.cxx. |
|
Copy elements of vector descriptor rhs.
Definition at line 304 of file CTBvector.cxx. |
|
Assign from return object.
Definition at line 330 of file CTBvector.icc. |
|
Insert a new element with value rhs at tail of vector.
Reimplemented in CTBstack. Definition at line 340 of file CTBvector.icc. |
|
Return last element of vector as rhs, remove last element.
Reimplemented in CTBstack. Definition at line 350 of file CTBvector.icc. |
|
Change capacity.
Definition at line 329 of file CTBvector.cxx. Referenced by EnsureCapacity(), IncreaseCapacity(), Resize(), and TrimCapacity().
|
|
ostream insertion.
Definition at line 363 of file CTBvector.icc. |
|
raw memory buffer.
Definition at line 105 of file CTBvector.hxx. |
|
number of constructed elements.
Definition at line 106 of file CTBvector.hxx. |