class SharedVars

Atomic access and operations to shared variables. More...

Full nameTelEngine::SharedVars
Definition#include <yatengine.h>
InheritsTelEngine::Mutex [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

Class that implements atomic / locked access and operations to its shared variables

inline  SharedVars ()

SharedVars

Constructor

void  get (const String& name, String& rval)

get

Get the string value of a variable

Parameters:
nameName of the variable
rvalString to return the value into

void  set (const String& name, const char* val)

set

Set the string value of a variable

Parameters:
nameName of the variable to set
valNew value to assign to a variable

bool  create (const String& name, const char* val = 0)

create

Create and set a variable only if the variable is not already set

Parameters:
nameName of the variable to set
valNew value to assign to a variable

Returns: True if a new variable was created

void  clear (const String& name)

clear

Clear a variable

Parameters:
nameName of the variable to clear

bool  exists (const String& name)

exists

Check if a variable exists

Parameters:
nameName of the variable

Returns: True if the variable exists

unsigned int  inc (const String& name, unsigned int wrap = 0)

inc

Atomically increment a variable as unsigned integer

Parameters:
nameName of the variable
wrapValue to wrap around at, zero disables

Returns: Value of the variable before increment, zero if it was not defined or not numeric

unsigned int  dec (const String& name, unsigned int wrap = 0)

dec

Atomically decrement a variable as unsigned integer

Parameters:
nameName of the variable
wrapValue to wrap around at, zero disables (stucks at zero)

Returns: Value of the variable after decrement, zero if it was not defined or not numeric


Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.