Skip to content

Commit

Permalink
Merge pull request #267 from tiffany1618/remove-private-param-getter
Browse files Browse the repository at this point in the history
Remove private parameter getter in C++ component writer
  • Loading branch information
bocchino committed Jun 22, 2023
2 parents 69e814d + 0f2494d commit 22dc420
Show file tree
Hide file tree
Showing 19 changed files with 1 addition and 326 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ case class ComponentParameters (
def getPrivateFunctionMembers: List[CppDoc.Class.Member] = {
if !hasParameters then Nil
else List(
getPrivateGetter,
getSetters,
getSaveFunctions
).flatten
Expand Down Expand Up @@ -260,42 +259,6 @@ case class ComponentParameters (
)
}

private def getPrivateGetter: List[CppDoc.Class.Member] = {
addAccessTagAndComment(
"PRIVATE",
"Private parameter get function",
List(
functionClassMember(
Some(
"""|Get a parameter by ID
|
|\return Whether the parameter is valid
|"""
),
"getParam",
List(
CppDoc.Function.Param(
CppDoc.Type("FwPrmIdType"),
"id",
Some("The ID")
),
CppDoc.Function.Param(
CppDoc.Type("Fw::ParamBuffer&"),
"buff",
Some("The parameter value")
)
),
CppDoc.Type("Fw::ParamValid"),
wrapInIfElse(
s"this->${portVariableName(prmGetPort.get)}[0].isConnected()",
lines(s"return this->${portVariableName(prmGetPort.get)}[0].invoke(id, buff);"),
lines("return Fw::ParamValid::INVALID;")
)
)
)
)
}

private def getSetters: List[CppDoc.Class.Member] = {
addAccessTagAndComment(
"PRIVATE",
Expand Down Expand Up @@ -401,4 +364,4 @@ case class ComponentParameters (
private def paramVariableName(name: String) =
s"m_$name"

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3390,24 +3390,6 @@ void ActiveParamsComponentBase ::
);
}

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

Fw::ParamValid ActiveParamsComponentBase ::
getParam(
FwPrmIdType id,
Fw::ParamBuffer& buff
)
{
if (this->m_prmGetOut_OutputPort[0].isConnected()) {
return this->m_prmGetOut_OutputPort[0].invoke(id, buff);
}
else {
return Fw::ParamValid::INVALID;
}
}

// ----------------------------------------------------------------------
// Parameter set functions
// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1296,20 +1296,6 @@ class ActiveParamsComponentBase :
const S& s //!< A struct
);

PRIVATE:

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

//! Get a parameter by ID
//!
//! \return Whether the parameter is valid
Fw::ParamValid getParam(
FwPrmIdType id, //!< The ID
Fw::ParamBuffer& buff //!< The parameter value
);

PRIVATE:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7277,24 +7277,6 @@ void ActiveSerialComponentBase ::

#endif

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

Fw::ParamValid ActiveSerialComponentBase ::
getParam(
FwPrmIdType id,
Fw::ParamBuffer& buff
)
{
if (this->m_prmGetOut_OutputPort[0].isConnected()) {
return this->m_prmGetOut_OutputPort[0].invoke(id, buff);
}
else {
return Fw::ParamValid::INVALID;
}
}

// ----------------------------------------------------------------------
// Parameter set functions
// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2288,20 +2288,6 @@ class ActiveSerialComponentBase :

#endif

PRIVATE:

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

//! Get a parameter by ID
//!
//! \return Whether the parameter is valid
Fw::ParamValid getParam(
FwPrmIdType id, //!< The ID
Fw::ParamBuffer& buff //!< The parameter value
);

PRIVATE:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6437,24 +6437,6 @@ void ActiveTestComponentBase ::
);
}

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

Fw::ParamValid ActiveTestComponentBase ::
getParam(
FwPrmIdType id,
Fw::ParamBuffer& buff
)
{
if (this->m_prmGetOut_OutputPort[0].isConnected()) {
return this->m_prmGetOut_OutputPort[0].invoke(id, buff);
}
else {
return Fw::ParamValid::INVALID;
}
}

