Public Types | Public Member Functions | Protected Member Functions | List of all members
QArray< type > Class Template Reference

#include <qarray.h>

Inheritance diagram for QArray< type >:
QGArray

Public Types

typedef typeIterator
 
typedef const typeConstIterator
 
typedef type ValueType
 

Public Member Functions

 QArray ()
 
 QArray (int size)
 
 QArray (const QArray< type > &a)
 
 ~QArray ()
 
QArray< type > & operator= (const QArray< type > &a)
 
typedata () const
 
uint nrefs () const
 
uint size () const
 
uint count () const
 
bool isEmpty () const
 
bool isNull () const
 
bool resize (uint size)
 
bool truncate (uint pos)
 
bool fill (const type &d, int size=-1)
 
void detach ()
 
QArray< typecopy () const
 
QArray< type > & assign (const QArray< type > &a)
 
QArray< type > & assign (const type *a, uint n)
 
QArray< type > & duplicate (const QArray< type > &a)
 
QArray< type > & duplicate (const type *a, uint n)
 
QArray< type > & setRawData (const type *a, uint n)
 
void resetRawData (const type *a, uint n)
 
int find (const type &d, uint i=0) const
 
int contains (const type &d) const
 
void sort ()
 
int bsearch (const type &d) const
 
typeoperator[] (int i) const
 
typeat (uint i) const
 
 operator const type * () const
 
bool operator== (const QArray< type > &a) const
 
bool operator!= (const QArray< type > &a) const
 
Iterator begin ()
 
Iterator end ()
 
ConstIterator begin () const
 
ConstIterator end () const
 
- Public Member Functions inherited from QGArray
 QGArray ()
 

Protected Member Functions

 QArray (int, int)
 
- Protected Member Functions inherited from QGArray
 QGArray (int, int)
 
 QGArray (int size)
 
 QGArray (const QGArray &a)
 
virtual ~QGArray ()
 
QGArrayoperator= (const QGArray &a)
 
char * data () const
 
uint nrefs () const
 
uint size () const
 
bool isEqual (const QGArray &a) const
 
bool resize (uint newsize)
 
bool fill (const char *d, int len, uint sz)
 
QGArrayassign (const QGArray &a)
 
QGArrayassign (const char *d, uint len)
 
QGArrayduplicate (const QGArray &a)
 
QGArrayduplicate (const char *d, uint len)
 
void store (const char *d, uint len)
 
array_datasharedBlock () const
 
void setSharedBlock (array_data *p)
 
QGArraysetRawData (const char *d, uint len)
 
void resetRawData (const char *d, uint len)
 
int find (const char *d, uint index, uint sz) const
 
int contains (const char *d, uint sz) const
 
void sort (uint sz)
 
int bsearch (const char *d, uint sz) const
 
char * at (uint index) const
 
bool setExpand (uint index, const char *d, uint sz)
 
virtual array_datanewData ()
 
virtual void deleteData (array_data *p)
 

Detailed Description

template<class type>
class QArray< type >

Definition at line 46 of file qarray.h.

Member Typedef Documentation

template<class type>
typedef const type* QArray< type >::ConstIterator

Definition at line 50 of file qarray.h.

template<class type>
typedef type* QArray< type >::Iterator

Definition at line 49 of file qarray.h.

template<class type>
typedef type QArray< type >::ValueType

Definition at line 51 of file qarray.h.

Constructor & Destructor Documentation

template<class type>
QArray< type >::QArray ( int  ,
int   
)
inlineprotected

Definition at line 54 of file qarray.h.

54 : QGArray( 0, 0 ) {}
QGArray()
Definition: qgarray.cpp:89
template<class type>
QArray< type >::QArray ( )
inline

Definition at line 57 of file qarray.h.

57 {}
template<class type>
QArray< type >::QArray ( int  size)
inline

Definition at line 58 of file qarray.h.

58 : QGArray(size*(int)sizeof(type)) {}
QGArray()
Definition: qgarray.cpp:89
uint size() const
Definition: qarray.h:65
template<class type>
QArray< type >::QArray ( const QArray< type > &  a)
inline

Definition at line 59 of file qarray.h.

59 : QGArray(a) {}
QGArray()
Definition: qgarray.cpp:89
template<class type>
QArray< type >::~QArray ( )
inline

