NAME

Cac::Global - High-performance access to Cache global variables

SYNOPSIS

use Cac::Global

Global Access Functions

Gset $global, [$idx1, $idx2, ... ,] $value

Sets a global in the most efficient way.

Example:

Gset "xx", 1, "foo", 2; # s ^xx(1,"foo")=2
Ginc $global, [$idx1, $idx2, ... ,] $value

Increments a global in the most efficient way.

Example:

Ginc "xx", 1, "foo", 2; # s ^xx(1,"foo")=^xx(1,"foo")+2

Note: This function does not return anything. Use Gseq for an atomic increment by one and a result.

GsetA $global, [$idx1, $idx2, ... ,] \@values

Sets globals out of an array. If an array value is undef it is skipped.

Example:

GsetA "xx", 1, "foo", [ 0, "seppl", undef, "x" ]

does the following:

s ^xx(1,"foo",0)=0
s ^xx(1,"foo",1)="seppl"
s ^xx(1,"foo",3)="x"
GincA $global, [$idx1, $idx2, ..., ] \@values

increments globals

GsetH $global, [$idx1, $idx2, ..., ] \%values

Sets globals out of an hash. If a hash value is undef it is skipped.

Example:

GsetH "xx", 1, 2, "foo", { 1 => 'one', two => 2 }

is the same as:

s ^xx(1,2,"foo",1)="one"
s ^xx(1,2,"foo","two")=2
GincH $global, [$idx1, $idx2, ..., ] \%values

Increments globals out of an hash. If a hash value is undef it is skipped.

Gseq $global [, $idx1, $idx2, ... ]

Increments global by one and returns the value it has after incrementing. This is an atomic function.

Gget $global [, $idx1, $idx2, ... ]

Fetches a global. If the node is undefined undef is returned. Use GgetRaise if you want an exception when accessing an undefined node.

Note: Intersystems refuses to give the author of this module enough informations to make this function as fast as possible.

GgetRaise $global [, $idx1, $idx2, ... ]

Fetches a global. If the node is undefined an exception is raised. Use Gget if you want undef instead of an exception.

Note: Intersystems refuses to give the author of this module enough informations to make this function as fast as possible.

SEE ALSO

Cac, Cac::ObjectScript, Cac::Routine, Cac::Util, Cac::Bind.

AUTHOR

Stefan Traby <stefan@hello-penguin.com>
http://hello-penguin.com