23 #include "kmmsgbase.h"
25 #include <tqmemarray.h>
49 void remove(
unsigned int idx);
53 KMMsgBase*
take(
unsigned int idx);
57 void insert(
unsigned int idx, KMMsgBase* msg,
bool syncDict =
true);
62 unsigned int append(KMMsgBase* msg,
bool syncDict =
true);
67 void clear(
bool autoDelete=TRUE,
bool syncDict =
false);
71 bool resize(
unsigned int size);
75 bool reset(
unsigned int size);
80 void set(
unsigned int idx, KMMsgBase* msg);
83 unsigned int high()
const {
return mHigh; }
86 unsigned int count()
const {
return mCount; }
92 unsigned int mHigh, mCount;
void rethinkHigh()
Set mHigh to proper value.
void insert(unsigned int idx, KMMsgBase *msg, bool syncDict=true)
Insert message at given index.
void clear(bool autoDelete=TRUE, bool syncDict=false)
Clear messages.
KMMsgList(int initialSize=32)
Constructor with optional initial size.
unsigned int count() const
Number of messages in the array.
bool reset(unsigned int size)
Clear the array and resize it to given size.
unsigned int high() const
Returns first unused index (index of last message plus one).
KMMsgBase * take(unsigned int idx)
Returns message at given index and removes it from the list.
An abstraction of an array of pointers to messages.
unsigned int append(KMMsgBase *msg, bool syncDict=true)
Append given message after the last used message.
void set(unsigned int idx, KMMsgBase *msg)
Set message at given index.
bool resize(unsigned int size)
Resize array and initialize new elements if any.
~KMMsgList()
Destructor also deletes all messages in the list.