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
00054
00055
00056
00057
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);
00075 template <class T>
00076 void convert( ISInfoAny & isa, std::vector<std::string> & to );
00077
00078 void fillTypes( );
00079
00080
00081 private:
00082
00083 cdiAux mout;
00084 IPCPartition partition;
00085
00086 std::string m_fName;
00087
00088
00089 std::string m_ConnStr;
00090
00091
00092 cool::IDatabaseSvc* m_dbSvc;
00093
00094
00095 cool::DatabaseId m_dbId;
00096
00097
00098 cool::IDatabasePtr m_db;
00099
00100
00101 cool::IFolderPtr m_fld;
00102
00103
00104
00105 std::map <ISType::Basic, std::string> m_dTypes;
00106
00107
00108
00109
00110
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