Ariles
Classes | Namespaces | Macros | Functions
reader.cpp File Reference

Detailed Description

Author
Alexander Sherikov

Definition in file reader.cpp.

Go to the source code of this file.

#include <boost/lexical_cast.hpp>
#include "common.h"

Classes

class  ariles2::ns_rosparam::impl::Reader
 

Namespaces

 ariles2
 
 ariles2::ns_rosparam
 
 ariles2::ns_rosparam::impl
 

Macros

#define ARILES2_BASIC_TYPE(type)
 
#define ARILES2_BASIC_TYPE(type)
 
#define ARILES2_BASIC_TYPE(type)
 

Functions

 ariles2::ns_rosparam::CPPUT_MACRO_SUBSTITUTE (ARILES2_BASIC_SIGNED_INTEGER_TYPES_LIST) CPPUT_MACRO_SUBSTITUTE(ARILES2_BASIC_UNSIGNED_INTEGER_TYPES_LIST) CPPUT_MACRO_SUBSTITUTE(ARILES2_BASIC_REAL_TYPES_LIST) void Reader
 

Macro Definition Documentation

◆ ARILES2_BASIC_TYPE [1/3]

#define ARILES2_BASIC_TYPE (   type)
Value:
void Reader::readElement(type &element) \
{ \
CPPUT_ASSERT(impl_->getRawNode().getType() == XmlRpc::XmlRpcValue::TypeInt, "Integer type expected."); \
int tmp_value = static_cast<int>(impl_->getRawNode()); \
CPPUT_ASSERT( \
static_cast<int64_t>(tmp_value) <= std::numeric_limits<type>::max() \
&& static_cast<int64_t>(tmp_value) >= std::numeric_limits<type>::min(), \
"Value is out of range."); \
element = static_cast<type>(tmp_value); \
}

Definition at line 175 of file reader.cpp.

◆ ARILES2_BASIC_TYPE [2/3]

#define ARILES2_BASIC_TYPE (   type)
Value:
void Reader::readElement(type &element) \
{ \
CPPUT_ASSERT(impl_->getRawNode().getType() == XmlRpc::XmlRpcValue::TypeInt, "Integer type expected."); \
int tmp_value = static_cast<int>(impl_->getRawNode()); \
CPPUT_ASSERT(tmp_value >= 0, "Expected positive value."); \
CPPUT_ASSERT(static_cast<uint64_t>(tmp_value) <= std::numeric_limits<type>::max(), "Value is too large."); \
element = static_cast<type>(tmp_value); \
}

Definition at line 175 of file reader.cpp.

◆ ARILES2_BASIC_TYPE [3/3]

#define ARILES2_BASIC_TYPE (   type)
Value:
void Reader::readElement(type &element) \
{ \
switch (impl_->getRawNode().getType()) \
{ \
case XmlRpc::XmlRpcValue::TypeDouble: \
element = static_cast<double>(impl_->getRawNode()); \
break; \
case XmlRpc::XmlRpcValue::TypeString: \
element = boost::lexical_cast<double>(static_cast<std::string>(impl_->getRawNode())); \
break; \
case XmlRpc::XmlRpcValue::TypeInt: \
element = static_cast<int>(impl_->getRawNode()); \
break; \
default: \
CPPUT_THROW("Could not convert value to type."); \
break; \
} \
}

Definition at line 175 of file reader.cpp.