Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CdbBdbLoadList.hh File Reference

#include "BdbCond/BdbObject.hh"
#include "BdbCond/BdbCondProxyBase.hh"
#include <string>

Go to the source code of this file.

Compounds

class  CdbBdbLoadList

Typedefs

typedef bool(* CdbBdbCreateCondObject )(const char *, BdbRefAny &, BdbRef(BdbObject)&)
 Multiple objects loader.


Typedef Documentation

typedef bool(* CdbBdbCreateCondObject)( const char*, BdbRefAny&, BdbRef(BdbObject)& )
 

Multiple objects loader.

Description: CdbBdbLoadList. is a utility class intended to be used to simplify loading multiple objects in the conditions database. It pulls together code for manipulating date-time strings in one place, avoiding code duplication and hopefully simplifying user code. Unfortunately, the task of loading conditions data is somewhat complicated, so this class is not trivial to use; please read the following instructions carefully!!

File format: CdbBdbLoadList will load a set of objects into a specified container in the conditions database. The list of 'objects' is passed to the constructor of this class in the form of a filename, where each line in the file specifies an 'object'. The filename must be fully specified: we recommend use AbsParmFilename, and passing the value of the 'pathname()' function. The format of the lines in this file is fixed, according to the following perscription:

'RWDate string' ['RWTime string'] ['object specification']

Valid RWDate string formats are described in the Tools.h++ handbook, and include the BaBar standard '01Jan1901' (ddMmmyyyy). Valid RWTime strings are similairly described in the manual and include the BaBar standard '00:00:01' (hh:mm:ss). Valid 'object specification' format is defined by user code, as described below. The object list file may have as many lines of the format above as required to define the desired timeline in the conditions database. The date/times must be in ascending order. The time specified on the line is interpreted as the objects start-validity time, and the time specified on the _following_ line is interpreted as the end-validity time of this object. If there is no new object with start-validity of this 2nd time (IE if you wish to insert 'gaps' into the conditions timeline), simply leave the 'object specification' string blank. The last line in every file must _always_ have a null object specification, to correctly terminate the validity timeline. For instance, to allow the last object specified to have indefinite validity, the last line in the file should be simply "+Infinity". 'Dates' of +Infinity do not need to have a corresponding time, and no object is allowed to have start-validity of +Infinity.

Comments can be inserted anywhere in the object specfication file by starting the line with the "#" character. mid-line comments are not supported.

The times specified in the file are by default assumed to be in UTC. If instead the times correspond to the local time zone (the one in which the program is being run), the following line will change the default:

Zone Local

Please note that the local time zone should only be used if the objects correspond to actual measurments made at the specified time; it should _never_ be used to describe simulation parameters for instance.

Object specification CdbBdbLoadList does not understand how to create an instance of your object. Instead, it defers to a function provided by the user on construction to convert the 'object specification' string to an object. One simple way of doing this is to put the data members for each object in their own file, and have the 'object specification' represent the name of that file. Other strategies may be implemented as appropriate. CdbBdbLoadList does not need to know the type (class) of the object being loaded, as it uses persistent polymorphism. On construction, the user must provide a function of the following prototype: void createObject(const RWCString& object_specification, BdbRefAny& clusterhint, BdbRef(BdbObject)& objecthandle); This function should interpret the object specification as required, and construct a persistent object of the correct type, clustered at the specified, and set the supplied object handle to point to it.

Environment: Software developed for the BaBar Detector at the SLAC B-Factory.

Author List: Dave Brown 04-24-2000 ( original author ) Igor Gaponenko 05-13-2002 ( adapted for the new Condition/DB )

Copyright Information: Copyright (C) 2000, 2002 Lawrence Berkeley National LAboratory

------------------------------------------------------------------------

Definition at line 93 of file CdbBdbLoadList.hh.


Generated on Mon Dec 5 18:22:13 2005 for CDB by doxygen1.3-rc3