Files
sics/doc/programmer/obpar.tex

45 lines
1.8 KiB
TeX

\subsection{SICS Parameter Array}
This thing holds an array of floating point numbers, their names and their access codes.
It is used in SICS object implementations to hold larger amounts of
configurable parameters. It provides functions for simplifying the
management of such parameters.
Each parameter is described by a structure shown below:
\begin{verbatim}
typedef struct {
char *name;
float fVal;
int iCode;
} ObPar;
\end{verbatim}
The fields are: \begin{description}
\item[name] The name of the parameter.
\item[fVal] The parameters value.
\item[iCode] The access code necessary to modify the parameter.
\end{description}
Parameter arrays are maintained by the functions described below:
\begin{description}
\item[ float ObVal(ObPar *self, int i)] gets the value of parameter i from
the array self. This call is for module internal usage.
\item[int ObParLength(ObPar *self)]
finds the length of an ObPar array.
\item[ObPar *ObParFind(ObPar *self, char *name)]
finds a ObPar struct for a name, return NULL if none.
\item[int ObParInit(ObPar *self,int i, char *name, float fVal, int iCode)]
sets a ObPar entry. self is a pointer to the array.
\item[int ObParSet(ObPar *self, char *obname,char *name, float fVal, SConnection
*pCon)]
checks if the connections permissions are alright and changes value
if so. Returns 1 on success, 0 on failure. Prints errors directly to
pCon. The parameter obname is the name of the object the parameters belong
to. Needed for error printing. name is the parameter name, fVal the new
value.
\item[void ObParDelete(ObPar *self)]
Deletes an ObPar array.
\item[ObPar *ObParCreate(int iArrayLong)]
creates an array with iASrrayLong entries. Returns NULL on failure, else
a pointer to the array.
\end{description}