26#include <boost/format.hpp>
28#include <SimoxUtility/algorithm/string/string_tools.h>
37 this->header = header;
42 this->header = header;
49 for (
const auto& [target, expr] : list)
58 this->initList.push_back(boost::str(boost::format(
"%s(%s)") % target % expr));
96 writer->body.line(header);
98 if (simox::alg::ends_with(simox::alg::trim_copy(header),
";"))
106 for (
size_t i = 0; i < initList.size(); i++)
108 writer->body.line(boost::str(boost::format(
"%s%s%s") % (i == 0 ?
": " :
" ") %
109 initList.at(i) % (i < initList.size() - 1 ?
"," :
"")),
113 auto writeBlock = [
this, writer]()
117 block->writeCpp(writer);
139 this->enforceBlockGeneration = enforceBlockGeneration;
void addInitListEntry(const std::string &target, const std::string &expr)
void addInitListEntries(const std::vector< std::pair< std::string, std::string > > &)
CppBlockPtr getBlock() const
CppCtor(const std::string &header)
void writeCpp(const CppWriterPtr &writer)
void addLine(const std::string &line)
void setEnforceBlockGeneration(bool enforceBlockGeneration)
void setBlock(const CppBlockPtr &)
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< CppWriter > CppWriterPtr
std::shared_ptr< CppBlock > CppBlockPtr