Skip to content
Snippets Groups Projects
Commit 42a16b21 authored by Fabian Tërnava's avatar Fabian Tërnava
Browse files

added correct namespaces

parent 11cb98d1
No related branches found
No related tags found
No related merge requests found
......@@ -209,7 +209,7 @@ namespace armarx::aron::codegenerator::cpp
doc << "@brief writeType() - This method returns a new type from the class structure using a type writer implementation. This function is static. \n";
doc << "@return - the result of the writer implementation";
CppMethodPtr m = CppMethodPtr(new CppMethod("template<class WriterT>\nstatic typename WriterT::ReturnType writeType(WriterT& " + ARON_WRITER_ACCESSOR + ", std::vector<std::string> " + ARON_TEMPLATE_INSTANTIATIONS_ACCESSOR + " = {}, armarx::aron::type::Maybe "+ ARON_MAYBE_TYPE_ACCESSOR +" = armarx::aron::type::Maybe::NONE, const armarx::aron::Path& "+ARON_PATH_ACCESSOR+" = armarx::aron::Path())", doc.str()));
CppMethodPtr m = CppMethodPtr(new CppMethod("template<class WriterT>\nstatic typename WriterT::ReturnType writeType(WriterT& " + ARON_WRITER_ACCESSOR + ", std::vector<std::string> " + ARON_TEMPLATE_INSTANTIATIONS_ACCESSOR + " = {}, armarx::aron::type::Maybe "+ ARON_MAYBE_TYPE_ACCESSOR +" = ::armarx::aron::type::Maybe::NONE, const ::armarx::aron::Path& "+ARON_PATH_ACCESSOR+" = ::armarx::aron::Path())", doc.str()));
CppBlockPtr b = std::make_shared<CppBlock>();
b->addLine("using _Aron_T [[maybe_unused]] = typename WriterT::ReturnType;");
......@@ -226,7 +226,7 @@ namespace armarx::aron::codegenerator::cpp
doc << "@param w - The writer implementation\n";
doc << "@return - the result of the writer implementation";
CppMethodPtr m = CppMethodPtr(new CppMethod("template<class WriterT>\ntypename WriterT::ReturnType write(WriterT& " + ARON_WRITER_ACCESSOR + ", const armarx::aron::Path& "+ARON_PATH_ACCESSOR+" = armarx::aron::Path()) const", doc.str()));
CppMethodPtr m = CppMethodPtr(new CppMethod("template<class WriterT>\ntypename WriterT::ReturnType write(WriterT& " + ARON_WRITER_ACCESSOR + ", const ::armarx::aron::Path& "+ARON_PATH_ACCESSOR+" = armarx::aron::Path()) const", doc.str()));
CppBlockPtr b = std::make_shared<CppBlock>();
b->addLine("using _Aron_T [[maybe_unused]] = typename WriterT::ReturnType;");
......@@ -234,7 +234,7 @@ namespace armarx::aron::codegenerator::cpp
std::string dummy;
b->addBlock(this->getWriteBlock("", Path(), dummy));
b->addLine("catch(const std::exception& " + ARON_VARIABLE_PREFIX + "_e)");
b->addLineAsBlock("throw armarx::aron::error::AronException(__PRETTY_FUNCTION__, std::string(\"An error occured during the write method of an aron generated class. The full error log was:\\n\") + " + ARON_VARIABLE_PREFIX + "_e.what());");
b->addLineAsBlock("throw ::armarx::aron::error::AronException(__PRETTY_FUNCTION__, std::string(\"An error occured during the write method of an aron generated class. The full error log was:\\n\") + " + ARON_VARIABLE_PREFIX + "_e.what());");
m->setBlock(b);
return m;
......@@ -254,12 +254,12 @@ namespace armarx::aron::codegenerator::cpp
b->addLine("this->resetSoft();");
b->addLine("if (" + ARON_READER_ACCESSOR + ".readNull(input))");
b->addLineAsBlock("throw armarx::aron::error::AronException(__PRETTY_FUNCTION__, \"The input to the read method must not be null.\");");
b->addLineAsBlock("throw ::armarx::aron::error::AronException(__PRETTY_FUNCTION__, \"The input to the read method must not be null.\");");
b->addLine("try");
b->addBlock(this->getReadBlock("", "input"));
b->addLine("catch(const std::exception& " + ARON_VARIABLE_PREFIX + "_e)");
b->addLineAsBlock("throw armarx::aron::error::AronException(__PRETTY_FUNCTION__, std::string(\"An error occured during the read method of an aron generated class. The full error log was:\\n\") + " + ARON_VARIABLE_PREFIX + "_e.what());");
b->addLineAsBlock("throw ::armarx::aron::error::AronException(__PRETTY_FUNCTION__, std::string(\"An error occured during the read method of an aron generated class. The full error log was:\\n\") + " + ARON_VARIABLE_PREFIX + "_e.what());");
m->setBlock(b);
return m;
}
......
......@@ -59,7 +59,7 @@ namespace armarx::aron::codegenerator::cpp::generator
std::string escaped_accessor = this->EscapeAccessor(cppAccessor);
variantAccessor = Generator::ARON_VARIANT_RETURN_ACCESSOR + "_" + escaped_accessor;
block_if_data->addLine(variantAccessor + " = armarx::aron::data::readAndWrite<armarx::aron::data::FromVariantConverter<WriterT>>(" + cppAccessor + "); // of " + cppAccessor);
block_if_data->addLine(variantAccessor + " = ::armarx::aron::data::readAndWrite<::armarx::aron::data::FromVariantConverter<WriterT>>(" + cppAccessor + "); // of " + cppAccessor);
return block_if_data;
}
......@@ -69,7 +69,7 @@ namespace armarx::aron::codegenerator::cpp::generator
auto block_if_data = std::make_shared<CppBlock>();
std::string escaped_accessor = this->EscapeAccessor(cppAccessor);
block_if_data->addLine(cppAccessor + " = armarx::aron::data::Dict::DynamicCastAndCheck(armarx::aron::data::readAndWrite<aron::data::ToVariantConverter<ReaderT>>(" + variantAccessor + ")); // of " + cppAccessor);
block_if_data->addLine(cppAccessor + " = ::armarx::aron::data::Dict::DynamicCastAndCheck(::armarx::aron::data::readAndWrite<::armarx::aron::data::ToVariantConverter<ReaderT>>(" + variantAccessor + ")); // of " + cppAccessor);
return block_if_data;
}
......@@ -81,7 +81,7 @@ namespace armarx::aron::codegenerator::cpp::generator
variantAccessor = ARON_VARIANT_RETURN_ACCESSOR + "_" + escaped_accessor;
b->addLine("auto " + variantAccessor + " = " + ARON_WRITER_ACCESSOR + ".writeAnyObject(" + conversion::Maybe2CppString.at(type.getMaybe()) + ", " +
"armarx::aron::Path("+ARON_PATH_ACCESSOR+", {"+simox::alg::join(p.getPath(), ", ")+"})); // of " + typeAccessor);
"::armarx::aron::Path("+ARON_PATH_ACCESSOR+", {"+simox::alg::join(p.getPath(), ", ")+"})); // of " + typeAccessor);
return b;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment