fwRPC
 All Files Functions Variables
fwRPC_functionModel.ctl File Reference

Functions

dyn_mixed fwRPC_functionModel_new (string funcName, string stubName="", string libFile="", dyn_int paramType=makeDynInt(ANYTYPE_VAR), bool exclusive=false, int timeout=-1)
 
dyn_mixed fwRPC_functionModel_newFromQuery (dyn_mixed result)
 
void fwRPC_functionModel_sync (dyn_mixed &func)
 
void fwRPC_functionModel_store (dyn_mixed func)
 
void fwRPC_functionModel_checkValid (dyn_mixed func)
 
anytype fwRPC_functionModel_computeTimeout (dyn_mixed func)
 
private dyn_int _fwRPC_functionModel_unpackIntList (string list)
 
private string _fwRPC_functionModel_packIntList (dyn_int list)
 

Variables

const string fwRPC_FUNCTION_QUERY_UPDATE
 
const string fwRPC_FUNCTION_DPT = "_FwRPC_Function"
 
const string fwRPC_FUNCTION_DPE_NAME = ".name" + fwRPC_DPE_VALUE
 
const string fwRPC_FUNCTION_DPE_STUB = ".stub" + fwRPC_DPE_VALUE
 
const string fwRPC_FUNCTION_DPE_ENABLED = ".enabled" + fwRPC_DPE_VALUE
 
const string fwRPC_FUNCTION_DPE_EXCLUSIVE = ".exclusiveExecution" + fwRPC_DPE_VALUE
 
const string fwRPC_FUNCTION_DPE_LIBFILE = ".libfile" + fwRPC_DPE_VALUE
 
const string fwRPC_FUNCTION_DPE_PARAMTYPE = ".paramType" + fwRPC_DPE_VALUE
 
const string fwRPC_FUNCTION_DPE_TIMEOUT = ".timeout_s" + fwRPC_DPE_VALUE
 
const int fwRPC_FUNCTION_MODEL_DP = 1
 
const int fwRPC_FUNCTION_MODEL_NAME = 2
 
const int fwRPC_FUNCTION_MODEL_STUB = 3
 
const int fwRPC_FUNCTION_MODEL_EXCLUSIVE = 4
 
const int fwRPC_FUNCTION_MODEL_LIBFILE = 5
 
const int fwRPC_FUNCTION_MODEL_PARAMTYPE = 6
 
const int fwRPC_FUNCTION_MODEL_TIMEOUT = 7
 
const int fwRPC_FUNCTION_MODEL_MAXIDX = 8
 
const int fwRPC_FUNCTION_MODEL_NO_TIMEOUT = -1
 

Detailed Description

This library contains constants and functionality for RPC-callable functions, including DP, query, and model information. Also uncludes functionality for model initialization and synchronization.

Author
Victor Rodrigues (CERN, BE-ICS-SDS)

Function Documentation

void fwRPC_functionModel_checkValid ( dyn_mixed  func)

Check if an object is a valid function object, and throw if not.

Parameters
func(IN, dyn_mixed) object to test
Returns
nothing
Exceptions
ifthe given object is not a valid function object
anytype fwRPC_functionModel_computeTimeout ( dyn_mixed  func)

Compute the timeout date for a given function. If there is no timeout set, the -1 will be returned.

Parameters
func(IN, dyn_mixed) function object
Returns
time value of timeout -1 if no timeout set
Exceptions
iffunc is not a valid function object
dyn_mixed fwRPC_functionModel_new ( string  funcName,
string  stubName = "",
string  libFile = "",
dyn_int  paramType = makeDynInt(ANYTYPE_VAR),
bool  exclusive = false,
int  timeout = -1 
)

Construct a new function object.

A list of valid parameters may be specified by passing a dyn_int of valid types. This is ANYTYPE_VAR by default, which allows any parameter types to be passed.

A timeout may be specified, which limits the time in seconds which the registered procedure may be running before it is terminated.

