21 for (
int i = 0, N = names.size(); i < N; ++i ) {
22 string name = names[i];
24 std::ostringstream oss;
30 throw std::logic_error(
"GenRunInfo::set_weight_names: " 31 "Duplicate weight name '" + name +
39 std::map< std::string, shared_ptr<Attribute> >::iterator i =
m_attributes.find(name);
42 if( !i->second )
return string();
45 i->second->to_string(ret);
56 typedef std::map<std::string, shared_ptr<Attribute> >::value_type att_val_t;
60 vt.second->to_string(att);
88 for(
unsigned int i=0; i<data.
tool_name.size(); ++i) {
94 this->
tools().push_back(ti);
103 std::lock_guard<std::recursive_mutex> lhs_lk(
m_lock_attributes, std::adopt_lock);
104 std::lock_guard<std::recursive_mutex> rhs_lk(r.
m_lock_attributes, std::adopt_lock);
110 GenRunInfo& GenRunInfo::operator=(
const GenRunInfo& r)
115 std::lock_guard<std::recursive_mutex> lhs_lk(
m_lock_attributes, std::adopt_lock);
116 std::lock_guard<std::recursive_mutex> rhs_lk(r.m_lock_attributes, std::adopt_lock);
117 GenRunInfoData tdata;
Definition of class GenRunInfo.
GenRunInfo()
Default constructor.
std::recursive_mutex m_lock_attributes
Mutex lock for the m_attibutes map.
std::vector< std::string > m_weight_names
A vector of weight names.
void set_weight_names(const std::vector< std::string > &names)
Set the names of the weights in this run.
std::vector< std::string > attribute_name
Attribute name.
Stores run-related information.
const std::vector< std::string > & weight_names() const
Get the vector of weight names.
const std::vector< ToolInfo > & tools() const
The vector of tools used to produce this run.
std::map< std::string, int > m_weight_indices
A map of weight names mapping to indices.
bool has_weight(const string &name) const
Check if a weight name is present.
void read_data(const GenRunInfoData &data)
Fill GenRunInfo based on GenRunInfoData.
std::vector< std::string > attribute_string
Attribute serialized as string.
std::vector< std::string > tool_name
Tool names.
void write_data(GenRunInfoData &data) const
Fill GenRunInfoData object.
Stores serializable run information.
void add_attribute(const string &name, const shared_ptr< Attribute > &att)
add an attribute This will overwrite existing attribute if an attribute with the same name is present
std::vector< std::string > tool_version
Tool versions.
string attribute_as_string(const string &name) const
Get attribute of any type as string.
std::vector< std::string > weight_names
Weight names.
std::map< std::string, shared_ptr< Attribute > > m_attributes
Map of attributes.
std::vector< std::string > tool_description
Tool descriptions.
Definition of struct GenRunInfoData.