Definition at line 60 of file qarray.h.

60 {}

Member Function Documentation

template<class type>
QArray<type>& QArray< type >::assign ( const QArray< type > &  a)
inline

Definition at line 76 of file qarray.h.

77  { return (QArray<type>&)QGArray::assign(a); }
Definition: qarray.h:46
QGArray & assign(const QGArray &a)
Definition: qgarray.cpp:284
template<class type>
QArray<type>& QArray< type >::assign ( const type a,
uint  n 
)
inline

Definition at line 78 of file qarray.h.

79  { return (QArray<type>&)QGArray::assign((char*)a,n*sizeof(type)); }
Definition: qarray.h:46
std::void_t< T > n
QGArray & assign(const QGArray &a)
Definition: qgarray.cpp:284
template<class type>
type& QArray< type >::at ( uint  i) const
inline

Definition at line 98 of file qarray.h.

99  { return (type &)(*(type *)QGArray::at(i*(int)sizeof(type))); }
char * at(uint index) const
Definition: qgarray.h:108
static QCString type
Definition: declinfo.cpp:672
template<class type>
Iterator QArray< type >::begin ( )
inline

Definition at line 103 of file qarray.h.

103 { return data(); }
type * data() const
Definition: qarray.h:63
template<class type>
ConstIterator QArray< type >::begin ( ) const
inline

Definition at line 105 of file qarray.h.

105 { return data(); }
type * data() const
Definition: qarray.h:63
template<class type>
int QArray< type >::bsearch ( const type d) const
inline

Definition at line 94 of file qarray.h.

95  { return QGArray::bsearch((const char*)&d,sizeof(type)); }
int bsearch(const char *d, uint sz) const
Definition: qgarray.cpp:667
template<class type>
int QArray< type >::contains ( const type d) const
inline

Definition at line 91 of file qarray.h.

92  { return QGArray::contains((char*)&d,sizeof(type)); }
int contains(const char *d, uint sz) const
Definition: qgarray.cpp:584
template<class type>
QArray<type> QArray< type >::copy ( ) const
inline

Definition at line 74 of file qarray.h.

75  { QArray<type> tmp; return tmp.duplicate(*this); }
QArray< type > & duplicate(const QArray< type > &a)
Definition: qarray.h:80
Definition: qarray.h:46
string tmp
Definition: languages.py:63
template<class type>
uint QArray< type >::count ( ) const
inline

Definition at line 66 of file qarray.h.

66 { return size(); }
uint size() const
Definition: qarray.h:65
template<class type>
type* QArray< type >::data ( ) const
inline

Definition at line 63 of file qarray.h.

63 { return (type *)QGArray::data(); }
char * data() const
Definition: qgarray.h:67
template<class type>
void QArray< type >::detach ( )
inlinevirtual

Reimplemented from QGArray.

Definition at line 73 of file qarray.h.

73 { QGArray::detach(); }
virtual void detach()
Definition: qgarray.h:65
template<class type>
QArray<type>& QArray< type >::duplicate ( const QArray< type > &  a)
inline

Definition at line 80 of file qarray.h.

81  { return (QArray<type>&)QGArray::duplicate(a); }
Definition: qarray.h:46
QGArray & duplicate(const QGArray &a)
Definition: qgarray.cpp:327
template<class type>
QArray<type>& QArray< type >::duplicate ( const type a,
uint  n 
)
inline

Definition at line 82 of file qarray.h.

83  { return (QArray<type>&)QGArray::duplicate((char*)a,n*sizeof(type)); }
Definition: qarray.h:46
std::void_t< T > n
QGArray & duplicate(const QGArray &a)
Definition: qgarray.cpp:327
template<class type>
Iterator QArray< type >::end ( )
inline

Definition at line 104 of file qarray.h.

104 { return data() + size(); }
type * data() const
Definition: qarray.h:63
uint size() const
Definition: qarray.h:65
template<class type>
ConstIterator QArray< type >::end ( ) const
inline

Definition at line 106 of file qarray.h.

106 { return data() + size(); }
type * data() const
Definition: qarray.h:63
uint size() const
Definition: qarray.h:65
template<class type>
bool QArray< type >::fill ( const type d,
int  size = -1 
)
inline

