#include <qmemarray.h>
To aid porting of Qt programs to FOX.
Note that the following are not quite the same:
Public Types | |
typedef type * | Iterator |
typedef const type * | ConstIterator |
typedef type | ValueType |
Public Member Functions | |
QMemArray () | |
QMemArray (FXuval size) | |
QMemArray (type *a, uint n, bool _noDeleteExtArray=true) | |
QMemArray (const QMemArray< type > &o) | |
QMemArray< type > & | operator= (const QMemArray< type > &o) |
type * | data () const |
operator const type * () const | |
uint | size () const |
uint | count () const |
bool | isEmpty () const |
bool | isNull () const |
bool | resize (uint size) |
bool | resize (uint size, QGArray::Optimization optim) |
bool | truncate (uint pos) |
void | swap (QMemArray< type > &o) |
bool | fill (const type &val, int newsize=-1) |
FXDEPRECATEDEXT void | detach () |
FXDEPRECATEDEXT QMemArray< type > | copy () const |
FXDEPRECATEDEXT QMemArray< type > & | assign (const QMemArray< type > &o) |
FXDEPRECATEDEXT QMemArray< type > & | assign (const type *a, uint n) |
FXDEPRECATEDEXT QMemArray< type > & | duplicate (const QMemArray< type > &o) |
FXDEPRECATEDEXT QMemArray< type > & | duplicate (const type *a, uint n) |
QMemArray< type > & | setRawData (const type *a, uint n, bool _noDeleteExtArray=false) |
void | resetRawData (const type *a, uint n) |
int | find (const type &val, uint i=0) const |
int | contains (const type &val) const |
void | sort () |
int | bsearch (const type &val) const |
type & | at (uint i) const |
type & | operator[] (uint i) const |
type & | operator[] (int i) const |
bool | operator== (const QMemArray< type > &o) const |
bool | operator!= (const QMemArray< type > &o) const |
Iterator | begin () |
Iterator | end () |
ConstIterator | begin () const |
ConstIterator | end () const |
void | push_back (const type &v) |
void | append (const type &v) |
FX::QMemArray< type >::QMemArray | ( | ) | [inline] |
Constructs an empty array of type.
FX::QMemArray< type >::QMemArray | ( | FXuval | size | ) | [inline] |
Constructs an array of type size long.
FX::QMemArray< type >::QMemArray | ( | type * | a, | |
uint | n, | |||
bool | _noDeleteExtArray = true | |||
) | [inline] |
Constructs an array using an external array.
type* FX::QMemArray< type >::data | ( | ) | const [inline] |
Returns a pointer to the array.
Referenced by FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::begin(), FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::end(), FX::TnFXGraph::ReduceE(), FX::TnFXGraph::ReduceE2x(), and FX::TnFXGraph::ReduceE2y().
uint FX::QMemArray< type >::size | ( | ) | const [inline] |
Returns the number of elements in the array.
Referenced by FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::bsearch(), FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::contains(), FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::end(), FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::fill(), and FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::find().
bool FX::QMemArray< type >::isEmpty | ( | ) | const [inline] |
Returns true if the array is empty.
bool FX::QMemArray< type >::isNull | ( | ) | const [inline] |
Returns true if the array is empty.
Referenced by FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::isEmpty().
bool FX::QMemArray< type >::resize | ( | uint | size | ) | [inline] |
Resizes the array.
Referenced by FX::TnFXGraph::Expand(), FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::fill(), FX::TnFXGraph::ReduceE(), FX::TnFXGraph::ReduceE2x(), FX::TnFXGraph::ReduceE2y(), and FX::TnFXGraph::ReduceZ().
void FX::QMemArray< type >::swap | ( | QMemArray< type > & | o | ) | [inline] |
Swaps the contents of two arrays.
bool FX::QMemArray< type >::fill | ( | const type & | val, | |
int | newsize = -1 | |||
) | [inline] |
Fills the array with value val.
FXDEPRECATEDEXT void FX::QMemArray< type >::detach | ( | ) | [inline] |
FXDEPRECATEDEXT QMemArray<type> FX::QMemArray< type >::copy | ( | ) | const [inline] |
FXDEPRECATEDEXT QMemArray<type>& FX::QMemArray< type >::assign | ( | const QMemArray< type > & | o | ) | [inline] |
FXDEPRECATEDEXT QMemArray<type>& FX::QMemArray< type >::duplicate | ( | const QMemArray< type > & | o | ) | [inline] |
QMemArray<type>& FX::QMemArray< type >::setRawData | ( | const type * | a, | |
uint | n, | |||
bool | _noDeleteExtArray = false | |||
) | [inline] |
Sets QMemArray<> to use an external array. Note that not all methods are implemented for this (see the header file). Note also that like Qt's version, you must not resize or reassign the array when in this state. Failure to call resetRawData() before destruction causes delete
on the data unless you set _noDeleteExtArray.
void FX::QMemArray< type >::resetRawData | ( | const type * | a, | |
uint | n | |||
) | [inline] |
Resets QMemArray<> to use its internally managed data.
int FX::QMemArray< type >::find | ( | const type & | val, | |
uint | i = 0 | |||
) | const [inline] |
Returns the index of val starting the search from i, returning -1 if not found.
int FX::QMemArray< type >::contains | ( | const type & | val | ) | const [inline] |
Returns the number of times val is in the array.
void FX::QMemArray< type >::sort | ( | ) | [inline] |
Sorts the array into numerical order.
int FX::QMemArray< type >::bsearch | ( | const type & | val | ) | const [inline] |
Performs a binary search to find an item (needs a numerically sorted array), returning -1 if not found.
type& FX::QMemArray< type >::at | ( | uint | i | ) | const [inline] |
Returns a reference to the element at index i in the array.
Referenced by FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::bsearch(), FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::contains(), FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::fill(), and FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::find().
Iterator FX::QMemArray< type >::begin | ( | ) | [inline] |
Returns an iterator pointing to the first element.
Iterator FX::QMemArray< type >::end | ( | ) | [inline] |
Returns an iterator pointing one past the last element.
ConstIterator FX::QMemArray< type >::begin | ( | ) | const [inline] |
Returns a const iterator pointint to the first element.
ConstIterator FX::QMemArray< type >::end | ( | ) | const [inline] |
Returns a const iterator pointing one past the last element.
void FX::QMemArray< type >::push_back | ( | const type & | v | ) | [inline] |
Appends an item onto the end.