8 #include <mix/SortedAr.H>
20 template <
class AnyType>
27 ObjectsAr (
unsigned quant = DEFAULT_QUANT,
28 unsigned volume = START_VOLUME)
29 :
SortedAr(
sizeof(AnyType), quant, volume) {};
31 for(
register int i=0;i<count();i++)
34 virtual AnyType& fetch (
unsigned i)
35 {
return *(AnyType*)item_ptr(i);};
36 virtual AnyType
get (
unsigned i)
const
37 {
return *(AnyType*)item_ptr(i);};
39 virtual void insert (
unsigned i,
const AnyType& val)
40 {SortedAr::insert(i, (
const char*)&val);};
42 virtual void addh(
const AnyType& val) {SortedAr::addh((
const char*)&val);};
43 virtual void addl(
const AnyType& val) {SortedAr::addl((
const char*)&val);};
49 {SortedAr::assign(pArray);
return *
this;};
52 AnyType& operator[] (
unsigned i)
54 AnyType operator() (
unsigned i)
const
57 {
return assign(pArray);};
61 virtual Compar compare (
const char* item1,
const char* item2)
const
65 int find_ascent (AnyType& item)
const
66 {
return quick_find_ascent((
const char*)&item);}
67 int find_descent (AnyType& item)
const
68 {
return quick_find_descent((
const char*)&item);}
69 int find (AnyType& item)
const
70 {
return slow_find((
const char*)&item);}
Definition: SortedAr.H:14
Definition: ObjectsAr.H:21