Go to the documentation of this file.
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>
114 return !
value.empty() ? boost::lexical_cast<value_type>(
value)
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>
216 return !
value.empty() ? boost::lexical_cast<value_type>(
value)
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 template<
typename ValueT>
282 template<
typename ValueT>
285 CVParam p = cvParamChild(cvid);
293 std::vector<CVParam> cvParamChildren(CVID cvid)
const;
296 bool hasCVParam(CVID cvid)
const;
299 bool hasCVParamChild(CVID cvid)
const;
304 UserParam userParam(
const std::string&)
const;
316 template <
typename value_type>
319 set(cvid, boost::lexical_cast<std::string>(
value), units);
339 inline void ParamContainer::set<bool>(CVID cvid,
bool value, CVID units)
341 set(cvid, (
value ?
"true" :
"false"), units);
362 #endif // _PARAMTYPES_HPP_
Uncontrolled user parameters (essentially allowing free text). Before using these,...
bool operator!=(const CVParam &that) const
inequality operator
std::string type
the datatype of the parameter, where appropriate (e.g.: xsd:float).
CVParamIsChildOf(CVID cvid)
CVParam(CVID _cvid, unsigned int _value, CVID _units=CVID_Unknown)
CVParam(CVID _cvid, float _value, CVID _units=CVID_Unknown)
std::vector< UserParam > userParams
a collection of uncontrolled user terms
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
value_type valueAs() const
Templated value access with type conversion.
functor for finding children of a specified CVID in a collection of CVParams:
CVID units
an optional CV parameter for the unit term associated with the value, if any (e.g....
ValueT cvParamValueOrDefault(CVID cvid, ValueT defaultValue) const
finds cvid in the container:
CVParam(CVID _cvid=CVID_Unknown)
constructor for non-valued CVParams
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
std::ostream & operator<<(std::ostream &os, const Diff< object_type, config_type > &diff)
stream insertion of Diff results
value_type valueAs() const
templated value access with type conversion
boost::shared_ptr< ParamGroup > ParamGroupPtr
std::string id
the identifier with which to reference this ReferenceableParamGroup.
The base class for elements that may contain cvParams, userParams, or paramGroup references.
bool operator()(const CVParam ¶m) const
CVParam(CVID _cvid, int _value, CVID _units=CVID_Unknown)
std::string value
the value for the parameter, where appropriate.
functor for finding CVParam with specified exact CVID in a collection of CVParams:
void set(CVID cvid, value_type value, CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
CVParam(CVID _cvid, unsigned long _value, CVID _units=CVID_Unknown)
bool operator()(const CVParam ¶m) const
PWIZ_API_DECL bool cvIsA(CVID child, CVID parent)
returns true iff child IsA parent in the CV
CVParam(CVID _cvid, double _value, CVID _units=CVID_Unknown)
toType lexical_cast(const std::string &str, bool &success)
bool operator==(const CVParam &that) const
equality operator
CVParam(CVID _cvid, const char *_value, CVID _units=CVID_Unknown)
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
CVParam(CVID _cvid, long _value, CVID _units=CVID_Unknown)
ValueT cvParamChildValueOrDefault(CVID cvid, ValueT defaultValue) const
finds child of cvid in the container:
CVParam(CVID _cvid, bool _value, CVID _units=CVID_Unknown)
special case for bool (no lexical_cast)
represents a tag-value pair, where the tag comes from the controlled vocabulary
CVParam(CVID _cvid, std::string _value, CVID _units=CVID_Unknown)
PWIZ_API_DECL bool operator!=(const TruncatedLorentzianParameters &t, const TruncatedLorentzianParameters &u)
bool operator==(const SampleDatum< abscissa_type, ordinate_type > &a, const SampleDatum< abscissa_type, ordinate_type > &b)
std::string name
the name for the parameter.
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms