MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / makeConstTemplateData

Method makeConstTemplateData

erpcgen/src/JavaGenerator.cpp:504–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504void JavaGenerator::makeConstTemplateData()
505{
506 Log::info("Constant globals:\n");
507 data_list consts;
508 for (auto it : m_globals->getSymbolsOfType(Symbol::symbol_type_t::kConstSymbol))
509 {
510 ConstType *constVar = dynamic_cast<ConstType *>(it);
511 assert(constVar);
512 data_map constInfo;
513 if (!findAnnotation(constVar, EXTERNAL_ANNOTATION))
514 {
515 constInfo["name"] = getOutputName(constVar);
516 constInfo["type"] = getTypeInfo(constVar->getDataType(), false, false);
517 // throw nullptr exception
518 if (NULL == constVar->getValue())
519 {
520 Log::info("const pointing to null Value object\n");
521 }
522 if (kStringValue == constVar->getValue()->getType())
523 {
524 constInfo["value"] = "\"" + constVar->getValue()->toString() + "\"";
525 }
526 else
527 {
528 constInfo["value"] = constVar->getValue()->toString();
529 }
530 setTemplateComments(constVar, constInfo);
531 Log::info("Name=%s\tType=%s\tValue=%s\n", constVar->getName().c_str(),
532 constVar->getDataType()->getName().c_str(), constVar->getValue()->toString().c_str());
533 consts.push_back(constInfo);
534 }
535 }
536 m_templateData["consts"] = consts;
537}
538
539void JavaGenerator::makeEnumsTemplateData()
540{

Callers

nothing calls this directly

Calls 7

getSymbolsOfTypeMethod · 0.80
getTypeMethod · 0.80
push_backMethod · 0.80
getDataTypeMethod · 0.45
getValueMethod · 0.45
toStringMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected