|
|
Refcounted Persistent Objects under the coldstore virtual protocol
Data implements the coldstore virtual protocol, which provides a set of semantic operations derived from Python's C API, sufficient to support Arithmetic, Sequence, Map, Iterator and Functional types.
| ~Data () |
destroy Data instance protected to encourage the use of RefCount::dncount() in our copy-on-write reference-counted environment
| Slot unimpl (const char *message) |
throw an `unimplemented' Error A place holder for unimplemented virtual protocol elements
Parameters:
| message | message associated with the Error |
Returns: nothing useful
| void check (int num=0) |
check an instance of Data for coherence (whatever that means to the datatype)
Parameters:
| num | number of contiguous instances in an array |
Returns: void, but could be changed to return a bool
| void * type () |
the typeID for this type - derived from rtti
| int typeOrder (const Slot &arg) |
compare types of Slots
Types are given an arbitrary but fixed order to enable Data::order between disparate types
| bool typeEQ (const Builtin *m) |
predicate: is this of that Builtin type?
| const char * typeId () |
return the name of the type of this object, using rtti
| Data * clone (void *where = (void*) |
copy constructor
Used as the destination of @see mutate when a copy on write mutable object is desired.
Parameters:
| where | the locale into which to clone this object |
Returns: mutable copy of object
| Slot identity (void *where = (void*) |
dynamic mutable copy
Used as the destination of @see mutate when the object is mutable.
Parameters:
| where | the locale into which to clone this object |
Returns: mutable copy of object
| Data * mutate (void *where = (void*) |
create a mutable copy
Depending upon whether the object is considered a mutable instance or a copy-on-write instance, vtbl magic is used to redirect this call to one of @see identity or @see clone
Parameters:
| where | the locale into which to clone this object |
Returns: mutable copy of object
| bool truth () |
the object's truth value
mapping of all objects onto true/false
Returns: the object's truth value
| Slot toconstruct () |
constructor arguments sufficient to recreate object
Returns: a primitive type (pickled) representation of this object
| ostream & dump (ostream& output) |
dump the object to a stream
Parameters:
| ostream | stream onto which to dump the object |
| Slot construct (Slot &arg) |
construct an instance of Data from the constructor args given
Parameters:
| arg | constructor arguments, derived from @see toconstruct |
Returns: instance constructed from the args
| int order (const Slot &arg) |
order two objects
Parameters:
| arg | object to be ordered relative to this |
Returns: 1,0,-1 depending on object order
| bool equal (const Slot &arg) |
equality operator
Parameters:
| arg | object to be compared to this |
Returns: true/false depending on equality
| Slot positive () |
monadic `+', absolute value
| Slot negative () |
monadic `-', negative absolute value
| Slot add (const Slot &arg) |
dyadic `+', add
| Slot subtract (const Slot &arg) |
dyadic `-', subtract
| Slot multiply (const Slot &arg) |
dyadic `*', multiply
| Slot divide (const Slot &arg) |
dyadic '/', divide
| Slot modulo (const Slot &arg) |
dyadic '%', modulo
| Slot invert () |
unary '~', invert
| Slot and (const Slot &arg) |
dyadic '&', bitwise and
| Slot xor (const Slot &arg) |
dyadic '^', bitwise xor
| Slot or (const Slot &arg) |
dyadic '|', bitwise or
| Slot lshift (const Slot &arg) |
dyadic '<<', left shift
| Slot rshift (const Slot &arg) |
dyadic '>>', right shift
| Slot toSequence () |
addressable Sequence as a List
| bool isSequence () |
predicate - is object a sequence
| int length () |
length as sequence
| Slot concat (const Slot &arg) |
concatenate two sequences
| Slot slice (const Slot &from, const Slot &len) |
return a range
Parameters:
| from | index of start of range |
| len | length of range |
Returns: the range of elements of this sequence 'from' for 'len'
| Slot slice (const Slot &element) |
return an element
Parameters:
| element | element index |
Returns: the nominated element of this sequence
| Slot search (const Slot &search) |
search for a matching element
Parameters:
| search | element for which to search |
Returns: the first matching element of this sequence
| Slot replace (const Slot &from, const Slot &len, const Slot &value) |
replace a range with a value
Parameters:
| value | value to be replaced in this sequence |
| from | slice-range start index |
| len | slice-range length |
Returns: a copy of this with the replacement performed
| Slot replace (const Slot &element, const Slot &value) |
replace an element with a value
Parameters:
| value | value to be replaced in this sequence |
| element | element index to be replaced |
Returns: a copy of this with the replacement performed
| Slot replace (const Slot &value) |
replace this with a value
Parameters:
| value | value to be replaced in this sequence |
Returns: a copy of this with the replacement performed
| Slot insert (const Slot &before, const Slot &value) |
insert a value into this sequence
Parameters:
| value | value to be inserted in this sequence |
| before | element index before which insertion is performed |
Returns: a copy of this with the replacement performed
| Slot insert (const Slot &value) |
insert a value into this sequence
Parameters:
| value | value to be inserted in this sequence |
Returns: a copy of this with the replacement performed
| Slot del (const Slot &from, const Slot &len) |
delete a subrange from sequence
Parameters:
| from | slice-range start index |
| len | slice-range length |
Returns: a copy of this with the deletion performed
| Slot del (const Slot &from) |
delete an item from sequence
Parameters:
| element | index of element to be deleted |
Returns: a copy of this with the deletion performed
| Slot iterator () |
an iterator over this sequence
Returns: an Iterator
| bool isIterator () |
predicate - is object an iterator
| Slot Current () |
return current iterated element
| bool More () |
predicate: is iterated sequence complete?
| Slot Next () |
advance iterator over sequence
| Slot call (const Slot& environment) |
call object (Method, Builtin)
| Generated by: colin@sharedtech.dhis.org on Sat Nov 6 11:59:24 199. |