ome-xml  5.6.0
Classes | Functions
ome::xml::model::detail Namespace Reference

Implementation details. More...

Classes

struct  is_shared_ptr
 Type trait for shared_ptr. More...
 
struct  is_shared_ptr< std::shared_ptr< T > >
 Type trait for shared_ptr. More...
 
class  OMEModel
 OME model (concrete implementation). More...
 
class  OMEModelObject
 OME model object (concrete implementation). More...
 

Functions

void parse_value_fail (const std::string &text, const std::string &klass, const std::string &property)
 Throw a model exception with an informative message. More...
 
template<typename T >
void parse_value (const std::string &text, T &value, const std::string &klass, const std::string &property)
 Parse an arbitrary value. More...
 
template<>
void parse_value< bool > (const std::string &text, bool &value, const std::string &klass, const std::string &property)
 Parse a Boolean value. More...
 
template<>
void parse_value< std::string > (const std::string &text, std::string &value, const std::string &klass, const std::string &property)
 Parse a string value. More...
 
template<typename T >
std::enable_if< !is_shared_ptr< T >::value, typename std::remove_const< typename boost::remove_reference< T >::type >::type >::type parse_value (const std::string &text, const std::string &klass, const std::string &property)
 Parse an arbitrary value. More...
 
template<typename T >
std::enable_if< is_shared_ptr< T >::value, typename std::remove_const< typename boost::remove_reference< T >::type >::type >::type parse_value (const std::string &text, const std::string &klass, const std::string &property)
 Parse an arbitrary shared_ptr value. More...
 
template<class C , typename T >
void set_value (const std::string &text, C &object, void(C::*setter)(T value), const std::string &klass, const std::string &property)
 Set an arbitrary value. More...
 
template<typename T >
std::enable_if< !is_shared_ptr< T >::value, typename std::remove_const< typename boost::remove_reference< T >::type >::type >::type parse_quantity (const std::string &text, const std::string &unit, const std::string &klass, const std::string &property)
 Parse an arbitrary quantity. More...
 
template<typename T >
std::enable_if< is_shared_ptr< T >::value, typename std::remove_const< typename boost::remove_reference< T >::type >::type >::type parse_quantity (const std::string &text, const std::string &unit, const std::string &klass, const std::string &property)
 Parse an arbitrary shared_ptr quantity. More...
 
template<class C , typename T >
void set_quantity (const std::string &text, const std::string &unit, C &object, void(C::*setter)(T value), const std::string &klass, const std::string &property)
 Set an arbitrary quantity. More...
 

Detailed Description

Implementation details.

Default concrete implementations of interfaces in the parent namespace.

Function Documentation

◆ parse_quantity() [1/2]

template<typename T >
std::enable_if< !is_shared_ptr<T>::value, typename std::remove_const<typename boost::remove_reference<T>::type>::type >::type ome::xml::model::detail::parse_quantity ( const std::string &  text,
const std::string &  unit,
const std::string &  klass,
const std::string &  property 
)
inline

Parse an arbitrary quantity.

Parameters
textthe text to parse.
unitthe unit symbol name to parse.
klassthe class owning the property.
propertythe property name.
Returns
the parsed quantity.
Exceptions
aModelException on failure.

References parse_value().

◆ parse_quantity() [2/2]

template<typename T >
std::enable_if< is_shared_ptr<T>::value, typename std::remove_const<typename boost::remove_reference<T>::type>::type >::type ome::xml::model::detail::parse_quantity ( const std::string &  text,
const std::string &  unit,
const std::string &  klass,
const std::string &  property 
)
inline

Parse an arbitrary shared_ptr quantity.

Parameters
textthe text to parse.
unitthe unit symbol name to parse.
klassthe class owning the property.
propertythe property name.
Returns
the parsed quantity.
Exceptions
aModelException on failure.

References parse_value().

◆ parse_value() [1/3]

template<typename T >
void ome::xml::model::detail::parse_value ( const std::string &  text,
T &  value,
const std::string &  klass,
const std::string &  property 
)
inline

Parse an arbitrary value.

Parameters
textthe text to parse.
valuethe variable to store the parsed value.
klassthe class owning the property.
propertythe property name.
Exceptions
aModelException on failure.

References parse_value_fail().

Referenced by parse_quantity(), and parse_value().

+ Here is the caller graph for this function:

◆ parse_value() [2/3]

template<typename T >
std::enable_if< !is_shared_ptr<T>::value, typename std::remove_const<typename boost::remove_reference<T>::type>::type >::type ome::xml::model::detail::parse_value ( const std::string &  text,
const std::string &  klass,
const std::string &  property 
)
inline

Parse an arbitrary value.

Parameters
textthe text to parse.
klassthe class owning the property.
propertythe property name.
Returns
the parsed value.
Exceptions
aModelException on failure.

References parse_value().

◆ parse_value() [3/3]

template<typename T >
std::enable_if< is_shared_ptr<T>::value, typename std::remove_const<typename boost::remove_reference<T>::type>::type >::type ome::xml::model::detail::parse_value ( const std::string &  text,
const std::string &  klass,
const std::string &  property 
)
inline

Parse an arbitrary shared_ptr value.

Parameters
textthe text to parse.
klassthe class owning the property.
propertythe property name.
Returns
the parsed value.
Exceptions
aModelException on failure.

References parse_value().

◆ parse_value< bool >()

template<>
void ome::xml::model::detail::parse_value< bool > ( const std::string &  text,
bool &  value,
const std::string &  klass,
const std::string &  property 
)
inline

Parse a Boolean value.

Parameters
textthe text to parse.
valuethe variable to store the parsed value.
klassthe class owning the property.
propertythe property name.
Exceptions
aModelException on failure.

References parse_value_fail().

◆ parse_value< std::string >()

template<>
void ome::xml::model::detail::parse_value< std::string > ( const std::string &  text,
std::string &  value,
const std::string &  klass,
const std::string &  property 
)
inline

Parse a string value.

Parameters
textthe text to parse.
valuethe variable to store the parsed value.
klassthe class owning the property.
propertythe property name.
Exceptions
aModelException on failure.

◆ parse_value_fail()

void ome::xml::model::detail::parse_value_fail ( const std::string &  text,
const std::string &  klass,
const std::string &  property 
)

Throw a model exception with an informative message.

Parameters
textthe property text value which failed to parse.
klassthe class owning the property.
propertythe property name.
Exceptions
aModelException.

Referenced by parse_value(), and parse_value< bool >().

+ Here is the caller graph for this function:

◆ set_quantity()

template<class C , typename T >
void ome::xml::model::detail::set_quantity ( const std::string &  text,
const std::string &  unit,
C &  object,
void(C::*)(T value)  setter,
const std::string &  klass,
const std::string &  property 
)
inline

Set an arbitrary quantity.

The type to set will be obtained from the setter argument type.

Parameters
textthe text to parse.
unitthe unit to use.
objecton which to set the parsed value.
setterthe class method to call to set the parsed value.
klassthe class owning the property.
propertythe property name.
Exceptions
aModelException on failure.

◆ set_value()

template<class C , typename T >
void ome::xml::model::detail::set_value ( const std::string &  text,
C &  object,
void(C::*)(T value)  setter,
const std::string &  klass,
const std::string &  property 
)
inline

Set an arbitrary value.

The type to set will be obtained from the setter argument type.

Parameters
textthe text to parse.
objecton which to set the parsed value.
setterthe class method to call to set the parsed value.
klassthe class owning the property.
propertythe property name.
Exceptions
aModelException on failure.