Parameters
funcName(IN, string) function name
stubName(IN, string) function stub name
libFile(IN, string) lib file containing the stub function
paramType(IN, dyn_int) valid param types
exclusive(IN, bool) whether the function requires exclusive execution
timeout(IN, int) timeout to apply for procedure execution
Returns
function object
Exceptions
nothing
dyn_mixed fwRPC_functionModel_newFromQuery ( dyn_mixed  result)

Construct a new function object from a function query result.

Parameters
result(IN, dyn_mixed) function query result
Returns
function object
Exceptions
nothing
void fwRPC_functionModel_store ( dyn_mixed  func)

Update actual function to a given state. (push)

Parameters
func(IN, dyn_mixed) function to update
Returns
nothing
Exceptions
iffunc is not a valid function object
void fwRPC_functionModel_sync ( dyn_mixed &  func)

Sync a function object to the current actual state. (pull)

Parameters
func(IN|OUT, dyn_mixed) function object to update
Returns
nothing
Exceptions
iffunc is not a valid function object

Variable Documentation

const string fwRPC_FUNCTION_DPE_ENABLED = ".enabled" + fwRPC_DPE_VALUE

RPC function DPEs

const string fwRPC_FUNCTION_DPE_EXCLUSIVE = ".exclusiveExecution" + fwRPC_DPE_VALUE

RPC function DPEs

const string fwRPC_FUNCTION_DPE_LIBFILE = ".libfile" + fwRPC_DPE_VALUE

RPC function DPEs

const string fwRPC_FUNCTION_DPE_NAME = ".name" + fwRPC_DPE_VALUE

RPC function DPEs

const string fwRPC_FUNCTION_DPE_PARAMTYPE = ".paramType" + fwRPC_DPE_VALUE

RPC function DPEs

const string fwRPC_FUNCTION_DPE_STUB = ".stub" + fwRPC_DPE_VALUE

RPC function DPEs

const string fwRPC_FUNCTION_DPE_TIMEOUT = ".timeout_s" + fwRPC_DPE_VALUE

RPC function DPEs

const string fwRPC_FUNCTION_DPT = "_FwRPC_Function"

RPC function DPEs

const int fwRPC_FUNCTION_MODEL_DP = 1

Function model indexes

const int fwRPC_FUNCTION_MODEL_EXCLUSIVE = 4

Function model indexes

const int fwRPC_FUNCTION_MODEL_LIBFILE = 5

Function model indexes

const int fwRPC_FUNCTION_MODEL_MAXIDX = 8

Function model indexes

const int fwRPC_FUNCTION_MODEL_NAME = 2

Function model indexes

const int fwRPC_FUNCTION_MODEL_NO_TIMEOUT = -1

Function model misc constants

const int fwRPC_FUNCTION_MODEL_PARAMTYPE = 6

Function model indexes

const int fwRPC_FUNCTION_MODEL_STUB = 3

Function model indexes

const int fwRPC_FUNCTION_MODEL_TIMEOUT = 7

Function model indexes

const string fwRPC_FUNCTION_QUERY_UPDATE
Initial value:
= "SELECT '" +
"FROM '*' WHERE _DPT = \"" + fwRPC_FUNCTION_DPT + "\" AND '" +
const string fwRPC_FUNCTION_DPE_EXCLUSIVE
Definition: fwRPC_functionModel.ctl:21
const string fwRPC_FUNCTION_DPE_ENABLED
Definition: fwRPC_functionModel.ctl:20
const string fwRPC_FUNCTION_DPE_PARAMTYPE
Definition: fwRPC_functionModel.ctl:23
const string fwRPC_FUNCTION_DPE_LIBFILE
Definition: fwRPC_functionModel.ctl:22
const string fwRPC_FUNCTION_DPE_TIMEOUT
Definition: fwRPC_functionModel.ctl:24
const string fwRPC_FUNCTION_DPT
Definition: fwRPC_functionModel.ctl:17
const string fwRPC_FUNCTION_DPE_NAME
Definition: fwRPC_functionModel.ctl:18
const string fwRPC_FUNCTION_DPE_STUB
Definition: fwRPC_functionModel.ctl:19

Function query string to retrieve all info.