49 typedef type* Iterator;
50 typedef const type* ConstIterator;
51 typedef type ValueType;
63 type *data()
const {
return (type *)QGArray::data(); }
64 uint nrefs()
const {
return QGArray::nrefs(); }
65 uint size()
const {
return QGArray::size()/(int)
sizeof(type); }
66 uint count()
const {
return size(); }
67 bool isEmpty()
const {
return QGArray::size() == 0; }
68 bool isNull()
const {
return QGArray::data() == 0; }
69 bool resize( uint size ) {
return QGArray::resize(size*(
int)
sizeof(type)); }
70 bool truncate( uint pos ) {
return QGArray::resize(pos*(
int)
sizeof(type)); }
71 bool fill(
const type &d,
int size = -1 )
72 {
return QGArray::fill((
char*)&d,size,
sizeof(type) ); }
73 void detach() { QGArray::detach(); }
79 {
return (
QArray<type>&)QGArray::assign((
char*)a,n*
sizeof(type)); }
83 {
return (
QArray<type>&)QGArray::duplicate((
char*)a,n*
sizeof(type)); }
87 void resetRawData(
const type *a, uint n )
88 { QGArray::resetRawData((
char*)a,n*
sizeof(type)); }
89 int find(
const type &d, uint i=0 )
const 90 {
return QGArray::find((
char*)&d,i,
sizeof(type)); }
91 int contains(
const type &d )
const 92 {
return QGArray::contains((
char*)&d,
sizeof(type)); }
93 void sort() { QGArray::sort(
sizeof(type)); }
94 int bsearch(
const type &d )
const 95 {
return QGArray::bsearch((
const char*)&d,
sizeof(type)); }
96 type& operator[](
int i )
const 97 {
return (type &)(*(type *)QGArray::at(i*(
int)
sizeof(type))); }
98 type& at( uint i )
const 99 {
return (type &)(*(type *)QGArray::at(i*(
int)
sizeof(type))); }
100 operator const type*()
const {
return (
const type *)QGArray::data(); }
101 bool operator==(
const QArray<type> &a )
const {
return isEqual(a); }
102 bool operator!=(
const QArray<type> &a )
const {
return !isEqual(a); }
103 Iterator begin() {
return data(); }
104 Iterator end() {
return data() + size(); }
105 ConstIterator begin()
const {
return data(); }
106 ConstIterator end()
const {
return data() + size(); }
The QGArray class is an internal class for implementing the QArray class.
Definition: qgarray.h:46