cdiCOOLDataHandle.h

00001 #ifndef CDICOOLDATAHANDLE_H
00002 #define CDICOOLDATAHANDLE_H
00010 
00011 
00012 
00013 namespace cool {
00014   class IDatabase;
00015 };
00016 
00017 namespace pool {
00018   class AttributeListSpecification;
00019 };
00020 
00021 namespace seal {
00022   class Exception;
00023 };
00024 
00025 #include "CoolKernel/IDatabaseSvc.h"
00026 #include <CoolKernel/DatabaseId.h>
00027 #include <CoolKernel/types.h>
00028 
00029 #include "CoolKernel/IFolder.h"
00030 
00031 #include "cdi/cdiAux.h"
00032 #include "cdi/cdiHandle.h"
00033 
00034 #include <is/info.h>
00035 #include <vector>
00036 #include <map>
00037 #include <is/infodocument.h>
00038 #include <is/infodictionary.h>
00039 #include <is/inforeceiver.h>
00040 
00041 class cdiCOOLDataHandle : public cdiHandle
00042 {  
00043  public:
00044   
00045   cdiCOOLDataHandle ( int verbosity, const IPCPartition & partition,  const std::string confName = "RunParams.Conditions" );
00046   
00047   void getConfig ( std::vector<std::string> & names );  
00048   void process_data ( const std::string & name, ISCallbackInfo * isc );
00049 
00050   void storeObject ( const std::string& name, ISInfoAny &isa);
00051 
00052   /*
00053   std::string getConfName() const {
00054     if (configuration_name.size() != 0)
00055       return configuration_name;
00056     else
00057       return "";
00058   }
00059   */
00060  private:
00061 
00062 
00063   void loadSEALModules();
00064   
00065   std::string dumpFailure(  ISInfo::Status status );
00066 
00067   void get_folder_specs(std::string folder, pool::AttributeListSpecification &payloadSpec);
00068   bool existDB(std::string dbProfile);
00069   std::string getProfile ( );
00070   void init ( const std::string & profile );
00071   void create_folder ( const std::string & name, ISInfoAny & isa );
00072   void add_table ( pool::AttributeListSpecification &table, const std::string & name );
00073   bool is_table_exist ( const std::string & name );
00074   void convertTime (ISInfoAny & isAny, seal::IntBits<64>::ULeast &time);//unsigned long &time);
00075   template <class T>
00076     void convert( ISInfoAny & isa, std::vector<std::string> & to );
00077 
00078   void fillTypes( ); 
00079 
00080   // private members
00081  private:
00082   
00083   cdiAux    mout;
00084   IPCPartition  partition;
00085   
00086   std::string m_fName;
00087 
00088   // the connection string....not needed any more
00089   std::string m_ConnStr;
00090 
00091   // the services that are mostly used in COOL
00092   cool::IDatabaseSvc* m_dbSvc; 
00093 
00094   // this is the identifier that will hold the connection string
00095   cool::DatabaseId m_dbId;
00096   
00097   // This is the Database Pointer.Every operation in a database shall use this variable
00098   cool::IDatabasePtr m_db;  
00099   
00100   // This is the folder where data will be stored
00101   cool::IFolderPtr m_fld;
00102 
00103   // we will store the data type name as of the 
00104   // attribute list specification
00105   std::map <ISType::Basic, std::string> m_dTypes;
00106   
00107   // variable that will hold an attribute list for each folder
00108   //  std::map <std::string,pool::AttributeList> m_Tables;
00109   // instead of holding the AttributeList it holds simply the schema of the table
00110   // (aka AttributeListSpecification)
00111   std::map <std::string,pool::AttributeListSpecification> m_Tables;
00112   std::vector<std::string> m_objs;
00113  public:
00114   const std::string configuration_name;
00115 
00116 
00117 };
00118 #endif //CDIDATAHANDLE_H
00119 

Generated on Mon Feb 6 14:01:17 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6