Definition at line 71 of file qarray.h.

72  { return QGArray::fill((char*)&d,size,sizeof(type) ); }
bool fill(const char *d, int len, uint sz)
Definition: qgarray.cpp:249
uint size() const
Definition: qarray.h:65
template<class type>
int QArray< type >::find ( const type d,
uint  i = 0 
) const
inline

Definition at line 89 of file qarray.h.

90  { return QGArray::find((char*)&d,i,sizeof(type)); }
int find(const char *d, uint index, uint sz) const
Definition: qgarray.cpp:522
template<class type>
bool QArray< type >::isEmpty ( ) const
inline

Definition at line 67 of file qarray.h.

67 { return QGArray::size() == 0; }
uint size() const
Definition: qgarray.h:69
template<class type>
bool QArray< type >::isNull ( ) const
inline

Definition at line 68 of file qarray.h.

68 { return QGArray::data() == 0; }
char * data() const
Definition: qgarray.h:67
template<class type>
uint QArray< type >::nrefs ( ) const
inline

Definition at line 64 of file qarray.h.

64 { return QGArray::nrefs(); }
uint nrefs() const
Definition: qgarray.h:68
template<class type>
QArray< type >::operator const type * ( ) const
inline

Definition at line 100 of file qarray.h.

100 { return (const type *)QGArray::data(); }
char * data() const
Definition: qgarray.h:67
template<class type>
bool QArray< type >::operator!= ( const QArray< type > &  a) const
inline

Definition at line 102 of file qarray.h.

102 { return !isEqual(a); }
bool isEqual(const QGArray &a) const
Definition: qgarray.cpp:194
template<class type>
QArray<type>& QArray< type >::operator= ( const QArray< type > &  a)
inline

Definition at line 61 of file qarray.h.

62  { return (QArray<type>&)QGArray::assign(a); }
Definition: qarray.h:46
QGArray & assign(const QGArray &a)
Definition: qgarray.cpp:284
template<class type>
bool QArray< type >::operator== ( const QArray< type > &  a) const
inline

Definition at line 101 of file qarray.h.

101 { return isEqual(a); }
bool isEqual(const QGArray &a) const
Definition: qgarray.cpp:194
template<class type>
type& QArray< type >::operator[] ( int  i) const
inline

Definition at line 96 of file qarray.h.

97  { return (type &)(*(type *)QGArray::at(i*(int)sizeof(type))); }
char * at(uint index) const
Definition: qgarray.h:108
static QCString type
Definition: declinfo.cpp:672
template<class type>
void QArray< type >::resetRawData ( const type a,
uint  n 
)
inline

Definition at line 87 of file qarray.h.

88  { QGArray::resetRawData((char*)a,n*sizeof(type)); }
void resetRawData(const char *d, uint len)
Definition: qgarray.cpp:499
std::void_t< T > n
template<class type>
bool QArray< type >::resize ( uint  size)
inline

Definition at line 69 of file qarray.h.

69 { return QGArray::resize(size*(int)sizeof(type)); }
bool resize(uint newsize)
Definition: qgarray.cpp:209
uint size() const
Definition: qarray.h:65
template<class type>
QArray<type>& QArray< type >::setRawData ( const type a,
uint  n 
)
inline

Definition at line 84 of file qarray.h.

85  { return (QArray<type>&)QGArray::setRawData((char*)a,
86  n*sizeof(type)); }
Definition: qarray.h:46
std::void_t< T > n
QGArray & setRawData(const char *d, uint len)
Definition: qgarray.cpp:483
template<class type>
uint QArray< type >::size ( ) const
inline

Definition at line 65 of file qarray.h.

65 { return QGArray::size()/(int)sizeof(type); }
uint size() const
Definition: qgarray.h:69
template<class type>
void QArray< type >::sort ( )
inline

Definition at line 93 of file qarray.h.

93 { QGArray::sort(sizeof(type)); }
void sort(uint sz)
Definition: qgarray.cpp:652
template<class type>
bool QArray< type >::truncate ( uint  pos)
inline

Definition at line 70 of file qarray.h.

70 { return QGArray::resize(pos*(int)sizeof(type)); }
bool resize(uint newsize)
Definition: qgarray.cpp:209

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