ReactOS  0.4.14-dev-98-gb0d4763
TArrayAsVector< T > Class Template Reference

#include <stl_bids.h>

Inheritance diagram for TArrayAsVector< T >:
Collaboration diagram for TArrayAsVector< T >:

Public Member Functions

 TArrayAsVector (size_type upper, size_type lower=0, int delta=0)
 
 ~TArrayAsVector ()
 
int Add (const T &item)
 
int AddAt (const T &item, size_type index)
 
size_type ArraySize ()
 
size_type BoundBase (size_type location) const
 
void Detach (size_type index)
 
void Detach (const T &item)
 
void Destroy (size_type index)
 
void Destroy (const T &item)
 
size_type Find (const T &item) const
 
size_type GetItemsInContainer ()
 
void Grow (size_type index)
 
int HasMember (const T &item)
 
int IsEmpty ()
 
int IsFull ()
 
size_type LowerBound ()
 
Toperator[] (size_type index)
 
const Toperator[] (size_type index) const
 
void Flush ()
 
void Reallocate (size_type sz, size_type offset=0)
 
void RemoveEntry (size_type index)
 
void SetData (size_type index, const T &item)
 
size_type UpperBound ()
 
size_type ZeroBase (size_type index) const
 
TArrayAsVectoroperator= (const TArrayAsVector &v)
 

Private Types

typedef size_t size_type
 
typedef vector< T >::const_iterator const_iterator
 

Private Attributes

const unsigned int growable
 
const size_type lowerbound
 

Detailed Description

template<class T>
class TArrayAsVector< T >

Definition at line 18 of file stl_bids.h.

Member Typedef Documentation

◆ const_iterator

template<class T>
typedef vector<T>::const_iterator TArrayAsVector< T >::const_iterator
private

Definition at line 22 of file stl_bids.h.

◆ size_type

template<class T>
typedef size_t TArrayAsVector< T >::size_type
private

Definition at line 21 of file stl_bids.h.

Constructor & Destructor Documentation

◆ TArrayAsVector()

template<class T>
TArrayAsVector< T >::TArrayAsVector ( size_type  upper,
size_type  lower = 0,
int  delta = 0 
)
inline

Definition at line 25 of file stl_bids.h.

27  :
28  vector<T>( ),
29  growable(delta),
30  lowerbound(lower)
31  { vector<T>::reserve(upper-lower + 1);}
const unsigned int growable
Definition: stl_bids.h:20
const size_type lowerbound
Definition: stl_bids.h:23
void reserve(size_type __n)
Definition: _vector.c:62

◆ ~TArrayAsVector()

template<class T>
TArrayAsVector< T >::~TArrayAsVector ( )
inline

Definition at line 33 of file stl_bids.h.

34  { // This call is unnecessary? (Paul Brannan 5/7/98)
35  // vector<T>::~vector( );
36  }

Member Function Documentation

◆ Add()

template<class T>
int TArrayAsVector< T >::Add ( const T item)
inline

Definition at line 38 of file stl_bids.h.

