Skip to content

Commit

Permalink
Merge branch 'main' into issue-567-tlm-packet-cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
bocchino committed Feb 28, 2025
2 parents e76badf + 07cc136 commit faeebb7
Show file tree
Hide file tree
Showing 84 changed files with 97 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ case class ComponentImplWriter(
None,
componentImplClassName,
Some(s"public $className"),
getClassMembers
getClassMembers,
CppDoc.Class.Final
)
hppIncludes :: cppIncludes ::
wrapInNamespaces(namespaceIdentList, List(cls))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ case class ComponentTestImplWriter(
None,
testImplClassName,
Some(s"public $gTestClassName"),
getClassMembers
getClassMembers,
CppDoc.Class.Final
)
List.concat(
getHppIncludes :: getCppIncludes,
Expand Down
5 changes: 5 additions & 0 deletions compiler/lib/src/main/scala/codegen/CppWriter/CppDoc.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ object CppDoc {
superclassDecls: Option[String],
/** The class members */
members: List[Class.Member],
/** The class final qualifier, if any, before the colon */
qualifier: Class.FinalQualifier = Class.NonFinal
)

object Class {
sealed trait FinalQualifier
case object Final extends FinalQualifier
case object NonFinal extends FinalQualifier
sealed trait Member
object Member {
case class Class(c: CppDoc.Class) extends Member
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,17 @@ object CppDocHppWriter extends CppDocWriter {
override def visitClass(in: Input, c: CppDoc.Class) = {
val name = c.name
val commentLines = CppDocWriter.writeDoxygenCommentOpt(c.comment)
val className = c.qualifier match {
case CppDoc.Class.Final => s"class $name final"
case CppDoc.Class.NonFinal => s"class $name"
}
val openLines = c.superclassDecls match {
case Some(d) => List(
line(s"class $name :"),
line(s"$className :"),
indentIn(line(d)),
line("{")
)
case None => lines(s"class $name {")
case None => lines(s"$className {")
}
val bodyLines = {
val newClassNameList = name :: in.classNameList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,15 @@ trait CppWriterUtils extends LineUtils {
name: String,
superclassDecls: Option[String],
members: List[CppDoc.Class.Member],
qualifier: CppDoc.Class.FinalQualifier = CppDoc.Class.NonFinal
): CppDoc.Member.Class =
CppDoc.Member.Class(
CppDoc.Class(
comment,
name,
superclassDecls,
members
members,
qualifier
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ActiveAsyncProductPortsOnlyComponentAc.hpp"

class ActiveAsyncProductPortsOnly :
class ActiveAsyncProductPortsOnly final :
public ActiveAsyncProductPortsOnlyComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ActiveAsyncProductsComponentAc.hpp"

class ActiveAsyncProducts :
class ActiveAsyncProducts final :
public ActiveAsyncProductsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ActiveCommandsComponentAc.hpp"

class ActiveCommands :
class ActiveCommands final :
public ActiveCommandsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ActiveEventsComponentAc.hpp"

class ActiveEvents :
class ActiveEvents final :
public ActiveEventsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace ExternalSm {

class ActiveExternalStateMachines :
class ActiveExternalStateMachines final :
public ActiveExternalStateMachinesComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ActiveGetProductsComponentAc.hpp"

class ActiveGetProducts :
class ActiveGetProducts final :
public ActiveGetProductsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ActiveGuardedProductsComponentAc.hpp"

class ActiveGuardedProducts :
class ActiveGuardedProducts final :
public ActiveGuardedProductsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ActiveNoArgsPortsOnlyComponentAc.hpp"

class ActiveNoArgsPortsOnly :
class ActiveNoArgsPortsOnly final :
public ActiveNoArgsPortsOnlyComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ActiveOverflowComponentAc.hpp"

class ActiveOverflow :
class ActiveOverflow final :
public ActiveOverflowComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ActiveParamsComponentAc.hpp"

class ActiveParams :
class ActiveParams final :
public ActiveParamsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ActiveSerialComponentAc.hpp"

class ActiveSerial :
class ActiveSerial final :
public ActiveSerialComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ActiveSyncProductsComponentAc.hpp"

class ActiveSyncProducts :
class ActiveSyncProducts final :
public ActiveSyncProductsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "ActiveTelemetryComponentAc.hpp"

class ActiveTelemetry :
class ActiveTelemetry final :
public ActiveTelemetryComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace M {

class ActiveTest :
class ActiveTest final :
public ActiveTestComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "EmptyComponentAc.hpp"

class Empty :
class Empty final :
public EmptyComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "PassiveCommandsComponentAc.hpp"

class PassiveCommands :
class PassiveCommands final :
public PassiveCommandsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "PassiveEventsComponentAc.hpp"

class PassiveEvents :
class PassiveEvents final :
public PassiveEventsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "PassiveGetProductPortsOnlyComponentAc.hpp"

class PassiveGetProductPortsOnly :
class PassiveGetProductPortsOnly final :
public PassiveGetProductPortsOnlyComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "PassiveGetProductsComponentAc.hpp"

class PassiveGetProducts :
class PassiveGetProducts final :
public PassiveGetProductsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "PassiveGuardedProductsComponentAc.hpp"

class PassiveGuardedProducts :
class PassiveGuardedProducts final :
public PassiveGuardedProductsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "PassiveParamsComponentAc.hpp"

class PassiveParams :
class PassiveParams final :
public PassiveParamsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "PassiveSerialComponentAc.hpp"

class PassiveSerial :
class PassiveSerial final :
public PassiveSerialComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "PassiveSyncProductPortsOnlyComponentAc.hpp"

class PassiveSyncProductPortsOnly :
class PassiveSyncProductPortsOnly final :
public PassiveSyncProductPortsOnlyComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "PassiveSyncProductsComponentAc.hpp"

class PassiveSyncProducts :
class PassiveSyncProducts final :
public PassiveSyncProductsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "PassiveTelemetryComponentAc.hpp"

class PassiveTelemetry :
class PassiveTelemetry final :
public PassiveTelemetryComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "PassiveTestComponentAc.hpp"

class PassiveTest :
class PassiveTest final :
public PassiveTestComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "QueuedAsyncProductPortsOnlyComponentAc.hpp"

class QueuedAsyncProductPortsOnly :
class QueuedAsyncProductPortsOnly final :
public QueuedAsyncProductPortsOnlyComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "QueuedAsyncProductsComponentAc.hpp"

class QueuedAsyncProducts :
class QueuedAsyncProducts final :
public QueuedAsyncProductsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "QueuedCommandsComponentAc.hpp"

class QueuedCommands :
class QueuedCommands final :
public QueuedCommandsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "QueuedEventsComponentAc.hpp"

class QueuedEvents :
class QueuedEvents final :
public QueuedEventsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "QueuedGetProductsComponentAc.hpp"

class QueuedGetProducts :
class QueuedGetProducts final :
public QueuedGetProductsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "QueuedGuardedProductsComponentAc.hpp"

class QueuedGuardedProducts :
class QueuedGuardedProducts final :
public QueuedGuardedProductsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "QueuedNoArgsPortsOnlyComponentAc.hpp"

class QueuedNoArgsPortsOnly :
class QueuedNoArgsPortsOnly final :
public QueuedNoArgsPortsOnlyComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "QueuedOverflowComponentAc.hpp"

class QueuedOverflow :
class QueuedOverflow final :
public QueuedOverflowComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "QueuedParamsComponentAc.hpp"

class QueuedParams :
class QueuedParams final :
public QueuedParamsComponentBase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "QueuedSerialComponentAc.hpp"

class QueuedSerial :
class QueuedSerial final :
public QueuedSerialComponentBase
{

Expand Down
Loading

0 comments on commit faeebb7

Please sign in to comment.