Much new doc added. Fixed bug in gdd.cc.
This commit is contained in:
+4
-1
@@ -4,6 +4,9 @@
|
||||
// $Id$
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.11 1996/08/27 13:05:05 jbk
|
||||
// final repairs to string functions, put() functions, and error code printing
|
||||
//
|
||||
// Revision 1.10 1996/08/23 20:29:36 jbk
|
||||
// completed fixes for the aitString and fixed string management
|
||||
//
|
||||
@@ -1475,7 +1478,7 @@ gddStatus gddAtomic::setBoundingBoxOrigin(const aitUint32* const b)
|
||||
gddStatus rc=0;
|
||||
|
||||
if(dimension()>0)
|
||||
for(i=0;i<dimension();i++) bounds[i].setSize(b[i]);
|
||||
for(i=0;i<dimension();i++) bounds[i].setFirst(b[i]);
|
||||
else
|
||||
{
|
||||
gddAutoPrint("gddAtomic::setBoundingBoxOrigin",gddErrorOutOfBounds);
|
||||
|
||||
+38
-23
@@ -1,33 +1,33 @@
|
||||
<TITLE>GDD Reference Manual</TITLE>
|
||||
<P><h1>GDD Reference Manual</h1>
|
||||
|
||||
<a href="refuser.html#gdd">gdd</a><br>
|
||||
<a href="refuser.html#gddAtomic">gddAtomic</a><br>
|
||||
<a href="refuser.html#gddScalar">gddScalar</a><br>
|
||||
<a href="refuser.html#gddContainer">gddContainer</a><br>
|
||||
<a href="refuser.html#gddApplicationTypeTable">gddApplicationTypeTable</a><br>
|
||||
<a href="gddref.html#gdd">gdd</a><br>
|
||||
<a href="gddref2.html#gddAtomic">gddAtomic</a><br>
|
||||
<a href="gddref2.html#gddScalar">gddScalar</a><br>
|
||||
<a href="gddref2.html#gddContainer">gddContainer</a><br>
|
||||
<a href="gddref2.html#gddApplicationTypeTable">gddApplicationTypeTable</a><br>
|
||||
<P>
|
||||
<a href="refuser.html#gddDestructor">gddDestructor</a><br>
|
||||
<a href="refuser.html#gddBounds">gddBounds</a><br>
|
||||
<a href="refuser.html#gddBoundsxD">gddBounds1D gddBounds2D gddBounds3D</a><br>
|
||||
<a href="refuser.html#gddCursor">gddCursor</a><br>
|
||||
<a href="refuser.html#gddSemaphore">gddSemaphore</a><br>
|
||||
<a href="refuser.html#gddIntLock">gddIntLock</a><br>
|
||||
<a href="gddref2.html#gddDestructor">gddDestructor</a><br>
|
||||
<a href="gddref2.html#gddBounds">gddBounds</a><br>
|
||||
<a href="gddref2.html#gddBoundsxD">gddBounds1D gddBounds2D gddBounds3D</a><br>
|
||||
<a href="gddref2.html#gddCursor">gddCursor</a><br>
|
||||
<a href="gddref2.html#gddSemaphore">gddSemaphore</a><br>
|
||||
<a href="gddref2.html#gddIntLock">gddIntLock</a><br>
|
||||
<P>
|
||||
<a href="refuser.html#aitConvert">aitConvert</a><br>
|
||||
<a href="refuser.html#aitTimeStamp">aitTimeStamp</a><br>
|
||||
<a href="refuser.html#aitString">aitString</a><br>
|
||||
<a href="refuser.html#aitTypes_h">aitTypes/aitEnums</a><br>
|
||||
<a href="gddref2.html#aitConvert">aitConvert</a><br>
|
||||
<a href="gddref2.html#aitTimeStamp">aitTimeStamp</a><br>
|
||||
<a href="gddref2.html#aitString">aitString</a><br>
|
||||
<a href="gddref2.html#aitTypes_h">aitTypes/aitEnums</a><br>
|
||||
<P>
|
||||
<a href="refuser.html#gddNewDel_h">new/delete Free List Management</a><br>
|
||||
<a href="refuser.html#gddApps_h">Application Type Code Index Labels</a><br>
|
||||
<a href="refuser.html#gddErrorCodes_h">gddStatus - Error Codes</a><br>
|
||||
<a href="gddref2.html#gddNewDel_h">new/delete Free List Management</a><br>
|
||||
<a href="gddref2.html#gddApps_h">Application Type Code Index Labels</a><br>
|
||||
<a href="gddref2.html#gddErrorCodes_h">gddStatus - Error Codes</a><br>
|
||||
<P>
|
||||
<a href="refuser.html#dbMapper_h">DBR To ait Conversion Functions</a><br>
|
||||
<a href="refuser.html#dbMapper_h">gddMakeMapDBR</a><br>
|
||||
<a href="refuser.html#dbMapper_h">gddMapDbr</a><br>
|
||||
<a href="refuser.html#dbMapper_h">gddAitToDbr</a><br>
|
||||
<a href="refuser.html#dbMapper_h">gddDbrToAit</a><br>
|
||||
<a href="gddref2.html#dbMapper_h">DBR To ait Conversion Functions</a><br>
|
||||
<a href="gddref2.html#dbMapper_h">gddMakeMapDBR</a><br>
|
||||
<a href="gddref2.html#dbMapper_h">gddMapDbr</a><br>
|
||||
<a href="gddref2.html#dbMapper_h">gddAitToDbr</a><br>
|
||||
<a href="gddref2.html#dbMapper_h">gddDbrToAit</a><br>
|
||||
<P>
|
||||
<a href="gdd.html">User's Guide</a><br>
|
||||
|
||||
@@ -454,6 +454,21 @@ methods, they are meant to adjust the primitive type.
|
||||
</DL>
|
||||
</DL>
|
||||
|
||||
<p><b><i>gddStatus put(const gdd* dbuf);</i></b><br>
|
||||
Put the data from dbuf into this GDD. Resets all information in this GDD
|
||||
to match dbuf.
|
||||
<DL>return codes:
|
||||
<DL>
|
||||
<DT>0 - Success
|
||||
<DT>gddErrorNotSupported - If this GDD or dbuf is a container. Also if
|
||||
dbuf has dimension greater than one.
|
||||
<DT>gddErrorOutOfBounds - Attempting to copying more dbuf elements
|
||||
into this GDD then this GDD can hold.
|
||||
<DT>gddErrorNotAllowed - If this GDD has no allocated data but has a
|
||||
destructor registered.
|
||||
</DL>
|
||||
</DL>
|
||||
|
||||
<p>
|
||||
<b><i>void get(ait_xxxxx* dbuf);</i></b><br>
|
||||
<b><i>void get(void* dbuf, aitEnum dtype);</i></b><br>
|
||||
|
||||
@@ -0,0 +1,627 @@
|
||||
<TITLE>GDD Reference Manual</TITLE>
|
||||
<P><h1>GDD Reference Manual</h1>
|
||||
|
||||
<a href="gddref.html#gddAtomic">gddAtomic</a><br>
|
||||
<a href="gddref2.html#gddScalar">gddScalar</a><br>
|
||||
<a href="gddref2.html#gddContainer">gddContainer</a><br>
|
||||
<a href="gddref2.html#gddApplicationTypeTable">gddApplicationTypeTable</a><br>
|
||||
<P>
|
||||
<a href="gddref2.html#gddDestructor">gddDestructor</a><br>
|
||||
<a href="gddref2.html#gddBounds">gddBounds</a><br>
|
||||
<a href="gddref2.html#gddBoundsxD">gddBounds1D gddBounds2D gddBounds3D</a><br>
|
||||
<a href="gddref2.html#gddCursor">gddCursor</a><br>
|
||||
<a href="gddref2.html#gddSemaphore">gddSemaphore</a><br>
|
||||
<a href="gddref2.html#gddIntLock">gddIntLock</a><br>
|
||||
<P>
|
||||
<a href="gddref2.html#aitConvert">aitConvert</a><br>
|
||||
<a href="gddref2.html#aitTimeStamp">aitTimeStamp</a><br>
|
||||
<a href="gddref2.html#aitString">aitString</a><br>
|
||||
<a href="gddref2.html#aitTypes_h">aitTypes/aitEnums</a><br>
|
||||
<P>
|
||||
<a href="gddref2.html#gddNewDel_h">new/delete Free List Management</a><br>
|
||||
<a href="gddref2.html#gddApps_h">Application Type Code Index Labels</a><br>
|
||||
<a href="gddref2.html#gddErrorCodes_h">gddStatus - Error Codes</a><br>
|
||||
<P>
|
||||
<a href="gddref2.html#dbMapper_h">DBR To ait Conversion Functions</a><br>
|
||||
<a href="gddref2.html#dbMapper_h">gddMakeMapDBR</a><br>
|
||||
<a href="gddref2.html#dbMapper_h">gddMapDbr</a><br>
|
||||
<a href="gddref2.html#dbMapper_h">gddAitToDbr</a><br>
|
||||
<a href="gddref2.html#dbMapper_h">gddDbrToAit</a><br>
|
||||
<P>
|
||||
<a href="gdd.html">User's Guide</a><br>
|
||||
|
||||
<hr><h2><a name="gddAtomic">gddAtomic</a></h2>
|
||||
Specialized subclass of gdd that provides conveniences ways to create
|
||||
and manage array-type GDDs.
|
||||
|
||||
<p>#include "gdd.h"<p>
|
||||
|
||||
<b><i>gddAtomic(void)</i></b><br>
|
||||
<b><i>gddAtomic(gddAtomic* dd)</i></b><br>
|
||||
|
||||
Construct a new gdd that is empty or that is a copy of another gddAtomic
|
||||
instance.
|
||||
|
||||
<p>
|
||||
<b><i>gddAtomic(int ApplicationType);</i></b><br>
|
||||
<b><i>gddAtomic(int ApplicationType, aitEnum PrimitiveType);</i></b><br>
|
||||
<b><i>gdd(int ApplicationType, aitEnum PrimitiveType, int Dimension,
|
||||
aitUint32* ElementCounts);</i></b><br>
|
||||
<b><i>gddAtomic(int ApplicationType, aitEnum PrimitiveType, int Dimension, ...);
|
||||
</i></b><br>
|
||||
|
||||
Construct a new gdd, describing various data properties. If <I>Dimension</I>
|
||||
is greater that zero, then <I>ElementCounts</I> is an array with Dimension
|
||||
number of elements in it. Each element of the array describes how many
|
||||
elements are in that dimension. The ElementCount information is used to
|
||||
initialize the bounds of a GDD. The last constructor takes a variable
|
||||
number of arguments which are the upper bounds for each dimension; the
|
||||
number of variable arguments must be equal to the Dimension argument.
|
||||
|
||||
<p>
|
||||
<b><i>gddStatus getBoundingBoxSize(aitUint32* buf);</i></b><br>
|
||||
<b><i>gddStatus getBoundingBoxOrigin(aitUint32* buf);</i></b><br>
|
||||
<b><i>gddStatus setBoundingBoxSize(const aitUint32* const buf);</i></b><br>
|
||||
<b><i>gddStatus setBoundingBoxOrigin(const aitUint32* const buf);</i></b><br>
|
||||
Convenience routines for setting bounds information using bounding box
|
||||
information. The number of elements of buf must be equal to the dimension
|
||||
defined in the GDD. These methods can be used to set the bounds information
|
||||
within a GDD in a convenience way by specifying the origin and size.
|
||||
Bounds in GDDs are descibed (origin,element_count) for each dimension. These
|
||||
methods provide an alternative method to set all the origins at once or
|
||||
all the element_counts at once.
|
||||
<DL>changeType() return codes:
|
||||
<DL>
|
||||
<DT>0 - Success
|
||||
<DT>gddErrorOutOfBounds - If this GDD has dimension zero
|
||||
</DL>
|
||||
</DL>
|
||||
|
||||
<hr><h2><a name="gddScalar">gddScalar</a></h2>
|
||||
Specialized subclass of gddAtomic that provides convenient ways to create
|
||||
and manage scalar-type GDDs.
|
||||
|
||||
<p>#include "gdd.h"<p>
|
||||
|
||||
<b><i>gddAtomic(void)</i></b><br>
|
||||
<b><i>gddAtomic(gddAtomic* dd)</i></b><br>
|
||||
|
||||
Construct a new gddScalar that is empty or that is a copy of another gddScalar
|
||||
instance.
|
||||
|
||||
<p>
|
||||
<b><i>gddAtomic(int ApplicationType);</i></b><br>
|
||||
<b><i>gddAtomic(int ApplicationType, aitEnum PrimitiveType);</i></b><br>
|
||||
|
||||
Construct a new gddScalar, describing various data properties. Dimension is
|
||||
a gddScalar is always zero.
|
||||
|
||||
<hr><h2><a name="gddContainer">gddContainer</a></h2>
|
||||
Specialized subclass of gdd that provides convenient ways to create
|
||||
and manage container-type GDDs.
|
||||
|
||||
<p>#include "gdd.h"<p>
|
||||
|
||||
<b><i>gddContainer(void)</i></b><br>
|
||||
<b><i>gddContainer(gddContainer* dd)</i></b><br>
|
||||
|
||||
Construct a new gddContainer that is empty or that is a copy of another
|
||||
gddContainer instance. A gddContainer always has dimension one and a
|
||||
single bounds structure allocated to tell how many GDDs are in the container.
|
||||
|
||||
<p>
|
||||
<b><i>gddContainer(int ApplicationType);</i></b><br>
|
||||
<b><i>gddContainer(int ApplicationType, int total_gdds);</i></b><br>
|
||||
|
||||
Construct a new gddContainer, describing the application type. The argument
|
||||
total_gdds sets the number GDDs contained within the gddContainer in
|
||||
the element count of this GDDs bound structure. The last constructor listed
|
||||
also creates total_gdds GDDs, puts them together in a linked list and
|
||||
sets the data field of this GDD to point to the linked list. The last
|
||||
constructor creates the container with total_gdds empty GDDs in it.
|
||||
|
||||
<p>
|
||||
<b><i>gddStatus insert(gdd* dd);</i></b><br>
|
||||
<b><i>gddStatus remove(aitIndex index);</i></b><br>
|
||||
Insert dd to the container. Care must be taken not to use the insert method
|
||||
on a flattened container. Remove GDD number index from the container. The
|
||||
GDD at index is removed from the container and unreferenced.
|
||||
<DL>remove() return codes:
|
||||
<DL>
|
||||
<DT>0 - Success
|
||||
<DT>gddErrorOutOfBounds - If GDD at index does not exist.
|
||||
</DL>
|
||||
</DL>
|
||||
|
||||
<p>
|
||||
<b><i>gdd* operator[](aitIndex index);</i></b><br>
|
||||
<b><i>gdd* getDD(aitIndex index);</i></b><br>
|
||||
<b><i>gdd* getDD(aitIndex index, gddScalar*&);</i></b><br>
|
||||
<b><i>gdd* getDD(aitIndex index, gddAtomic*&);</i></b><br>
|
||||
<b><i>gdd* getDD(aitIndex index, gddContainer*&);</i></b><br>
|
||||
Return the GDD at index.
|
||||
|
||||
<p>
|
||||
<b><i>gddCursor getCursor(void) const;</i></b><br>
|
||||
Get a simple linked list iterator which is useful for manipulating containers.
|
||||
See gddCursor explanation.
|
||||
|
||||
<hr><h2><a name="gddCursor">gddCursor</a></h2>
|
||||
A simple class for moving forward through the GDDs stored in a container.
|
||||
|
||||
<p>#include "gdd.h"<p>
|
||||
|
||||
<b><i>gddCursor(const gddContainer* c)</i></b><br>
|
||||
Construct a new gddCursor that can be used to walk through gddContainer c.
|
||||
|
||||
<p><b><i>gddStatus first(.....);</i></b><br>
|
||||
Set this iterator to the first element of the container. Returns the
|
||||
first GDD in the container.
|
||||
|
||||
<p><b><i>gddStatus next(.....);</i></b><br>
|
||||
Set this iterator to the next element of the container. Returns the
|
||||
next GDD in the container.
|
||||
|
||||
<p><b><i>gddStatus current(.....);</i></b><br>
|
||||
Returns the current GDD that the cursor points to within the container.
|
||||
|
||||
<hr><h2><a name="gddApplicationTypeTable">gddApplicationTypeTable</a></h2>
|
||||
A database for registering application type names and retrieving application
|
||||
type codes. The database also manages GDD prototype structures associated
|
||||
with application type names. Methods exist for allocating and freeing GDDs
|
||||
given a type code. See User's Guide for details.
|
||||
|
||||
<p>#include "gddAppTable.h"<p>
|
||||
|
||||
<b><i>gddApplicationTypeTable(aitUint32 total)</i></b><br>
|
||||
Construct an application type table capable of holding total amount
|
||||
of application type codes. The user does not need to create one of these,
|
||||
the library automatically generates one instance of this class large enough
|
||||
to hold 512 type codes. This automatically generated instance registers
|
||||
all the standard EPICS control system type codes, see User's Guide.
|
||||
|
||||
<b><i>gddStatus registerApplicationType(const char* const name,
|
||||
aitUint32& app);</i></b><br>
|
||||
<b><i>gddStatus registerApplicationTypeWithProto(const char* const name,
|
||||
gdd* protoDD, aitUint32& app);</i></b><br>
|
||||
Register an application type <i>name</i>. The type table will return the
|
||||
application type code in <i>app</i> that the system has assigned to the name.
|
||||
The latter function allow a prototype GDD to be registered aloong with
|
||||
the name. This prototype is describes the structure of the data associated
|
||||
with the application type name. See User's Guide for more details.
|
||||
<DL>return codes:
|
||||
<DL>
|
||||
<DT>0 - Success
|
||||
<DT>gddErrorAlreadyDefined - If <i>name</i> is already refined, <i>app</i>
|
||||
still returns the type code assigned to the name.
|
||||
<DT>gddErrorAtLimit - The type table is filled, no more names can be
|
||||
stored in it.
|
||||
</DL>
|
||||
</DL>
|
||||
|
||||
<i><b>aitUint32 getApplicationType(const char* const name) const;</b></i><br>
|
||||
<i><b>char* getName(aitUint32 app) const;</b></i><br>
|
||||
Convert a character string type name to it's integer value. Convert an
|
||||
integer value to it's character string name.
|
||||
|
||||
<i><b>gddStatus mapAppToIndex(aitUint32 container_app,
|
||||
aitUint32 app_to_map, aitUint32& index);</b></i><br>
|
||||
Special function for converting type codes to container GDD array indexes.
|
||||
The GDD must be a flattened GDD managed by the application type table for
|
||||
mapping to take place. The <i>container_app</i> argument is the main
|
||||
structure that contains <i>app_to_map</i>. The <i>index</i> is populated
|
||||
with the position where <i>app_to_map</i> is within <i>container_app</i>.
|
||||
See User's Guide for details.
|
||||
<DL>return codes:
|
||||
<DL>
|
||||
<DT>0 - Success
|
||||
<DT>gddErrorOutOfBounds - app_to_map cannot be mapped
|
||||
<DT>gddErrorNotDefined - container_app does not exist or app_to_map not
|
||||
in container_app
|
||||
</DL>
|
||||
</DL>
|
||||
|
||||
<i><b>gddStatus smartCopy(gdd* dest, gdd* src);</b></i><br>
|
||||
Given any GDD dest and any GDD src, copy all the data from src to dest
|
||||
where application type codes match. The src and dest can be any type of
|
||||
GDD: scalar, array, or container. The src dset do not need to be the
|
||||
same type of GDD. If dest and src are both containers. The function will
|
||||
look through each of the src GDDs to find matches for each of the dest GDDs.
|
||||
SmartCopy() may result in no data being copied if none of the src type codes
|
||||
match the dest type codes. The dest and src container GDDs do not need to
|
||||
be in the same order.
|
||||
<DL>return codes:
|
||||
<DL>
|
||||
<DT>0 - Success
|
||||
<DT>gddErrorNotAllowed - src or dest is container and is not managed
|
||||
<DT>other - see put(const gdd*)
|
||||
</DL>
|
||||
</DL>
|
||||
|
||||
<i><b>gdd* getDD(aitUint32 app);</b></i><br>
|
||||
Allocate a GDD for the <i>app</i> and return it. If app has a prototype
|
||||
registered with it, then the returned gdd will be managed and match the
|
||||
prototype.
|
||||
|
||||
<i><b>gddStatus freeDD(gdd* dd);</b></i><br>
|
||||
Free any gdd. The method basically just calls unreference on dd. If the
|
||||
GDD is managed, then it puts it onto a free list for it's application type
|
||||
code.
|
||||
|
||||
<i><b>aitUint32 maxAttributes(void) const;</b></i><br>
|
||||
<i><b>aitUint32 totalregistered(void) const;</b></i><br>
|
||||
Return the total number of names registered in this application type table.
|
||||
Return the total number of names that can be registered in this application
|
||||
type table.
|
||||
|
||||
<i><b>void describe(FILE* fd);</b></i><br>
|
||||
Print out "#define" statements for each of the names registered in this
|
||||
table. Also print out container index labels in the form of #defines. See
|
||||
User's Guide for details. The file gddApps.h is generated using this
|
||||
function.
|
||||
|
||||
<i><b>static gddApplicationTypeTable& AppTable(void);</b></i><br>
|
||||
Return the automatically generated application type table for use in a
|
||||
program.
|
||||
|
||||
<hr><h2><a name="gddDestructor">gddDestructor</a></h2>
|
||||
The gdd class knows how to run and manage gddDestructors. User's assign
|
||||
destructors to gdd by deriving classes from gddDestructor.
|
||||
|
||||
<p>#include "gdd.h"<p>
|
||||
|
||||
<i><b>gddDestructor(void);</b></i><br>
|
||||
<i><b>gddDestructor(void* user_arg);</b></i><br>
|
||||
Create a gddDestructor, optionally placing an arbitrary pointer in the
|
||||
destructor which can be referenced when the destructor is actual run.
|
||||
|
||||
<i><b>gddStatus destroy(void* thing_to_remove);</b></i><br>
|
||||
<i><b>virtual void run(void* thing_to_remove);</b></i><br>
|
||||
The <i>destroy</i> method in invoked by anyone withing to request the destructor
|
||||
to be run. <i>Destroy</i> invokes the user-written function <i>run</i> when
|
||||
it's reference count goes to zero. <i>Run</i> should not be invoked
|
||||
directly by the user. The argument to <i>destroy</i> is the buffer that
|
||||
needs to be freed by by the destructor. The gdd class invokes <i>destroy</i>
|
||||
when unreference is called and the gdd's reference count goes to zero. The
|
||||
default behavior of <i>run<i> is to cast the buffer thing_to_remove to a
|
||||
character array and delete it.
|
||||
|
||||
<i><b>void reference(void);</b></i><br>
|
||||
<i><b>int refCount(void) const;</b></i><br>
|
||||
Calling <i>refCount</i> will return the current value in the destructor
|
||||
reference count. <i>Reference</i> will bump up the reference count of this
|
||||
destructor.
|
||||
|
||||
<hr><h2><a name="gddBounds">gddBounds</a></h2>
|
||||
A simple class to describe the boundaries of a dimension.
|
||||
|
||||
<p>#include "gdd.h"<p>
|
||||
|
||||
<i><b>void setSize(aitIndex c);</b></i><br>
|
||||
Sets the number of elements for this bounds.
|
||||
<i><b>void set(aitIndex first, aitIndex cnt);</b></i><br>
|
||||
<i><b>void get(aitIndex& first, aitIndex& cnt);</b></i><br>
|
||||
Set and get the first element in this bounds and the number of elements.
|
||||
<i><b>aitIndex size(void) const;</b></i><br>
|
||||
Return the number of element in this bounds.
|
||||
<i><b>aitIndex first(void) const;</b></i><br>
|
||||
Return the first element in this bounds.
|
||||
|
||||
<hr><h2><a name="gddBoundsxD">gddBounds1D gddBounds2D gddBounds3D</a><br>
|
||||
Specialized classes for describing with one, two, and three dimension data.
|
||||
Since three of less dimension are the most common, bounds array classes for
|
||||
each type exist and are managed on free lists. All of these classes
|
||||
overload the new/delete operators so that the memory allocater is not used.
|
||||
All of these classes are just arrays of gddBounds. Only one method exists
|
||||
in these classes, <i>gddBounds* boundArray(void)</i>, which returns a pointer
|
||||
to the array of gddBounds.
|
||||
|
||||
<p>#include "gdd.h"<p>
|
||||
|
||||
<hr><h2><a name="gddSemaphore">gddSemaphore</a><br>
|
||||
Simple wrapper around the underlying OS semphore functions. Implimentation
|
||||
is OS dependant and is not really relevant in single threaded application.
|
||||
This is a binary semaphore meant to be used for locking sections of code
|
||||
or perhaps in a simple producer/consumer program.
|
||||
|
||||
<p>#include "gddUtils.h"<p>
|
||||
|
||||
<i><b>gddSemaphore(void)</b></i><br>
|
||||
<i><b>gddSemaphore(gddSemType init)</b></i><br>
|
||||
Create a simple binary gddSemaphore which defaults to full. Create a
|
||||
gddSemaphore which
|
||||
is set initially to state <i>init</i>. <i>Init</i> is either gddSemEmpty or
|
||||
gddSemFull.
|
||||
|
||||
<i><b>void give(void)</b></i><br>
|
||||
<i><b>void take(void)</b></i><br>
|
||||
Operations for manipulating the semaphore. <i>Take</i> will block if the
|
||||
semaphore is empty, waiting until it is full. <i>Give</i> sets the
|
||||
semaphore back to full state.
|
||||
|
||||
<i><b>int take(aitUint32 usec)</b></i><br>
|
||||
Attempt to perform the semaphore take operation. Only block for <i>usec</i>
|
||||
microseconds. Returns true if time-out occurred and semaphore is not
|
||||
really taken.
|
||||
|
||||
<hr><h2><a name="gddIntLock">gddIntLock</a><br>
|
||||
A simple wrapper around OS interrupt locking services.
|
||||
|
||||
<p>#include "gddUtils.h"<p>
|
||||
|
||||
<hr><h2><a name="aitConvert">aitConvert</a><br>
|
||||
A set of convenience functions for quickly converting arrays of data from one
|
||||
aitType to another. The header file for these functions also contains a
|
||||
set of standard functions for converting each of the ait types from/to
|
||||
network byte order.
|
||||
|
||||
<p>#include "aitConvert.h"<p>
|
||||
|
||||
<i><b>void aitConvert(aitEnum desttype, void* dest,
|
||||
aitEnum srctype, const void* src, aitIndex count)</b></i><br>
|
||||
Take <i>count</i> number of elements from <i>src</i> of type <i>srctype</i>,
|
||||
copy then to <i>dest</i> and at the same time convert them to type
|
||||
<i>desttype</i>.
|
||||
|
||||
<i><b>void aitConvertToNet(aitEnum desttype, void* dest,
|
||||
aitEnum srctype, const void* src, aitIndex count)</b></i><br>
|
||||
<i><b>void aitConvertFromNet(aitEnum desttype, void* dest,
|
||||
aitEnum srctype, const void* src, aitIndex count)</b></i><br>
|
||||
Same as <i>aitConvert</i> but change the byte order or data format to/from
|
||||
network format. If the local host data format is network data format,
|
||||
then these function are exactly the same as aitConvert.
|
||||
|
||||
<i><b>aitLocalNetworkDataFormatSame</b></i><br>
|
||||
This is a #define which is true if local host byte order is the same
|
||||
as network byte order, otherwise it is false.
|
||||
|
||||
<hr><h2><a name="aitTimeStamp">aitTimeStamp</a><br>
|
||||
A class for storing and manipulating standard time stamps. This time
|
||||
is similar to POSIX time stamps, it maintains time in seconds/nanoseconds
|
||||
past a standard epoch. POSIX defines a time stamp as a long for seconds
|
||||
and a type time_t for nanoseconds. Time_t is OS dependant and so is a
|
||||
long. aitTimeStamp forces seconds and nanoseconds to be unsigned 32 bit
|
||||
integers so the storage size is fixed and known.
|
||||
|
||||
<p>#include "aitHelpers.h"
|
||||
Automatically included if aitTypes.h is included.<p>
|
||||
|
||||
<i><b>operator double()</b></i><br>
|
||||
<i><b>operator float()</b></i><br>
|
||||
Convert (cast) the seconds/nanoseconds to a double or float seconds with
|
||||
decimal fraction of a second past epoch.
|
||||
|
||||
<i><b>static aitTimeStamp getCurrent();</b></i><br>
|
||||
Retrieve the current time in aitTimeStamp format.
|
||||
|
||||
<i><b>void get(unsigned long &tv_secOut,unsigned long &tv_nsecOut);</b></i><br>
|
||||
Retreive the various parts of the time stamp as separate quantities.
|
||||
|
||||
<i><b>aitTimeStamp()</b></i><br>
|
||||
<i><b>aitTimeStamp(const aitTimeStamp &t)</b></i><br>
|
||||
<i><b>aitTimeStamp(const unsigned long sec, const unsigned long nsec)</b></i><br>
|
||||
Create an aitTimeStamp that is initially zero or set to various values.
|
||||
|
||||
<i><b>const unsigned NSecPerSec = 1000000000u;</i></b><br>
|
||||
<i><b>const unsigned NSecPerUSec = 1000u;</i></b><br>
|
||||
<i><b>const unsigned SecPerMin = 60u;</i></b><br>
|
||||
Various constants for working with time.
|
||||
|
||||
<i><b>
|
||||
aitTimeStamp operator+ (const aitTimeStamp &lhs, const aitTimeStamp &rhs);<br>
|
||||
aitTimeStamp operator- (const aitTimeStamp &lhs, const aitTimeStamp &rhs);<br>
|
||||
int operator>= (const aitTimeStamp &lhs, const aitTimeStamp &rhs);<br>
|
||||
</b></i>
|
||||
They are global functions for adding and subtracting and comparing time stamps.
|
||||
|
||||
<hr><h2><a name="aitString">aitString</a><br>
|
||||
Standard class for holding and managing a variable length string. Strings
|
||||
is GDD have two attributes associated with them: length and state. Length
|
||||
is simply the total length of the string and state either constant or
|
||||
allocated.
|
||||
|
||||
<p>#include "aitHelpers.h"
|
||||
Automatically included if aitTypes.h is included.<p>
|
||||
|
||||
<i><b>aitString(void);</b></i><br>
|
||||
Construct an aitString that is empty.
|
||||
|
||||
<i><b>
|
||||
aitString(char* str);
|
||||
aitString(aitString* str);
|
||||
aitString(aitString& str);
|
||||
</b></i><br>
|
||||
Construct an aitString which contains a <b>copy</b> of <i>str</i>. The
|
||||
state of this aitString will be "allocated".
|
||||
|
||||
<i><b>
|
||||
aitString(const char* str);
|
||||
aitString(const aitString* str);
|
||||
aitString(const aitString& str);
|
||||
</b></i><br>
|
||||
Construct an aitString which contains a <b>reference</b> to <i>str</i>. The
|
||||
state of this aitString will be "constant".
|
||||
|
||||
<i><b>void clear(void);</b></i><br>
|
||||
Clear out this aitString, freeing up any storage that may be allocated.
|
||||
|
||||
<i><b>void dump(void) const;</b></i><br>
|
||||
<i><b>void dump(const char* id) const;</b></i><br>
|
||||
Print the contents of this aitString to stdout in a readable format. Good
|
||||
tool for debugging or understanding the aitString class.
|
||||
|
||||
<i><b>
|
||||
operator const char*(void) const;
|
||||
operator char*(void) const;
|
||||
</b></i><br>
|
||||
Pull out a reference to the string that this aitString is holding. These
|
||||
are casting operators from aitString to char*.
|
||||
|
||||
<i><b>int isConstant(void) const;</b></i><br>
|
||||
Returns true is this aitString hold a constant string.
|
||||
|
||||
<i><b>
|
||||
aitUint32 length(void) const;
|
||||
const char* string(void) const;
|
||||
</b></i><br>
|
||||
Return the length of the string in this aitString. Return a reference to
|
||||
the string in this aitString.
|
||||
|
||||
<i><b>
|
||||
aitString& operator=(......);<br>
|
||||
int copy(......);<br>
|
||||
</b></i><br>
|
||||
Create a copy of the variable string arguments in this aitString. This
|
||||
aitString attributes will match that of the arguments. The assignment
|
||||
operators just invoke copy(......).
|
||||
|
||||
<i><b>void replaceData(......);</b></i><br>
|
||||
Replace the data in this aitString with the string in the argument. This
|
||||
function will only copy this aitStrings length number of bytes into it's
|
||||
string from the argument string.
|
||||
|
||||
<i><b>void installString(......);</b></i><br>
|
||||
Invoke replaceData if this aitString is "constant". Invoke copy if this
|
||||
aitString is not "constant".
|
||||
|
||||
<i><b>
|
||||
static aitUint32 totalLength(aitString* array,aitIndex arraySize);<br>
|
||||
static aitUint32 stringsLength(aitString* array,aitIndex arraySize);<br>
|
||||
static aitIndex compact(aitString* array, aitIndex arraySize,
|
||||
void* buf, aitIndex bufSize);
|
||||
</b></i><br>
|
||||
totalLength() returns the total number of bytes that an array of aitStrings
|
||||
requires. This length include the size of all the strings in the aitStrings.
|
||||
<i>Array</i> is the aitString array, <i>arraySize</i> is the number of
|
||||
elements in array <i>array</i>. The function <i>stringsLength</i>
|
||||
returns the total length of all the strings in aitString array <i>array</i>.
|
||||
The function <i>compact</i> takes aitString array <I>array</I> with
|
||||
<i>arraySize</i> elements and places all the data contiguously into buffer
|
||||
<i>buf</i>. The compacted buffer is <i>bufSize</i> number of bytes. The
|
||||
<i>compact</i> function places all the aitString instances of the array at
|
||||
the front of <i>buf</i>. The aitStrings in buf reference strings that are
|
||||
further into the buffer <i>buf</i>. <i>Compact</i> returns the total
|
||||
number of bytes used in <i>buf</i>.
|
||||
|
||||
<hr><h2><a name="aitTypes_h">aitTypes/aitEnums</a><br>
|
||||
Standard GDD data types and enumerations for them. This header file contains
|
||||
many macros for dicovering information about aitTypes. See the header.
|
||||
|
||||
<p>#include "aitTypes.h"<p>
|
||||
|
||||
<pre>
|
||||
aitInt8 8 bit signed integer
|
||||
aitUint8 8 bit unsigned integer
|
||||
aitInt16 16 bit signed integer
|
||||
aitUint16 16 bit unsigned integer
|
||||
aitEnum16 16 bit unsigned integer
|
||||
aitInt32 32 bit signed integer
|
||||
aitUint32 32 bit unsigned integer
|
||||
aitFloat32 32 bit floating point number
|
||||
aitFloat64 64 bit floating point number
|
||||
aitIndex 32 bit unsigned integer for indexing arrays
|
||||
aitPointer largest pointer a system can hold
|
||||
aitStatus 32 bit unsigned integer
|
||||
aitBool standard "c" enum - value aitTrue or aitFalse
|
||||
aitFixedString A fixed string of length AIT_FIXED_STRING_SIZE
|
||||
aitTimeStamp The standard seconds/nanoseconds time stamp
|
||||
aitString Class for manipulating and storing strings
|
||||
</pre>
|
||||
|
||||
<i><b>
|
||||
aitTotal
|
||||
aitConvertTotal
|
||||
aitValid(x)
|
||||
aitConvertValid(x)
|
||||
</b></i><br>
|
||||
Value of the first two are the number of valid types. All the ait types
|
||||
cannot be automatically converted using aitConvert. AitValid(x) returns
|
||||
true if x has a valid ait type enumeration associated with it.
|
||||
AitConvertValid(x) returns true if enumerated value x can be converted using
|
||||
aitConvert.
|
||||
|
||||
<i><b>aitEnum</i></b><br>
|
||||
This is an enumerated data type, there is one name per ait types. See
|
||||
header file for the definition.
|
||||
|
||||
<i><b>aitType</i></b><br>
|
||||
Data union of all the ait types.
|
||||
|
||||
<i><b>
|
||||
aitSize[aitTotal]
|
||||
aitName[aitTotal]
|
||||
aitStringType[aitTotal]
|
||||
</b></i><br>
|
||||
Arrays used for discovering information about ait types using the enumerated
|
||||
ait type name as the index into the array. aitSize returns the size in
|
||||
bytes of the ait type. aitName returns a character string name of the
|
||||
ait type. aitStringType returns a string which can be used in sscanf to
|
||||
read or convert a string into the actual ait type.
|
||||
|
||||
<a name="gddErrorCodes_h">gddStatus - Error Codes</a><br>
|
||||
Error codes returned by various GDD library functions and methods. See header
|
||||
file.
|
||||
<P>#include "gddErrorsCodes.h"<P>
|
||||
<i><b>char* gddErrorMessages[]</b></i><br>
|
||||
Return an error message string name for an error code.
|
||||
|
||||
<hr><h2><a name="gddNewDel_h">new/delete Free List Management</a><br>
|
||||
<P>#include "gddNewDel.h"<P>
|
||||
A set of generic member function macros that can be added to any class
|
||||
to allow the class to be managed on a free list using the new/delete
|
||||
operators. See the header file for details on how to use this
|
||||
facility. Most GDD library classes use this facility.
|
||||
|
||||
<hr><h2><a name="gddApps_h">Application Type Code Index Labels</a><br>
|
||||
<P>#include "gddApps.h"<P>
|
||||
This file is generated from the standard application type table. It
|
||||
contains all the #define statements for preregistered containers and
|
||||
application type codes.
|
||||
|
||||
<hr>
|
||||
<h2><a name="dbMapper_h">DBR To ait Conversion Functions</a><br>
|
||||
<h2><a name="dbMapper_h">gddMapDbr</a><br>
|
||||
<h2><a name="dbMapper_h">gddAitToDbr</a><br>
|
||||
<h2><a name="dbMapper_h">gddDbrToAit</a><br>
|
||||
<P>#include "dbMapper.h"<P>
|
||||
Large set of utility functions for converting between EPICS DBR data types
|
||||
and GDD containers.
|
||||
|
||||
<i><b>void gddMakeMapDBR(gddApplicationTypeTable& table);</b></i><br>
|
||||
The DBR mapping facility is not initialized automatically. It must be
|
||||
initialized using this function before any of the functions are called.
|
||||
It should be passed the standard default
|
||||
application type table as an argument.
|
||||
|
||||
<i><b>chtype gddAitToDbr[]</b></i><br>
|
||||
Given an ait type code, return the equivalent EPICS DBR type code.
|
||||
|
||||
<i><b>gddDbrToAitTable gddDbrToAit[]</b></i><br>
|
||||
Given a DBR type code, return a structure that describe the ait/GDD type code
|
||||
informtion for that DBR type code. The information in gddDbrToAitTable is
|
||||
the GDD application type code and GDD application type name for a given DBR
|
||||
type. This information is not extremely useful for simple applications.
|
||||
|
||||
<i><b>gddDbrMapFuncTable gddMapDbr[]</b></i><br>
|
||||
Array of conversion functions that convert between DBR structures and GDD
|
||||
types. The index of this array is always the DBR type code, not the
|
||||
GDD application type code. Each element of the array contains to functions:
|
||||
conv_gdd and conv_dbr. Conv_gdd takes a DBR structure and returns a GDD
|
||||
equivalent to the DBR structure. Conv_dbr takes a GDD and puts all the data
|
||||
into a DBR structure.
|
||||
|
||||
<pre>
|
||||
struct gddDbrMapFuncTable {
|
||||
to_gdd conv_gdd;
|
||||
to_dbr conv_dbr;
|
||||
};
|
||||
|
||||
gdd* to_gdd(void* dbr_data_structure, aitIndex dbr_element_count);
|
||||
int to_dbr(void* dbr_data_structure, gdd* gdd_instance);
|
||||
</pre>
|
||||
|
||||
<hr>Argonne National Laboratory
|
||||
<a href="http://www.aps.anl.gov/asd/controls/epics_copyright.html">Copyright</a>
|
||||
Information<br>
|
||||
<address>Jim Kowalkowski (jbk@aps.anl.gov)</address> updated 4/12/95
|
||||
|
||||
Reference in New Issue
Block a user