1 #ifndef _ots_ConfigurationManagerRW_h_
2 #define _ots_ConfigurationManagerRW_h_
4 #include "otsdaq-core/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))
46 const std::string& getUsername(
void)
const {
return username_; }
52 const std::map<std::string, TableInfo>& getAllTableInfo(
54 std::string* accumulatedErrors = 0,
55 const std::string& errorFilterName =
"");
56 std::map<std::string ,
58 getVersionAliases(
void)
const;
61 T* getConfigurationRW(std::string name)
63 return (T*)getTableByName(name);
65 TableBase* getVersionedTableByName(
const std::string& tableName,
67 bool looseColumnMatching =
false);
68 TableBase* getTableByName(
const std::string& tableName);
70 const std::string& groupName,
71 const std::map<std::string, TableVersion>& groupMembers,
72 const std::map<std::string /*name*/, std::string /*alias*/>& groupAliases =
73 std::map<std::string /*name*/, std::string /*alias*/>());
76 return &groupMetadataTable_;
84 const std::string& tableName,
86 bool makeTemporary =
false);
87 TableVersion copyViewToCurrentColumns(
const std::string& tableName,
89 void eraseTemporaryVersion(
const std::string& tableName,
91 void clearCachedVersions(
const std::string& tableName);
92 void clearAllCachedVersions();
97 void activateTableGroup(
const std::string& configGroupName,
99 std::string* accumulatedTreeErrors = 0);
109 const std::string& groupName,
110 std::map<std::string, TableVersion>& groupMembers,
111 const std::string& groupComment = TableViewColumnInfo::DATATYPE_COMMENT_DEFAULT,
112 std::map<std::string /*table*/, std::string /*alias*/>* groupAliases = 0);
116 const GroupInfo& getGroupInfo(
const std::string& groupName);
117 const std::map<std::string, GroupInfo>& getAllGroupInfo() {
return allGroupInfo_; }
124 void cacheGroupKey(
const std::string& groupName,
TableGroupKey key);
128 std::map<std::string, TableInfo> allTableInfo_;
129 std::map<std::string, GroupInfo> allGroupInfo_;
139 bool createdTemporaryVersion_;
141 std::string tableName_;
145 __SS__ <<
"impossible!" << std::endl;
149 : createdTemporaryVersion_(
false), modified_(
false), tableName_(tableName)
151 __COUT__ <<
"Creating Table-Edit Struct for " << tableName_ << std::endl;
152 table_ = cfgMgr->getTableByName(tableName_);
154 if(!(originalVersion_ = table_->getView().getVersion()).isTemporaryVersion())
156 __COUT__ <<
"Start version " << originalVersion_ << std::endl;
158 temporaryVersion_ = table_->createTemporaryView(originalVersion_);
159 cfgMgr->saveNewTable(
164 __COUT__ <<
"Created temporary version " << temporaryVersion_ << std::endl;
165 createdTemporaryVersion_ =
true;
168 __COUT__ <<
"Using temporary version " << temporaryVersion_ << std::endl;
170 tableView_ = table_->getViewP();