24 #ifndef _PARAMTYPES_HPP_ 25 #define _PARAMTYPES_HPP_ 33 #include <boost/shared_ptr.hpp> 100 : cvid(_cvid), value(_value ?
"true" :
"false"), units(_units)
111 template<
typename value_type>
115 : boost::lexical_cast<value_type>(0);
119 std::string name()
const;
122 std::string unitsName()
const;
125 double timeInSeconds()
const;
128 std::string valueFixedNotation()
const;
175 inline bool CVParam::valueAs<bool>()
const 177 return value ==
"true";
200 const std::string& _value =
"",
201 const std::string& _type =
"",
210 double timeInSeconds()
const;
213 template<
typename value_type>
217 : boost::lexical_cast<value_type>(0);
233 inline bool UserParam::valueAs<bool>()
const 235 return value ==
"true";
259 CVParam cvParam(CVID cvid)
const;
265 CVParam cvParamChild(CVID cvid)
const;
271 std::vector<CVParam> cvParamChildren(CVID cvid)
const;
274 bool hasCVParam(CVID cvid)
const;
277 bool hasCVParamChild(CVID cvid)
const;
282 UserParam userParam(
const std::string&)
const;
294 template <
typename value_type>
317 inline void ParamContainer::set<bool>(CVID cvid,
bool value, CVID units)
319 set(cvid, (value ?
"true" :
"false"), units);
340 #endif // _PARAMTYPES_HPP_
bool operator()(const CVParam ¶m) const
boost::shared_ptr< ParamGroup > ParamGroupPtr
CVParam(CVID _cvid, double _value, CVID _units=CVID_Unknown)
CVParam(CVID _cvid, const char *_value, CVID _units=CVID_Unknown)
std::string value
the value for the parameter, where appropriate.
std::ostream & operator<<(std::ostream &os, const Diff< object_type, config_type > &diff)
stream insertion of Diff results
CVParam(CVID _cvid, long _value, CVID _units=CVID_Unknown)
functor for finding children of a specified CVID in a collection of CVParams:
std::string id
the identifier with which to reference this ReferenceableParamGroup.
CVParamIsChildOf(CVID cvid)
CVParam(CVID _cvid, unsigned long _value, CVID _units=CVID_Unknown)
float lexical_cast(const std::string &str)
bool operator()(const CVParam ¶m) const
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
CVParam(CVID _cvid, float _value, CVID _units=CVID_Unknown)
CVParam(CVID _cvid, bool _value, CVID _units=CVID_Unknown)
special case for bool (no lexical_cast)
std::vector< UserParam > userParams
a collection of uncontrolled user terms
std::string type
the datatype of the parameter, where appropriate (e.g.: xsd:float).
The base class for elements that may contain cvParams, userParams, or paramGroup references.
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms
bool operator!=(const CVParam &that) const
inequality operator
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
CVParam(CVID _cvid=CVID_Unknown)
constructor for non-valued CVParams
std::string name
the name for the parameter.
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
CVID units
an optional CV parameter for the unit term associated with the value, if any (e.g. MS_electron_volt).
bool operator==(const SampleDatum< abscissa_type, ordinate_type > &a, const SampleDatum< abscissa_type, ordinate_type > &b)
CVParam(CVID _cvid, std::string _value, CVID _units=CVID_Unknown)
value_type valueAs() const
Templated value access with type conversion.
CVParam(CVID _cvid, unsigned int _value, CVID _units=CVID_Unknown)
PWIZ_API_DECL std::string value(const std::string &id, const std::string &name)
convenience function to extract a named value from an id string
PWIZ_API_DECL bool operator!=(const TruncatedLorentzianParameters &t, const TruncatedLorentzianParameters &u)
value_type valueAs() const
templated value access with type conversion
functor for finding CVParam with specified exact CVID in a collection of CVParams: ...
bool operator==(const CVParam &that) const
equality operator
PWIZ_API_DECL bool cvIsA(CVID child, CVID parent)
returns true iff child IsA parent in the CV
represents a tag-value pair, where the tag comes from the controlled vocabulary
CVParam(CVID _cvid, int _value, CVID _units=CVID_Unknown)