class Segment

Segment<T> templated class for weak @see Vector More...

Definition#include <Segment.hh>
Template formSegment<class T>
Inherited byVector
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Members

Protected Members


Detailed Description

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
[protected]

start of segment (or (T*)0)

int len
[protected]

length of segment (or 0)

void set (T* t, int size=0)
[protected]

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*)
[static]

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)
[const]

find occurrence in Segment

int search (const T &what, int offset = 0)
[const]

find occurrence in Segment

int search (const T *what, int offset = 0)
[const]

find occurrence in Segment

int search (const Segment<T> &what, int offset = 0)
[const]

find occurrence in Segment

int search (const Segment<T>* what, int offset = 0)
[const]

find occurrence in Segment

T & operator[] (int offset)
[const]

Segment array accessor

const T & const_element (int index)
[const]

return in-bounds const element

T & element (int index)
[const]

return in-bounds const element

int Length ()
[const]

Segment length

T* content ()
[const]

Segment content

operator T* ()
[const]

Segment to basetype conversion

T * segFirst ()
[const]

pointer to start of Segment

const T & first ()
[const]

ref to first in Segment

T * segLast ()
[const]

pointer to end of Segment

const T & last ()
[const]

ref to last in Segment

bool segEncloses (const T * const _start, int _len)
[const]

Predicate: Segment encloses a given range

bool segEncloses (Segment<T> const &seg)
[const]

Predicate: Segment encloses another segment

int in (T *t, int tlen = 0)
[const]

return the offset of T *t in content

bool empty ()
[const]

predicate: Segment is empty

operator bool ()
[const]

predicate: Segment is empty

Segment<T> * qsort ()

qsort Segment contents

Segment<T> * reverse ()

reverse Vector

bool tsearch (const T &key, int &idx)
[const]

bsearch sorted Vector

bool isMember (const T &d)

Predicate: is an element a member of the set?

int endRelative (int where)
[protected const]

argument range modifier

T * dup (T* to, const T* from, int range)
[protected]

duplicate a range of basetype


Generated by: colin@sharedtech.dhis.org on Sat Nov 6 11:59:24 199.