MT#55831 dsm: helper functions / macros for modules:

replaceParams/SET_ERROR/CLR_ERROR

use resolveVars in module actions/condition to replace only one variable/param,
use replaceParams to replace substrings as well,

e.g.  myAction($myvar) - resolveVars
      myOtherAction("this is $(myvar) and #(myparam) replaced") - replaceParams

Change-Id: Ia8d39259e2c24111b4ffe765cbd637627be346ab
mr11.2.1
Stefan Sayer 4 years ago committed by Donat Zenichev
parent fa0e4b7f57
commit 206cb7a528

@ -171,6 +171,10 @@ class TestDSMCondition
map<string,string>* event_params);
};
/** return string q with variables/params/selects replaced */
string replaceParams(const string& q, AmSession* sess, DSMSession* sc_sess,
map<string,string>* event_params);
/** return string q with variables/params/selects replaced */
string replaceParams(const string& q, AmSession* sess, DSMSession* sc_sess,
map<string,string>* event_params);

@ -111,6 +111,18 @@ using std::map;
s->CLR_STRERROR; \
} while (0)
#define SET_ERROR(s, errno, errstr) \
do { \
s->SET_ERRNO(errno); \
s->SET_STRERROR(errstr); \
} while (0)
#define CLR_ERROR(s) \
do { \
s->CLR_ERRNO; \
s->CLR_STRERROR; \
} while (0)
typedef map<string, string> VarMapT;
typedef map<string, AmArg> AVarMapT;

Loading…
Cancel
Save