24 explicit Writer(const ::ros::NodeHandle &nh)
46 if (XmlRpc::XmlRpcValue::TypeInvalid ==
impl_->root_value_.getType())
48 impl_->root_value_ =
"";
51 impl_->root_name_.clear();
58 if (0 ==
impl_->node_stack_.size())
60 impl_->root_name_ = map_name;
61 impl_->node_stack_.push_back(&
impl_->root_value_);
72 impl_->node_stack_.pop_back();
78 impl_->getRawNode().setSize(size);
84 ARILES_ASSERT(
true ==
impl_->node_stack_.back().isArray(),
"Internal error: expected array.");
86 impl_->node_stack_.back().index_ <
impl_->node_stack_.back().size_,
87 "Internal error: array has more elements than expected.");
88 ++
impl_->node_stack_.back().index_;
93 impl_->node_stack_.pop_back();
98 void Writer::writeElement(
const bool &element)
100 impl_->getRawNode() = element;
104 void Writer::writeElement(
const std::string &element)
106 impl_->getRawNode() = element;
114 impl_->root_name_ =
"";
115 impl_->root_value_.clear();
117 if (
true == name.empty())
134 #define ARILES_BASIC_TYPE(type) \ 135 void Writer::writeElement(const type &element) \ 137 impl_->getRawNode() = element; \ 142 #undef ARILES_BASIC_TYPE 146 #define ARILES_BASIC_TYPE(type) \ 147 void Writer::writeElement(const type &element) \ 150 static_cast<int64_t>(element) <= std::numeric_limits<int>::max() \ 151 && static_cast<int64_t>(element) >= static_cast<int64_t>(std::numeric_limits<int>::min()), \ 152 "Value is out of range."); \ 153 impl_->getRawNode() = static_cast<int>(element); \ 158 #undef ARILES_BASIC_TYPE 161 #define ARILES_BASIC_TYPE(type) \ 162 void Writer::writeElement(const type &element) \ 165 static_cast<uint64_t>(element) <= static_cast<uint64_t>(std::numeric_limits<int>::max()), \ 166 "Value is too large."); \ 167 impl_->getRawNode() = static_cast<int>(element); \ 172 #undef ARILES_BASIC_TYPE #define ARILES_TRACE_FUNCTION
#define ARILES_BASIC_UNSIGNED_INTEGER_TYPES_LIST
Writer(const ::ros::NodeHandle &nh)
void startRoot(const std::string &name)
ariles::Node< XmlRpc::XmlRpcValue * > NodeWrapper
#define ARILES_BASIC_SIGNED_INTEGER_TYPES_LIST
void startArray(const std::size_t size, const bool=false)
#define ARILES_BASIC_REAL_TYPES_LIST
ARILES_MACRO_SUBSTITUTE(ARILES_BASIC_SIGNED_INTEGER_TYPES_LIST) ARILES_MACRO_SUBSTITUTE(ARILES_BASIC_UNSIGNED_INTEGER_TYPES_LIST) ARILES_MACRO_SUBSTITUTE(ARILES_BASIC_REAL_TYPES_LIST) void Reader
void flush()
Flush the configuration to the output.
Writer(const ::ros::NodeHandle &nh)
#define ARILES_VISIBILITY_ATTRIBUTE
ARILES_SHARED_PTR< impl::Writer > ImplPtr
void endRoot(const std::string &name)
void descend(const std::string &map_name)
Starts a nested map in the configuration file.