ProteoWizard
Public Member Functions | Public Attributes | List of all members
pwiz::data::UserParam Struct Reference

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. More...

#include <ParamTypes.hpp>

Public Member Functions

 UserParam (const std::string &_name="", const std::string &_value="", const std::string &_type="", CVID _units=CVID_Unknown)
 
 ~UserParam ()
 
 UserParam (const UserParam &other)
 
UserParamoperator= (const UserParam &rhs)
 
double timeInSeconds () const
 convenience function to return time in seconds (throws if units not a time unit) More...
 
template<typename value_type >
value_type valueAs () const
 Templated value access with type conversion. More...
 
bool empty () const
 returns true iff name, value, type, and units are all empty More...
 
bool operator== (const UserParam &that) const
 returns true iff name, value, type, and units are all pairwise equal More...
 
bool operator!= (const UserParam &that) const
 returns !(this==that) More...
 
template<>
bool valueAs () const
 

Public Attributes

std::string name
 the name for the parameter. More...
 
std::string value
 the value for the parameter, where appropriate. More...
 
std::string type
 the datatype of the parameter, where appropriate (e.g.: xsd:float). More...
 
CVID units
 an optional CV parameter for the unit term associated with the value, if any (e.g. MS_electron_volt). More...
 

Detailed Description

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.

Definition at line 185 of file ParamTypes.hpp.

Constructor & Destructor Documentation

§ UserParam() [1/2]

pwiz::data::UserParam::UserParam ( const std::string &  _name = "",
const std::string &  _value = "",
const std::string &  _type = "",
CVID  _units = CVID_Unknown 
)

§ ~UserParam()

pwiz::data::UserParam::~UserParam ( )

§ UserParam() [2/2]

pwiz::data::UserParam::UserParam ( const UserParam other)

Member Function Documentation

§ operator=()

UserParam& pwiz::data::UserParam::operator= ( const UserParam rhs)

§ timeInSeconds()

double pwiz::data::UserParam::timeInSeconds ( ) const

convenience function to return time in seconds (throws if units not a time unit)

§ valueAs() [1/2]

template<typename value_type >
value_type pwiz::data::UserParam::valueAs ( ) const
inline

Templated value access with type conversion.

Definition at line 214 of file ParamTypes.hpp.

References boost::lexical_cast(), pwiz::frequency::operator!=(), pwiz::data::operator==(), and pwiz::msdata::id::value().

Referenced by testParamContainer().

215  {
216  return !value.empty() ? boost::lexical_cast<value_type>(value)
217  : boost::lexical_cast<value_type>(0);
218  }
std::string value
the value for the parameter, where appropriate.
Definition: ParamTypes.hpp:191
float lexical_cast(const std::string &str)

§ empty()

bool pwiz::data::UserParam::empty ( ) const

returns true iff name, value, type, and units are all empty

Referenced by test(), testParamContainer(), and testUserParam().

§ operator==()

bool pwiz::data::UserParam::operator== ( const UserParam that) const

returns true iff name, value, type, and units are all pairwise equal

§ operator!=()

bool pwiz::data::UserParam::operator!= ( const UserParam that) const

returns !(this==that)

§ valueAs() [2/2]

template<>
bool pwiz::data::UserParam::valueAs ( ) const
inline

Definition at line 233 of file ParamTypes.hpp.

References pwiz::msdata::id::value().

234 {
235  return value == "true";
236 }
std::string value
the value for the parameter, where appropriate.
Definition: ParamTypes.hpp:191

Member Data Documentation

§ name

std::string pwiz::data::UserParam::name

§ value

std::string pwiz::data::UserParam::value

§ type

std::string pwiz::data::UserParam::type

the datatype of the parameter, where appropriate (e.g.: xsd:float).

Definition at line 194 of file ParamTypes.hpp.

Referenced by pwiz::tradata::TextWriter::operator()(), pwiz::msdata::TextWriter::operator()(), pwiz::identdata::TextWriter::operator()(), test(), and testUserParam().

§ units

CVID pwiz::data::UserParam::units

an optional CV parameter for the unit term associated with the value, if any (e.g. MS_electron_volt).

Definition at line 197 of file ParamTypes.hpp.

Referenced by pwiz::tradata::TextWriter::operator()(), pwiz::msdata::TextWriter::operator()(), pwiz::identdata::TextWriter::operator()(), and testUserParam().


The documentation for this struct was generated from the following file: