quick start:g++ [flags ...] file ... #include <Vector.h> Vector(long length = DEF_LENGTH); boolean assign(const Vector<TObject>& copy_vector); boolean shift(long delta); boolean apply(boolean (TObject::*method)());
description:// declare a character Vector of length 5 // Vector<Char> val0(5); // assign all the elements to be 'a' // Char item(L'a'); val0.assign(item); // check that each element is 'a' // for (long i = 0; i < 5; i++) { if (val0(i).ne(item)) { // error } }
static const SysString CLASS_NAME = L"Vector";
static const SysString DEF_PARAM = L"values";
static const SysString BLOCK_START_STR = L"{";
static const SysString BLOCK_DELIM_STR = L"}, {";
static const SysString BLOCK_END_STR = L"}";
static const SysString BLOCK_TERM_STR = L";\n";
static const long static const long SKIP_TABLE_FREQUENCY = 1000;
static const long static const long SKIP_TABLE_SKIP = 100;
static const long SKIP_TABLE_SIZE = sizeof(int32) * (SKIP_TABLE_FREQUENCY / SKIP_TABLE_SKIP);
static const long TEXT_WRITE_SIZE = 512;
static const long DEF_LENGTH = 0; static const long DEF_END_POS = -1;
static const long ERR = 40900;
static const long ERR_WMODE = 40901;
TObject* v_d;
Long length_d;
Long capacity_d;
boolean write_partial_d;
long end_pos_d;
long len_pos_d;
static Integral::DEBUG debug_level_d;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
static boolean setDebug(Integral::DEBUG debug_level);
boolean debug(const unichar* message) const;
~Vector();
Vector(long length = DEF_LENGTH);
Vector(const Vector<TObject>& copy_Vector);
boolean assign(const Vector<TObject>& copy_Vector);
Vector<TObject>& operator=(const Vector& arg);
boolean eq(const Vector<TObject>& compare_Vector) const;
long sofSize() const;
boolean read(Sof& sof_a, long tag_a);
boolean write(Sof& sof_a, long tag_a) const;
boolean read(Sof& sof_a, long tag_a, const String& name_a);
boolean write(Sof& sof_a, long tag_a, const String& name_a) const;
boolean readData(Sof& sof, const String& pname,long size = SofParser::FULL_OBJECT, boolean param_a = true, boolean nested_a = false);
boolean writeData(Sof& sof, const String& pname) const;
static void* operator new(size_t size);
static void* operator new[](size_t size);
static void operator delete(void* ptr);
static void operator delete[](void* ptr);
static boolean setGrowSize(long grow_size);
boolean clear();
boolean assign(TObject& arg);
boolean ne(const Vector<TObject>& compare_Vector) const;
boolean readStart(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = true);
boolean readPartialData(Sof& sof, long start_pos, long num_elem, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean readTerminate(Sof& sof);
long writeStart(Sof& sof, const String& pname = DEF_PARAM);
boolean writePartialData(Sof& sof, long start_pos, long num_elem);
boolean writeTerminate(Sof& sof, const String& pname = DEF_PARAM);
TObject& operator()(long index_a);
const TObject& operator()(long index_a) const;
long length() const;
long getCapacity() const;
long getVectorSize(long offset_a, Sof& sof_a);
long getVectorSize(Sof& sof, long tag, const String& name = name(), const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = true);
boolean setLength(long length, boolean preserve_values = true);
boolean setCapacity(long capacity, boolean preserve_values = true);
boolean move(const Vector<TObject>& source_vector, long num_elements, long source_offset, long dest_offset);
boolean shift(const Vector<TObject>& source_vector, long delta);
boolean shift(long delta);
boolean concat(const Vector<TObject>& v2);
boolean concat(const Vector<TObject>& v1, Vector<TObject>& v2);
boolean concat(const TObject& obj);
boolean deleteRange(const Vector<TObject> arg, long offset, long num_elements);
boolean deleteRange(long offset, long num_elements);
boolean setRange(long offset, long num_elements, const TObject& value);
boolean sort(Integral::ORDER sort_order = Integral::ASCENDING, SORT_ALGO = DEF_SORT_ALGO);
long first(const TObject& value, long start_pos = Integral::NO_POS) const;
long last(const TObject& value, long end_pos = Integral::NO_POS) const;
boolean contains(long& index, const TObject* value) const;
boolean contains(const TObject* value) const;
boolean apply(boolean (TObject::*method)(), Vector<TObject>& arg);
boolean apply(boolean (TObject::*method)());
boolean randQuickSort(Integral::ORDER sort_order);
boolean insertionSort(Integral::ORDER sort_order);
friend class VectorDiagnose;examples:
#include <Char.h> #include <Vector.h> int main () { // prepare items for the Vector // Char item(L'a'); // declare a Vector and assign all the items to be 'a' // Vector<Char> char_vector(5); char_vector.assign(item); if((!(char_vector.length() != (long)5)) || (char_vector(0).ne(item))) { // exit // Integral::exit(); } // copy the Vector // Vector<Char> copy_char_vector(char_vector); // see if these Vectors are equivalent // if(!char_vector.eq(copy_char_vector)) { // exit // Integral::exit(); } // exit gracefully // Integral::exit(); }