|
|
Segment<T> templated class for weak @see Vector
A Segment<T> is a pair (T *start, length) designed to implement a weak Vector<T> (that is, one which doesn't manage its own storage)
Segment may be constructed from a length, an explicit (start,len) pair, or another Segment
Segment may only be constructed by a derived type.
Segment performs no content manipulation in its operation, nor bounds checking, but defines the predicate segEncloses for that purpose in a derived type.
| T * start |
start of segment (or (T*)0)
| int len |
length of segment (or 0)
| void set (T* t, int size=0) |
explicitly set the segment's value
| Segment () |
default constructor - NULL segment
| Segment (T &thing) |
construct a singleton Segment
| Segment (TupleBase<T> &t) |
construct a Segment conforming to a @see TupleBase
| Segment (TupleBase<T> *t) |
construct a Segment conforming to a @see TupleBase
| T * alloc (int nelem, void *allocator = (void*) |
allocate an array of T's
| void dealloc () |
Deallocate storage pointed at by Segment
| Segment (T *_start, int _len) |
construct a Segment from an address/len pair
| Segment (const Segment<T> &seg, int _len = 0, int offset = 0) |
Copy Constructor: construct a prefix sub-Segment of another Segment
| Segment<T> operator= (const Segment<T> &location) |
Segment assignment
| Segment * operator+= (int advance) |
advance lower edge of Segment by amount
| Segment * operator++ (int) |
advance lower edge of Segment by 1
| int search (const T* what, int whatlen, int offset = 0) |
find occurrence in Segment
| int search (const T &what, int offset = 0) |
find occurrence in Segment
| int search (const T *what, int offset = 0) |
find occurrence in Segment
| int search (const Segment<T> &what, int offset = 0) |
find occurrence in Segment
| int search (const Segment<T>* what, int offset = 0) |
find occurrence in Segment
| T & operator[] (int offset) |
Segment array accessor
| const T & const_element (int index) |
return in-bounds const element
| T & element (int index) |
return in-bounds const element
| int Length () |
Segment length
| T* content () |
Segment content
| operator T* () |
Segment to basetype conversion
| T * segFirst () |
pointer to start of Segment
| const T & first () |
ref to first in Segment
| T * segLast () |
pointer to end of Segment
| const T & last () |
ref to last in Segment
| bool segEncloses (const T * const _start, int _len) |
Predicate: Segment encloses a given range
| bool segEncloses (Segment<T> const &seg) |
Predicate: Segment encloses another segment
| int in (T *t, int tlen = 0) |
return the offset of T *t in content
| bool empty () |
predicate: Segment is empty
| operator bool () |
predicate: Segment is empty
| Segment<T> * qsort () |
qsort Segment contents
| Segment<T> * reverse () |
reverse Vector
| bool tsearch (const T &key, int &idx) |
bsearch sorted Vector
| bool isMember (const T &d) |
Predicate: is an element a member of the set?
| int endRelative (int where) |
argument range modifier
| T * dup (T* to, const T* from, int range) |
duplicate a range of basetype
| Generated by: colin@sharedtech.dhis.org on Sat Nov 6 11:59:24 199. |