Update 4/9/99 Rich Baker

This page documents direct access to CLEO III constants via ASCII files.

Offline programmers should see This Page.
Online programmers should see the DAQIII Online Database Page.

Note:  Constants Access via ASCII does not depend on Objectivity at all, but it does still depend on the Visibroker ORB.  Therefore, constants access is restricted to platforms supported by Visibroker.  For offline users, this means Solaris. Work is in progress to remove the last remaining dependencies on the ORB.

Why you should read and write your constants from ASCII files for now:  There is considerable overhead currently for new users to get started using constants from the CLEO III database.  Until the environment is further developed, it is unreasonable to expect new users to set up everything to use the database.  ASCII access will allow users to incorporate real CLEO III constants objects in their code immediately.  Code written to use constants from ASCII will only need very minor modifications when the constants are available via the SUEZ Frame/Stream environment.

All of the following needs to be done regardless of how you will be reading your constants (database or ASCII):

To get started, you need to create a bdl file to define your constants as described on the CLEO III Constants Access page.  You need to add your bdl file(s) to the cvs Common repository in the appropriate subdirectory.  (This is also described on the CLEO III Constants Access page.)  Once you have checked your bdl in, it should be built in the nightly rebuild.  The build will create a header file for your constants in the directory /nfs/cleo3/Common/rel/development/include/BDLclient/.  This is the header file you need to #include in your code.  You will need to include the header file ConstantsUtility/DBConstants.hxx which is also in the Common repository.  In addition to these header files, you will need to make sure your Makefile has all of the appropriate include directories and libraries.  See /nfs/cleo3/Offline/rel/current/src/ConstantsDelivery/Makefile for an example.  There are several variables starting with COMM that you probably don't have in your Makefile.  Also, orb is a required SYS_LIBS entry.

Now you can write, compile and run code that uses DBConstants<DBXXX> objects where XXX is the name of your constants.

Now for the stuff specific to ASCII access:

The easiest way to create an ASCII file would be to write a small stand-alone program that creates a constants object and writes it to an ASCII file (this is also described on the CLEO III Constants Access page.)  The format of the ASCII file is very simple, but it has to be exactly right if you want to successfully read your constants back.  If you use the writeToFile method, it will create a correctly formatted file.  If you really want to just create one by hand, here is the required file format:

Line 1 must be the "Version Information" which consists of 8 integers followed by a text string.  (all separated by a blank space).
The second line must be a single integer that specifies the number of data records that will follow it.
Starting on the third line, each line is a constants record.  The format of this line will match the parameters you specified in your bdl file.  For example, if your constants consist of a UInt32 (index) followed by six additional integers, your ASCII file would look like ths sample file.

The parameters on the first line are not important right now, but there must be 8 integers followed by a text string (no imbedded spaces in the text string!)
The second line indicates that there are 21 data records to follow.  Each of the data lines contains 7 integers, matching my data structure.
You can edit your files with any text editor, but be careful not to change the format!

To read your constants and use them in your SUEZ job, see This Page.

Any questions?  Just email me...

Rich