39  { if(!growable && vector<T>::size( ) == vector<T>::capacity( ))
40  return 0;
41  else
43  return 1; }
const unsigned int growable
Definition: stl_bids.h:20
GLuint GLuint end
Definition: gl.h:1545
iterator insert(iterator __pos, const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
Definition: _vector.c:223
GLsizeiptr size
Definition: glext.h:5919
static ATOM item
Definition: dde.c:856

Referenced by KeyTranslator::AddGlobalDef(), KeyTranslator::AddKeyDef(), and TMapLoader::Load().

◆ AddAt()

template<class T>
int TArrayAsVector< T >::AddAt ( const T item,
size_type  index 
)
inline

Definition at line 45 of file stl_bids.h.

46  { if(!growable &&
47  ((vector<T>::size( ) == vector<T>::capacity( )) ||
48  (ZeroBase(index > vector<T>::capacity( )) )))
49  return 0;
50  if(ZeroBase(index) > vector<T>::capacity( )) // out of bounds
52  ZeroBase(index) - vector<T>::size( ), T( ));
54  else
56  return 1;
57  }
const unsigned int growable
Definition: stl_bids.h:20
GLuint GLuint end
Definition: gl.h:1545
#define T
Definition: mbstring.h:31
iterator insert(iterator __pos, const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
Definition: _vector.c:223
GLuint index
Definition: glext.h:6031
static clock_t begin
Definition: xmllint.c:466
GLsizeiptr size
Definition: glext.h:5919
size_type ZeroBase(size_type index) const
Definition: stl_bids.h:147
static ATOM item
Definition: dde.c:856

◆ ArraySize()

template<class T>
size_type TArrayAsVector< T >::ArraySize ( )
inline

Definition at line 59 of file stl_bids.h.

60  { return vector<T>::capacity( ); }
size_type capacity() const
Definition: _vector.h:199

◆ BoundBase()

template<class T>
size_type TArrayAsVector< T >::BoundBase ( size_type  location) const
inline

Definition at line 62 of file stl_bids.h.

63  { if(location == UINT_MAX)
64  return INT_MAX;
65  else
66  return location + lowerbound; }
#define INT_MAX
Definition: limits.h:40
#define UINT_MAX
Definition: limits.h:41
const size_type lowerbound
Definition: stl_bids.h:23

◆ Destroy() [1/2]

template<class T>
void TArrayAsVector< T >::Destroy ( size_type  index)
inline

Definition at line 73 of file stl_bids.h.

GLuint index
Definition: glext.h:6031
static clock_t begin
Definition: xmllint.c:466
size_type ZeroBase(size_type index) const
Definition: stl_bids.h:147
iterator erase(iterator __pos)
Definition: _vector.h:620

Referenced by KeyTranslator::DeleteKeyDef().

◆ Destroy() [2/2]

template<class T>
void TArrayAsVector< T >::Destroy ( const T item)
inline

Definition at line 76 of file stl_bids.h.

77  { Destroy(Find(item)); }
size_type Find(const T &item) const
Definition: stl_bids.h:79
static ATOM item
Definition: dde.c:856
void Destroy(size_type index)
Definition: stl_bids.h:73

◆ Detach() [1/2]

template<class T>
void TArrayAsVector< T >::Detach ( size_type  index)
inline

Definition at line 67 of file stl_bids.h.

GLuint index
Definition: glext.h:6031
static clock_t begin
Definition: xmllint.c:466
size_type ZeroBase(size_type index) const
Definition: stl_bids.h:147
iterator erase(iterator __pos)
Definition: _vector.h:620

◆ Detach() [2/2]

template<class T>
void TArrayAsVector< T >::Detach ( const T item)
inline

Definition at line 70 of file stl_bids.h.

71  { Destroy(Find(item)); }
size_type Find(const T &item) const
Definition: stl_bids.h:79
static ATOM item
Definition: dde.c:856
void Destroy(size_type index)
Definition: stl_bids.h:73

◆ Find()

template<class T>
size_type TArrayAsVector< T >::Find ( const T item) const
inline

Definition at line 79 of file stl_bids.h.

81  vector<T>::end( ), item);
82  if(location != vector<T>::end( ))
84  vector<T>::begin( )));
85  else
86  return INT_MAX; }
size_type BoundBase(size_type location) const
Definition: stl_bids.h:62
#define INT_MAX
Definition: limits.h:40
GLuint GLuint end
Definition: gl.h:1545
static clock_t begin
Definition: xmllint.c:466
size_t size_type
Definition: stl_bids.h:21
static ATOM item
Definition: dde.c:856
vector< T >::const_iterator const_iterator
Definition: stl_bids.h:22
static TAGID TAGID find
Definition: db.cpp:153

Referenced by KeyTranslator::AddKeyDef(), KeyTranslator::DeleteKeyDef(), KeyTranslator::switchMap(), and KeyTranslator::TranslateKey().

◆ Flush()

template<class T>
void TArrayAsVector< T >::Flush ( )
inline

Definition at line 126 of file stl_bids.h.

127  {
129  }
void clear()
Definition: _vector.h:650

Referenced by KeyTranslator::DeleteAllDefs().

◆ GetItemsInContainer()

template<class T>
size_type TArrayAsVector< T >::GetItemsInContainer ( )
inline

◆ Grow()

template<class T>
void TArrayAsVector< T >::Grow ( size_type  index)
inline

Definition at line 91 of file stl_bids.h.

