ReactOS 0.4.15-dev-7660-g0086d05
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.

40 return 0;
41 else
43 return 1; }
static ATOM item
Definition: dde.c:856
iterator insert(iterator __pos, const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
Definition: _vector.c:223

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 &&
49 return 0;
50 if(ZeroBase(index) > vector<T>::capacity( )) // out of bounds
54 else
56 return 1;
57 }
size_type ZeroBase(size_type index) const
Definition: stl_bids.h:147
GLuint index
Definition: glext.h:6031
#define T
Definition: mbstring.h:31

◆ 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

Referenced by TArrayAsVector< T >::Grow().

◆ 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

Referenced by TArrayAsVector< T >::Find(), TArrayAsVector< T >::Grow(), and TArrayAsVector< T >::UpperBound().

◆ Destroy() [1/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)); }
void Destroy(size_type index)
Definition: stl_bids.h:73
size_type Find(const T &item) const
Definition: stl_bids.h:79

◆ Destroy() [2/2]

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

Definition at line 73 of file stl_bids.h.

iterator erase(iterator __pos)
Definition: _vector.h:623

Referenced by KeyTranslator::DeleteKeyDef(), TArrayAsVector< T >::Destroy(), and TArrayAsVector< T >::Detach().

◆ Detach() [1/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)); }

◆ Detach() [2/2]

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

Definition at line 67 of file stl_bids.h.

Referenced by TArrayAsVector< T >::RemoveEntry().

◆ Find()

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

Definition at line 79 of file stl_bids.h.

82 if(location != vector<T>::end( ))
85 else
86 return INT_MAX; }
size_type BoundBase(size_type location) const
Definition: stl_bids.h:62
size_t size_type
Definition: stl_bids.h:21
vector< T >::const_iterator const_iterator
Definition: stl_bids.h:22
static TAGID TAGID find
Definition: db.cpp:155

Referenced by KeyTranslator::AddKeyDef(), KeyTranslator::DeleteKeyDef(), TArrayAsVector< T >::Destroy(), TArrayAsVector< T >::Detach(), TArrayAsVector< T >::HasMember(), 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:653

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 )
94 lowerbound));
95 else if( index >= BoundBase(vector<T>::size( )))
size_type ArraySize()
Definition: stl_bids.h:59
void Reallocate(size_type sz, size_type offset=0)
Definition: stl_bids.h:131

◆ 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; }

◆ 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;
111 return 1;
112 else
113 return 0; }

◆ LowerBound()

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

Definition at line 115 of file stl_bids.h.

116 { return lowerbound; }

◆ 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 }
const GLdouble * v
Definition: gl.h:2040
_Self & operator=(const _Self &__x)
Definition: _vector.c:182

◆ 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>::
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>::

◆ 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)
GLintptr offset
Definition: glext.h:5920

Referenced by TArrayAsVector< T >::Grow().

◆ 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

◆ 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

◆ 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; }

◆ ZeroBase()

Member Data Documentation

◆ growable

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

◆ lowerbound


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