summaryrefslogtreecommitdiff
path: root/maximus/functioncall
diff options
context:
space:
mode:
Diffstat (limited to 'maximus/functioncall')
-rw-r--r--maximus/functioncall/inc/FunctionSciMsg.h7
-rw-r--r--maximus/functioncall/src/FunctionSciMsg.cpp34
2 files changed, 34 insertions, 7 deletions
diff --git a/maximus/functioncall/inc/FunctionSciMsg.h b/maximus/functioncall/inc/FunctionSciMsg.h
index d9ca6da1ee..c97e9d1064 100644
--- a/maximus/functioncall/inc/FunctionSciMsg.h
+++ b/maximus/functioncall/inc/FunctionSciMsg.h
@@ -144,6 +144,13 @@ public:
/**
* @return bool
+ * @param name
+ * Remove the parameter named name from the function SCI message.
+ */
+ bool removeParameter ( const std::string & name );
+
+ /**
+ * @return bool
* @param name_of_parameter_to_get
* @param p_data
*/
diff --git a/maximus/functioncall/src/FunctionSciMsg.cpp b/maximus/functioncall/src/FunctionSciMsg.cpp
index 098c802b68..519584cae8 100644
--- a/maximus/functioncall/src/FunctionSciMsg.cpp
+++ b/maximus/functioncall/src/FunctionSciMsg.cpp
@@ -57,7 +57,7 @@ mpSpecializedSciMsgHeader(NULL),
mpFunctionCallManager(NULL)
{
logFunction();
-
+
initAttributes ();
}
@@ -78,7 +78,7 @@ mpFunctionCallManager(NULL)
{
throw Error(__PRETTY_FUNCTION__, "Function call manager pointer is NULL");
}
-
+
initAttributes ();
}
@@ -86,7 +86,7 @@ mpFunctionCallManager(NULL)
void FunctionSciMsg::initAttributes ( )
{
logFunction();
-
+
mpSpecializedSciMsgHeader = new Function_Call_Header;
if (NULL != mpSpecializedSciMsgHeader)
{
@@ -103,7 +103,7 @@ void FunctionSciMsg::initAttributes ( )
FunctionSciMsg::FunctionSciMsg ( const FunctionSciMsg & function_sci_msg ) : SciMsg ( )
{
logFunction();
-
+
initAttributes ();
setSpecializedSciMsgType (function_sci_msg.getSpecializedSciMsgType());
setSpecializedSciMsgParametersNumber (function_sci_msg.getSpecializedSciMsgParametersNumber());
@@ -117,7 +117,7 @@ FunctionSciMsg::FunctionSciMsg ( const FunctionSciMsg & function_sci_msg ) : Sci
FunctionSciMsg::~FunctionSciMsg ( )
{
logFunction();
-
+
if (NULL != mpSpecializedSciMsgHeader)
{
delete (mpSpecializedSciMsgHeader);
@@ -262,6 +262,27 @@ bool FunctionSciMsg::addParameter ( const FunctionCallParameter & function_argum
}
+// Called by user to configure a message to send
+//
+bool FunctionSciMsg::removeParameter ( const std::string & name )
+{
+ logFunction();
+ bool bRemoveParameter = false;
+
+ for (ParametersList::iterator it = mListOfParameters.begin(); it < mListOfParameters.end(); ++it)
+ {
+ if ( !it->getName().compare(name) )
+ {
+ mListOfParameters.erase(it);
+ bRemoveParameter = true;
+ break;
+ }
+ }
+
+ return bRemoveParameter;
+}
+
+
// Called by user when a message is received to retrieve function parameters
//
bool FunctionSciMsg::bindParameter ( const string name_of_parameter_to_get, unsigned long & data_length, unsigned char * p_data ) const
@@ -542,8 +563,7 @@ bool FunctionSciMsg::fillSpecializedSciMsgToSend ( )
bFill &= setSpecializedSciMsgParametersNumber(numberOfParameters);
bFill &= setSpecializedSciMsgDataLength(dataLength);
bFill &= setSpecializedSciMsgData(pData);
- bFill &= incrementSpecializedSciMsgId(); // to have an updated msg id
-
+
// Free temporary allocated memory
//
free(pData);