Skip to content
Snippets Groups Projects
Commit 27c83bcd authored by mam-mih-val's avatar mam-mih-val
Browse files

Removing

parent 42797b22
No related branches found
No related tags found
2 merge requests!10Template way,!9Template way
#ifndef ANALYSISTREE_BRANCHCONFIG_H
#define ANALYSISTREE_BRANCHCONFIG_H
#include <utility>
#include <vector>
#include <map>
#include <string>
#include <iostream>
#include <RtypesCore.h>
#include <TObject.h>
#include "Constants.h"
namespace AnalysisTree {
template<typename T>
class ContainerConfig{
public:
ContainerConfig() = default;
explicit ContainerConfig(std::string name) : name_(std::move(name)) {};
ContainerConfig(const ContainerConfig &otherContainerConfig) = default;
ContainerConfig(ContainerConfig &&otherContainerConfig) = default;
ContainerConfig& operator=(ContainerConfig&&) = default;
ContainerConfig& operator= (const ContainerConfig &part) = default;
~ContainerConfig() = default;
ShortInt_t GetSize() const { return map_.size(); }
void AddField(const std::string& name) { map_.insert ( std::pair<std::string,ShortInt_t>(name, map_.size()) ); }
void AddField(const std::vector<std::string>& sname) {
for (const auto& name : sname){
map_.insert ( std::pair<std::string,ShortInt_t>(name, map_.size()) );
}
}
ShortInt_t GetId(const std::string& sField) const {
auto search = map_.find(sField);
if (search != map_.end()){
return search->second;
} else {
return UndefValueShort;
}
}
void SetId(ShortInt_t id) { id_ = id; }
ShortInt_t GetId() const { return id_; }
protected:
std::map <std::string, ShortInt_t> map_{};
ClassDef(ContainerConfig::BranchConfig, 1)
};
} // AnalysisTree
#endif //ANALYSISTREE_BRANCHCONFIG_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment