1 #ifndef _ots_ConfigurationManagerRW_h_
2 #define _ots_ConfigurationManagerRW_h_
4 #include "otsdaq/ConfigurationInterface/ConfigurationManager.h"
16 std::set<TableVersion> versions_;
22 std::set<TableGroupKey> keys_;
23 std::string latestKeyGroupAuthor_, latestKeyGroupComment_,
24 latestKeyGroupCreationTime_, latestKeyGroupTypeString_;
25 std::map<std::string ,
TableVersion > latestKeyMemberMap_;
32 #define __GETCFG_RW__(X) getConfigurationRW<X>(QUOTE(X))
47 const std::string& getUsername (
void)
const {
return username_; }
50 const std::map<std::string, TableInfo>& getAllTableInfo (
bool refresh =
false, std::string* accumulatedErrors = 0,
const std::string& errorFilterName =
"");
51 std::map<std::string ,
52 std::map<std::string ,
56 T* getConfigurationRW (std::string name) {
return (T*)getTableByName(name); }
57 TableBase* getVersionedTableByName (
const std::string& tableName,
TableVersion version,
bool looseColumnMatching =
false, std::string* accumulatedErrors = 0);
58 TableBase* getTableByName (
const std::string& tableName);
59 TableGroupKey findTableGroup (
const std::string& groupName,
const std::map<std::string, TableVersion>& groupMembers,
60 const std::map<std::string /*name*/, std::string /*alias*/>& groupAliases = std::map<std::string /*name*/, std::string /*alias*/>());
61 TableBase* getMetadataTable (
void) {
return &groupMetadataTable_; }
68 void clearCachedVersions (
const std::string& tableName);
69 void clearAllCachedVersions (
void);
73 void activateTableGroup (
const std::string& configGroupName,
TableGroupKey tableGroupKey, std::string* accumulatedTreeErrors = 0);
80 TableGroupKey saveNewTableGroup (
const std::string& groupName, std::map<std::string, TableVersion>& groupMembers,
81 const std::string& groupComment = TableViewColumnInfo::DATATYPE_COMMENT_DEFAULT,
82 std::map<std::string /*table*/, std::string /*alias*/>* groupAliases = 0);
86 const GroupInfo& getGroupInfo (
const std::string& groupName);
87 const std::map<std::string, GroupInfo>& getAllGroupInfo (
void) {
return allGroupInfo_; }
89 void testXDAQContext (
void);
94 void cacheGroupKey (
const std::string& groupName,
TableGroupKey key);
98 std::map<std::string, TableInfo> allTableInfo_;
99 std::map<std::string, GroupInfo> allGroupInfo_;
111 bool createdTemporaryVersion_;
113 std::string tableName_;
117 __SS__ <<
"impossible!" << std::endl;
121 : createdTemporaryVersion_(
false), modified_(
false), tableName_(tableName)
123 __COUT__ <<
"Creating Table-Edit Struct for " << tableName_ << std::endl;
124 table_ = cfgMgr->getTableByName(tableName_);
126 if(!(originalVersion_ = table_->getView().getVersion()).isTemporaryVersion())
128 __COUT__ <<
"Start version " << originalVersion_ << std::endl;
130 temporaryVersion_ = table_->createTemporaryView(originalVersion_);
131 cfgMgr->saveNewTable(
136 __COUT__ <<
"Created temporary version " << temporaryVersion_ << std::endl;
137 createdTemporaryVersion_ =
true;
140 __COUT__ <<
"Using temporary version " << temporaryVersion_ << std::endl;
142 tableView_ = table_->getViewP();