// ----------------------------------------------------------------------
// Parameter set functions
// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1947,20 +1947,6 @@ class ActiveTestComponentBase :
const S& s //!< A struct
);

PRIVATE:

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

//! Get a parameter by ID
//!
//! \return Whether the parameter is valid
Fw::ParamValid getParam(
FwPrmIdType id, //!< The ID
Fw::ParamBuffer& buff //!< The parameter value
);

PRIVATE:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2136,24 +2136,6 @@ void PassiveParamsComponentBase ::
);
}

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

Fw::ParamValid PassiveParamsComponentBase ::
getParam(
FwPrmIdType id,
Fw::ParamBuffer& buff
)
{
if (this->m_prmGetOut_OutputPort[0].isConnected()) {
return this->m_prmGetOut_OutputPort[0].invoke(id, buff);
}
else {
return Fw::ParamValid::INVALID;
}
}

// ----------------------------------------------------------------------
// Parameter set functions
// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -994,20 +994,6 @@ class PassiveParamsComponentBase :
const S& s //!< A struct
);

PRIVATE:

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

//! Get a parameter by ID
//!
//! \return Whether the parameter is valid
Fw::ParamValid getParam(
FwPrmIdType id, //!< The ID
Fw::ParamBuffer& buff //!< The parameter value
);

PRIVATE:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4316,24 +4316,6 @@ void PassiveSerialComponentBase ::

#endif

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

Fw::ParamValid PassiveSerialComponentBase ::
getParam(
FwPrmIdType id,
Fw::ParamBuffer& buff
)
{
if (this->m_prmGetOut_OutputPort[0].isConnected()) {
return this->m_prmGetOut_OutputPort[0].invoke(id, buff);
}
else {
return Fw::ParamValid::INVALID;
}
}

// ----------------------------------------------------------------------
// Parameter set functions
// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1616,20 +1616,6 @@ class PassiveSerialComponentBase :

#endif

PRIVATE:

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

//! Get a parameter by ID
//!
//! \return Whether the parameter is valid
Fw::ParamValid getParam(
FwPrmIdType id, //!< The ID
Fw::ParamBuffer& buff //!< The parameter value
);

PRIVATE:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4029,24 +4029,6 @@ void PassiveTestComponentBase ::
);
}

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

Fw::ParamValid PassiveTestComponentBase ::
getParam(
FwPrmIdType id,
Fw::ParamBuffer& buff
)
{
if (this->m_prmGetOut_OutputPort[0].isConnected()) {
return this->m_prmGetOut_OutputPort[0].invoke(id, buff);
}
else {
return Fw::ParamValid::INVALID;
}
}

// ----------------------------------------------------------------------
// Parameter set functions
// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1438,20 +1438,6 @@ class PassiveTestComponentBase :
const S& s //!< A struct
);

PRIVATE:

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

//! Get a parameter by ID
//!
//! \return Whether the parameter is valid
Fw::ParamValid getParam(
FwPrmIdType id, //!< The ID
Fw::ParamBuffer& buff //!< The parameter value
);

PRIVATE:

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3395,24 +3395,6 @@ void QueuedParamsComponentBase ::
);
}

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

Fw::ParamValid QueuedParamsComponentBase ::
getParam(
FwPrmIdType id,
Fw::ParamBuffer& buff
)
{
if (this->m_prmGetOut_OutputPort[0].isConnected()) {
return this->m_prmGetOut_OutputPort[0].invoke(id, buff);
}
else {
return Fw::ParamValid::INVALID;
}
}

// ----------------------------------------------------------------------
// Parameter set functions
// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1296,20 +1296,6 @@ class QueuedParamsComponentBase :
const S& s //!< A struct
);

PRIVATE:

// ----------------------------------------------------------------------
// Private parameter get function
// ----------------------------------------------------------------------

//! Get a parameter by ID
//!
//! \return Whether the parameter is valid
Fw::ParamValid getParam(
FwPrmIdType id, //!< The ID
Fw::ParamBuffer& buff //!< The parameter value
);

PRIVATE:

// ----------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 22dc420

Please sign in to comment.