FX::QMemArray< type > Class Template Reference
[Qt Template Library]

#include <qmemarray.h>

Inheritance diagram for FX::QMemArray< type >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<typename type>
class FX::QMemArray< type >

A thunk of Qt's QMemArray to the STL.

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)

Constructor & Destructor Documentation

template<typename type>
FX::QMemArray< type >::QMemArray (  )  [inline]

Constructs an empty array of type.

template<typename type>
FX::QMemArray< type >::QMemArray ( FXuval  size  )  [inline]

Constructs an array of type size long.

template<typename type>
FX::QMemArray< type >::QMemArray ( type *  a,
uint  n,
bool  _noDeleteExtArray = true 
) [inline]

Constructs an array using an external array.


Member Function Documentation

template<typename type>
type* FX::QMemArray< type >::data (  )  const [inline]

template<typename type>
uint FX::QMemArray< type >::size (  )  const [inline]

template<typename type>
bool FX::QMemArray< type >::isEmpty (  )  const [inline]

Returns true if the array is empty.

template<typename type>
bool FX::QMemArray< type >::isNull (  )  const [inline]

Returns true if the array is empty.

Referenced by FX::QMemArray< FX::FXCodeToPythonCode::CodeItem >::isEmpty().

template<typename type>
bool FX::QMemArray< type >::resize ( uint  size  )  [inline]

template<typename type>
void FX::QMemArray< type >::swap ( QMemArray< type > &  o  )  [inline]

Swaps the contents of two arrays.

template<typename type>
bool FX::QMemArray< type >::fill ( const type &  val,
int  newsize = -1 
) [inline]

Fills the array with value val.

template<typename type>
FXDEPRECATEDEXT void FX::QMemArray< type >::detach (  )  [inline]

Deprecated:
For Qt compatibility only

template<typename type>
FXDEPRECATEDEXT QMemArray<type> FX::QMemArray< type >::copy (  )  const [inline]

Deprecated:
For Qt compatibility only

template<typename type>
FXDEPRECATEDEXT QMemArray<type>& FX::QMemArray< type >::assign ( const QMemArray< type > &  o  )  [inline]

Deprecated:
For Qt compatibility only

template<typename type>
FXDEPRECATEDEXT QMemArray<type>& FX::QMemArray< type >::duplicate ( const QMemArray< type > &  o  )  [inline]

Deprecated:
For Qt compatibility only

template<typename type>
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.

template<typename type>
void FX::QMemArray< type >::resetRawData ( const type *  a,
uint  n 
) [inline]

Resets QMemArray<> to use its internally managed data.

template<typename type>
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.

template<typename type>
int FX::QMemArray< type >::contains ( const type &  val  )  const [inline]

Returns the number of times val is in the array.

template<typename type>
void FX::QMemArray< type >::sort (  )  [inline]

Sorts the array into numerical order.

template<typename type>
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.

template<typename type>
type& FX::QMemArray< type >::at ( uint  i  )  const [inline]

template<typename type>
Iterator FX::QMemArray< type >::begin (  )  [inline]

Returns an iterator pointing to the first element.

template<typename type>
Iterator FX::QMemArray< type >::end (  )  [inline]

Returns an iterator pointing one past the last element.

template<typename type>
ConstIterator FX::QMemArray< type >::begin (  )  const [inline]

Returns a const iterator pointint to the first element.

template<typename type>
ConstIterator FX::QMemArray< type >::end (  )  const [inline]

Returns a const iterator pointing one past the last element.

template<typename type>
void FX::QMemArray< type >::push_back ( const type &  v  )  [inline]

Appends an item onto the end.


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

(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 22:28:13 2008 for TnFOX by doxygen v1.5.6