Add basic Adapter Generation
Add basic generation of a Adapter .cpp and .h files
Deliverables:
-
new Template Adapter.cpp.ftl and/or Adapter.h.ftl
- Can be based on Adapter.ftl template in EMAM2Roscpp. Possible easiest if you implement your own SomeIPMacro.ftl(reference: RosMacros.ftl) and use the original
Adapter.ftl
. - Result should look or work similar to your example adapter .cpp and .h
- Assume all values are written/read as doubles for now(e.g. ignore all Matrix/Vector types, Struct Types)
- You can ignore all generics, for now
- The resulting class should should be named
SomeIPAdapter_${escapedCompName}
, where${escapedCompName}
iscomponentInstance.getFullName()
with all.
,[
,]
replaced by_
- Can be based on Adapter.ftl template in EMAM2Roscpp. Possible easiest if you implement your own SomeIPMacro.ftl(reference: RosMacros.ftl) and use the original
-
In SomeIPTemplates:
- A new constant + fill method pair for the new template(s)
-
A new Class SomeIPAdapterModel:
- can be based on the RosAdapterModel in RosCpp
- should contain all information needed to generate the Adapter
- (escaped) name of the component instance
- SomeIPPorts of the component
- Possibly grouped by incomming/outgoing(for subscribers/publishers respectivly)
-
In SomeIPGenerator:
- a method
+ List<File> generateAdapter(EMAComponentInstanceSymbol)
that generates the CMake file using the SomeIPTemplate Class and the template Adapter.cpp.ftl and/or Adapter.h.ftl.
- a method
-
Add a test case:
- as previously(Issue #13 (closed)):
- parse a simple componentInstance
- manually add SomeIPConnectionSymbols with
EMAPortInstanceSymbol::setMiddlewareSymbol
- call
generateCMake
on the componentInstance - compare the resulting File(s) with an expected result(AbstractSymtabTest::testFilesAreEqual)
- as previously(Issue #13 (closed)):