92  { if( index < lowerbound )
93  Reallocate(ArraySize( ) + (index -
94  lowerbound));
95  else if( index >= BoundBase(vector<T>::size( )))
size_type BoundBase(size_type location) const
Definition: stl_bids.h:62
size_type ArraySize()
Definition: stl_bids.h:59
void Reallocate(size_type sz, size_type offset=0)
Definition: stl_bids.h:131
GLuint index
Definition: glext.h:6031
GLsizeiptr size
Definition: glext.h:5919
size_type ZeroBase(size_type index) const
Definition: stl_bids.h:147
const size_type lowerbound
Definition: stl_bids.h:23

◆ HasMember()

template<class T>
int TArrayAsVector< T >::HasMember ( const T item)
inline

Definition at line 98 of file stl_bids.h.

99  { if(Find(item) != INT_MAX)
100  return 1;
101  else
102  return 0; }
#define INT_MAX
Definition: limits.h:40
size_type Find(const T &item) const
Definition: stl_bids.h:79
static ATOM item
Definition: dde.c:856

◆ IsEmpty()

◆ IsFull()

template<class T>
int TArrayAsVector< T >::IsFull ( )
inline

Definition at line 107 of file stl_bids.h.

108  { if(growable)
109  return 0;
110  if(vector<T>::size( ) == vector<T>::capacity( ))
111  return 1;
112  else
113  return 0; }
const unsigned int growable
Definition: stl_bids.h:20
GLsizeiptr size
Definition: glext.h:5919

◆ LowerBound()

template<class T>
size_type TArrayAsVector< T >::LowerBound ( )
inline

Definition at line 115 of file stl_bids.h.

116  { return lowerbound; }
const size_type lowerbound
Definition: stl_bids.h:23

◆ operator=()

template<class T>
TArrayAsVector& TArrayAsVector< T >::operator= ( const TArrayAsVector< T > &  v)
inline

Definition at line 151 of file stl_bids.h.

151  {
153  // should growable and lowerbound be copied as well?
154  return *this;
155  }
_Self & operator=(const _Self &__x)
Definition: _vector.c:182
const GLdouble * v
Definition: gl.h:2040

◆ operator[]() [1/2]

template<class T>
T& TArrayAsVector< T >::operator[] ( size_type  index)
inline

Definition at line 118 of file stl_bids.h.

119  { return vector<T>::
GLuint index
Definition: glext.h:6031
size_type ZeroBase(size_type index) const
Definition: stl_bids.h:147
reference operator[](size_type __n)
Definition: _vector.h:202

◆ operator[]() [2/2]

template<class T>
const T& TArrayAsVector< T >::operator[] ( size_type  index) const
inline

Definition at line 122 of file stl_bids.h.

123  { return vector<T>::
GLuint index
Definition: glext.h:6031
size_type ZeroBase(size_type index) const
Definition: stl_bids.h:147
reference operator[](size_type __n)
Definition: _vector.h:202

◆ Reallocate()

template<class T>
void TArrayAsVector< T >::Reallocate ( size_type  sz,
size_type  offset = 0 
)
inline

Definition at line 131 of file stl_bids.h.

133  { if(offset)
135  vector<T>::reserve(sz);
GLintptr offset
Definition: glext.h:5920
GLuint GLuint end
Definition: gl.h:1545
#define T
Definition: mbstring.h:31
iterator insert(iterator __pos, const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
Definition: _vector.c:223
static clock_t begin
Definition: xmllint.c:466
iterator erase(iterator __pos)
Definition: _vector.h:620
void reserve(size_type __n)
Definition: _vector.c:62

◆ RemoveEntry()

template<class T>
void TArrayAsVector< T >::RemoveEntry ( size_type  index)
inline

Definition at line 138 of file stl_bids.h.

139  { Detach(index); }
void Detach(size_type index)
Definition: stl_bids.h:67
GLuint index
Definition: glext.h:6031

◆ SetData()

template<class T>
void TArrayAsVector< T >::SetData ( size_type  index,
const T item 
)
inline

Definition at line 141 of file stl_bids.h.

142  { (*this)[index] = item; }
#define index(s, c)
Definition: various.h:29
static ATOM item
Definition: dde.c:856

◆ UpperBound()

template<class T>
size_type TArrayAsVector< T >::UpperBound ( )
inline

Definition at line 144 of file stl_bids.h.

145  { return BoundBase(vector<T>::capacity( )) - 1; }
size_type BoundBase(size_type location) const
Definition: stl_bids.h:62

◆ ZeroBase()

template<class T>
size_type TArrayAsVector< T >::ZeroBase ( size_type  index) const
inline

Definition at line 147 of file stl_bids.h.

148  { return index - lowerbound; }
GLuint index
Definition: glext.h:6031
const size_type lowerbound
Definition: stl_bids.h:23

Member Data Documentation

◆ growable

template<class T>
const unsigned int TArrayAsVector< T >::growable
private

Definition at line 20 of file stl_bids.h.

◆ lowerbound

template<class T>
const size_type TArrayAsVector< T >::lowerbound
private

Definition at line 23 of file stl_bids.h.


The documentation for this class was generated from the following file: