class Data

Refcounted Persistent Objects under the coldstore virtual protocol More...

Contains pure virtuals
Definition#include <Slot.hh>
Inheritsqvmm::RefCount
Inherited byList, NList, String, UString, Integer, BigInt, Real
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Members

Protected Members


Detailed Description

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 ()
[protected virtual]

destroy Data instance protected to encourage the use of RefCount::dncount() in our copy-on-write reference-counted environment

Slot unimpl (const char *message)
[protected const]

throw an `unimplemented' Error A place holder for unimplemented virtual protocol elements

Parameters:
messagemessage associated with the Error

Returns: nothing useful

void check (int num=0)
[const virtual]

check an instance of Data for coherence (whatever that means to the datatype)

Parameters:
numnumber of contiguous instances in an array

Returns: void, but could be changed to return a bool

void * type ()
[const]

the typeID for this type - derived from rtti

int typeOrder (const Slot &arg)
[const]

compare types of Slots

Types are given an arbitrary but fixed order to enable Data::order between disparate types

bool typeEQ (const Builtin *m)
[const]

predicate: is this of that Builtin type?

const char * typeId ()
[const]

return the name of the type of this object, using rtti

Data * clone (void *where = (void*)
[protected const pure virtual]

copy constructor

Used as the destination of @see mutate when a copy on write mutable object is desired.

Parameters:
wherethe locale into which to clone this object

Returns: mutable copy of object

Slot identity (void *where = (void*)
[protected const virtual]

dynamic mutable copy

Used as the destination of @see mutate when the object is mutable.

Parameters:
wherethe locale into which to clone this object

Returns: mutable copy of object

Data * mutate (void *where = (void*)
[const virtual]

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:
wherethe locale into which to clone this object

Returns: mutable copy of object

bool truth ()
[const virtual]

the object's truth value

mapping of all objects onto true/false

Returns: the object's truth value

Slot toconstruct ()
[const virtual]

constructor arguments sufficient to recreate object

Returns: a primitive type (pickled) representation of this object

ostream & dump (ostream& output)
[const virtual]

dump the object to a stream

Parameters:
ostreamstream onto which to dump the object

Slot construct (Slot &arg)
[static]

construct an instance of Data from the constructor args given

Parameters:
argconstructor arguments, derived from @see toconstruct

Returns: instance constructed from the args

int order (const Slot &arg)
[const pure virtual]

order two objects

Parameters:
argobject to be ordered relative to this

Returns: 1,0,-1 depending on object order

bool equal (const Slot &arg)
[const virtual]

equality operator

Parameters:
argobject to be compared to this

Returns: true/false depending on equality

Slot positive ()
[virtual]

monadic `+', absolute value

Slot negative ()
[virtual]

monadic `-', negative absolute value

Slot add (const Slot &arg)
[virtual]

dyadic `+', add

Slot subtract (const Slot &arg)
[virtual]

dyadic `-', subtract

Slot multiply (const Slot &arg)
[virtual]

dyadic `*', multiply

Slot divide (const Slot &arg)
[virtual]

dyadic '/', divide

Slot modulo (const Slot &arg)
[virtual]

dyadic '%', modulo

Slot invert ()
[virtual]

unary '~', invert

Slot and (const Slot &arg)
[virtual]

dyadic '&', bitwise and

Slot xor (const Slot &arg)
[virtual]

dyadic '^', bitwise xor

Slot or (const Slot &arg)
[virtual]

dyadic '|', bitwise or

Slot lshift (const Slot &arg)
[virtual]

dyadic '<<', left shift

Slot rshift (const Slot &arg)
[virtual]

dyadic '>>', right shift

Slot toSequence ()
[const virtual]

addressable Sequence as a List

bool isSequence ()
[virtual]

predicate - is object a sequence

int length ()
[const virtual]

length as sequence

Slot concat (const Slot &arg)
[virtual]

concatenate two sequences

Slot slice (const Slot &from, const Slot &len)
[const virtual]

return a range

Parameters:
fromindex of start of range
lenlength of range

Returns: the range of elements of this sequence 'from' for 'len'

Slot slice (const Slot &element)
[const virtual]

return an element

Parameters:
elementelement index

Returns: the nominated element of this sequence

Slot search (const Slot &search)
[const virtual]

search for a matching element

Parameters:
searchelement for which to search

Returns: the first matching element of this sequence

Slot replace (const Slot &from, const Slot &len, const Slot &value)
[virtual]

replace a range with a value

Parameters:
valuevalue to be replaced in this sequence
fromslice-range start index
lenslice-range length

Returns: a copy of this with the replacement performed

Slot replace (const Slot &element, const Slot &value)
[virtual]

replace an element with a value

Parameters:
valuevalue to be replaced in this sequence
elementelement index to be replaced

Returns: a copy of this with the replacement performed

Slot replace (const Slot &value)
[virtual]

replace this with a value

Parameters:
valuevalue to be replaced in this sequence

Returns: a copy of this with the replacement performed

Slot insert (const Slot &before, const Slot &value)
[virtual]

insert a value into this sequence

Parameters:
valuevalue to be inserted in this sequence
beforeelement index before which insertion is performed

Returns: a copy of this with the replacement performed

Slot insert (const Slot &value)
[virtual]

insert a value into this sequence

Parameters:
valuevalue to be inserted in this sequence

Returns: a copy of this with the replacement performed

Slot del (const Slot &from, const Slot &len)
[virtual]

delete a subrange from sequence

Parameters:
fromslice-range start index
lenslice-range length

Returns: a copy of this with the deletion performed

Slot del (const Slot &from)
[virtual]

delete an item from sequence

Parameters:
elementindex of element to be deleted

Returns: a copy of this with the deletion performed

Slot iterator ()
[const virtual]

an iterator over this sequence

Returns: an Iterator

bool isIterator ()
[virtual]

predicate - is object an iterator

Slot Current ()
[virtual]

return current iterated element

bool More ()
[const virtual]

predicate: is iterated sequence complete?

Slot Next ()
[virtual]

advance iterator over sequence

Slot call (const Slot& environment)
[const virtual]

call object (Method, Builtin)


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