45 #define USE_MALLOC // comment to use new/delete 50 #if defined(USE_MALLOC) 51 #define NEW(type,size) ((type*)malloc(size*sizeof(type))) 52 #define DELETE(array) (free((char*)array)) 54 #define NEW(type,size) (new type[size]) 55 #define DELETE(array) (delete[] array) 56 #define DONT_USE_REALLOC // comment to use realloc() 115 #ifndef QT_NO_DATASTREAM 144 #endif // QT_NO_DATASTREAM 248 #if defined(CHECK_RANGE) 249 if ( index >=
len ) {
250 qWarning(
"QGVector::insert: Index %d out of range", index );
275 #if defined(CHECK_RANGE) 276 if ( index >=
len ) {
277 qWarning(
"QGVector::remove: Index %d out of range", index );
295 #if defined(CHECK_RANGE) 296 if ( index >=
len ) {
297 qWarning(
"QGVector::take: Index %d out of range", index );
332 if ( newsize ==
len )
335 if ( newsize <
len ) {
345 if ( newsize == 0 ) {
351 #if defined(DONT_USE_REALLOC) 353 memcpy( newvec,
vec, (
len < newsize ?
len : newsize)*
sizeof(
Item) );
367 memset( (
void*)&
vec[
len], 0, (newsize-len)*
sizeof(
Item) );
381 else if ( !
resize( flen ) )
392 #if defined(Q_C_CALLBACKS) 396 static int cmp_vec(
const void *n1,
const void *n2 )
401 #if defined(Q_C_CALLBACKS) 414 register Item *start = &
vec[0];
418 while ( start < end && *start != 0 )
420 while ( end > start && *end == 0 )
444 #if defined(CHECK_NULL) 445 qWarning(
"QGVector::bsearch: Cannot search for null object" );
484 #if defined(CHECK_RANGE) 486 qWarning(
"QGVector::findRef: Index %d out of range",
index );
503 #if defined(CHECK_RANGE) 510 if (
vec[i] == 0 &&
d == 0 )
540 if (
vec[i] == 0 &&
d == 0 )
555 if ( index >=
len ) {
573 list->append(
vec[i] );
580 #if defined(CHECK_RANGE) 581 qWarning(
"QGVector::operator[]: Index %d out of range", i );
591 #ifndef QT_NO_DATASTREAM 594 return vec.
read( s );
599 return vec.
write( s );
638 #endif // QT_NO_DATASTREAM
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
virtual Item newItem(Item)
int findRef(Item, uint index) const
bool fill(Item, int flen)
static QGVector * sort_vec
void qWarning(const char *msg,...)
int find(Item, uint index) const
bool insert(uint index, Item)
uint containsRef(Item) const
bool resize(uint newsize)
QDataStream & operator<<(QDataStream &s, const QGVector &vec)
The QGList class is an internal class for implementing Qt collection classes.
The QCollection class is the base class of all Qt collections.
bool insertExpand(uint index, Item)
static int cmp_vec(const void *n1, const void *n2)
The QGVector class is an internal class for implementing Qt collection classes.
QDataStream & read(QDataStream &)
QDataStream & write(QDataStream &) const
QGVector & operator=(const QGVector &v)
virtual int compareItems(Item, Item)
uint contains(Item) const
The QDataStream class provides serialization of binary data to a QIODevice.
void toList(QGList *) const
virtual void deleteItem(Item)
QDataStream & operator>>(QDataStream &s, QGVector &vec)
static void warningIndexRange(uint)