21 for (
int i = 0, N = names.size(); i < N; ++i ) {
22 std::string
name = names[i];
24 std::ostringstream oss;
30 throw std::logic_error(
"GenRunInfo::set_weight_names: "
31 "Duplicate weight name '" + name +
42 if( !i->second )
return std::string();
45 i->second->to_string(ret);
56 typedef std::map<std::string, std::shared_ptr<Attribute> >::value_type att_val_t;
60 vt.second->to_string(att);
76 std::vector<std::string> results;
78 results.push_back( vt1.first );
97 for(
unsigned int i=0; i<data.
tool_name.size(); ++i) {
103 this->
tools().push_back(ti);
112 std::lock_guard<std::recursive_mutex> lhs_lk(
m_lock_attributes, std::adopt_lock);
113 std::lock_guard<std::recursive_mutex> rhs_lk(r.
m_lock_attributes, std::adopt_lock);
124 std::lock_guard<std::recursive_mutex> lhs_lk(
m_lock_attributes, std::adopt_lock);
125 std::lock_guard<std::recursive_mutex> rhs_lk(r.
m_lock_attributes, std::adopt_lock);
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.
void write_data(GenRunInfoData &data) const
Fill GenRunInfoData object.
std::vector< std::string > attribute_names() const
Get list of attribute names.
Stores run-related information.
GenRunInfo & operator=(const GenRunInfo &r)
Assignmet.
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 std::string &name) const
Check if a weight name is present.
void add_attribute(const std::string &name, const std::shared_ptr< Attribute > &att)
add an attribute This will overwrite existing attribute if an attribute with the same name is present...
std::string attribute_as_string(const std::string &name) const
Get attribute of any type as string.
std::map< std::string, std::shared_ptr< Attribute > > m_attributes
Map of attributes.
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.
Stores serializable run information.
std::vector< std::string > tool_version
Tool versions.
Annotation for function names.
std::vector< std::string > weight_names
Weight names.
std::vector< std::string > tool_description
Tool descriptions.
Definition of struct GenRunInfoData.