Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove private parameter getter in C++ component writer #267

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,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 @@ -1294,20 +1294,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 @@ -2286,20 +2286,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 @@ -1945,20 +1945,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 @@ -992,20 +992,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 @@ -1614,20 +1614,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 @@ -1436,20 +1436,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 @@ -1294,20 +1294,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