82 static void assignProcExecCntToCnt1(
FwPrDesc_t prDesc) {
96 return (prData->
flag_1 == 1);
105 return (prData->
flag_2 == 1);
114 return (prData->
flag_3 == 1);
123 return (prData->
flag_4 == 1);
132 return (prData->
flag_5 == 1);
141 return (prData->
flag_6 == 1);
186 p_pr =
FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
239 prDesc =
FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
278 actions[0] = &incrCnt1By1;
282 guards[1] = &retFlag1;
283 guards[2] = &retFlag2;
284 guards[3] = &retFlag3;
285 guards[4] = &retFlag4;
286 guards[5] = &retFlag5;
287 guards[6] = &retFlag6;
288 guards[7] = &returnCounter1GreaterThan5;
289 guards[8] = &returnCounter1SmallerThan6;
328 prBase.
flows = flows;
389 prDesc =
FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
413 prDesc =
FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
441 p_pr =
FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
469 p_pr =
FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
501 p_pr =
FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
533 p_pr =
FwPrCreate(nOfANodes,nOfDNodes,nOfFlows,nOfActions,nOfGuards);
Structure representing a decision node in a procedure.
#define FW_PR_INST(PR_DESC, N, NDEC, NFLOWS, NA, NG)
Instantiate a procedure descriptor and its internal data structure.
FwPrDesc_t FwPrMakeTestPR1Static(struct TestPrData *prData)
Operation to create and configure the procedure PR1 (see FwPrMakeTestPR1 and figure below) statically...
Structure representing an action node in a procedure.
FwPrCounterS1_t nOfGuards
the number of guards in the procedure
int fwPrLogIndex
Location in the log array where the next entry is written.
void FwPrInitDer(FwPrDesc_t prDesc, FwPrDesc_t prDescBase)
Initialize a procedure descriptor to extend another procedure (the base procedure).
#define LOG_ARRAY_SIZE
Size of the log arrays.
void FwPrOverrideGuard(FwPrDesc_t prDesc, FwPrGuard_t oldGuard, FwPrGuard_t newGuard)
Override a guard in a derived procedure.
FwPrCounterS1_t iAction
index of the action attached to the node
int flag_6
Flag used in the procedure control flows.
Structure representing the base descriptor of a procedure.
void * prData
the pointer to the data manipulated by the procedure actions and guards
void FwPrAddFlowIniToDec(FwPrDesc_t prDesc, FwPrCounterS1_t destId, FwPrGuard_t cfGuard)
Create a control flow from the initial node to a decision node and add it to a procedure.
FwPrCounterS1_t nOfActions
the number of actions in the procedure
void FwPrAddFlowActToDec(FwPrDesc_t prDesc, FwPrCounterS1_t srcId, FwPrCounterS1_t destId, FwPrGuard_t cfGuard)
Create a control flow from an action node to a decision node and add it to a procedure.
FwPrCounterS1_t nOfANodes
the number of action nodes in the procedure
FwPrDesc_t FwPrMakeTestPR4(struct TestPrData *prData)
Operation to create the test procedure PR4.
void FwPrInit(FwPrDesc_t prDesc)
Initialize a procedure descriptor to represent an unconfigured procedure with no control flows...
FwPrCounterS1_t dest
the index of the destination of the control flow
PrFlow_t * flows
array holding the control flows in the procedure
FwPrCounterS1_t nOfFlows
the number of control flows in the procedure (excluding control flow from initial node) ...
PrBaseDesc_t * prBase
pointer to the base descriptor
int flag_2
Flag used in the procedure control flows.
FwPrDesc_t FwPrMakeTestPR2Dir(struct TestPrData *prData)
Operation to create the test procedure PR2 (see FwPrMakeTestPR2 and figure below) directly by instant...
FwPrDesc_t FwPrMakeTestPR2Static(struct TestPrData *prData)
Operation to create and configure the procedure PR2 (see FwPrMakeTestPR2 and figure below) statically...
FwPrDesc_t FwPrMakeTestPR3(struct TestPrData *prData)
Operation to create the test procedure PR3.
PrANode_t * aNodes
array holding the action nodes in the procedure
#define FW_PR_INST_NODEC(PR_DESC, N, NFLOWS, NA, NG)
Instantiate a procedure descriptor and its internal data structure.
#define N1
An action node identifier.
#define N2
An action node identifier.
void FwPrAddFlowDecToFin(FwPrDesc_t prDesc, FwPrCounterS1_t srcId, FwPrGuard_t cfGuard)
Create a control flow from a decision node to the final node and add it to a procedure.
FwPrCounterS1_t flowCnt
the counter for the number of control flows added to the procedure
int FwPrBool_t
Type used for booleans (0 is "false" and 1 is "true").
void FwPrOverrideAction(FwPrDesc_t prDesc, FwPrAction_t oldAction, FwPrAction_t newAction)
Override an action in a derived procedure.
int flag_1
Flag used in the procedure control flows.
PrDNode_t * dNodes
array holding the decision nodes in the procedure
FwPrCounterS1_t iGuard
the index of the guard associated to the control flow
int flag_4
Flag used in the procedure control flows.
int flag_5
Flag used in the procedure control flows.
FwPrDesc_t FwPrMakeTestPR6_2(struct TestPrData *prData)
Operation to create the test procedure PR6.
FwPrBool_t PrDummyGuard(FwPrDesc_t prDesc)
Dummy guard which always returns true.
FwPrDesc_t FwPrMakeTestPR6_1(struct TestPrData *prData)
Operation to create the test procedure PR6.
void FwPrAddFlowActToFin(FwPrDesc_t prDesc, FwPrCounterS1_t srcId, FwPrGuard_t cfGuard)
Create a control flow from an action node to the final node and add it to a procedure.
void FwPrAddFlowActToAct(FwPrDesc_t prDesc, FwPrCounterS1_t srcId, FwPrCounterS1_t destId, FwPrGuard_t cfGuard)
Create a control flow from an action node to another action node and add it to a procedure.
FwPrDesc_t FwPrCreate(FwPrCounterS1_t nOfANodes, FwPrCounterS1_t nOfDNodes, FwPrCounterS1_t nOfFlows, FwPrCounterS1_t nOfActions, FwPrCounterS1_t nOfGuards)
Create a new procedure descriptor.
#define FW_PR_INST_DER(PR_DESC, NA, NG)
Instantiate a descriptor for a derived procedure.
int fwPrLogNode[LOG_ARRAY_SIZE]
Log array where the actions of the test procedures write the current state of their procedure...
FwPrDesc_t FwPrCreateDer(FwPrDesc_t prDesc)
Create the descriptor of a derived procedure.
void(* FwPrAction_t)(FwPrDesc_t)
Type for a pointer to a procedure action.
void * FwPrGetData(FwPrDesc_t prDesc)
Get the pointer to the procedure data in the procedure descriptor.
void FwPrSetData(FwPrDesc_t prDesc, void *prData)
Set the pointer to the procedure data in the procedure descriptor.
Structure representing a control flow.
FwPrCounterU3_t nodeExecCnt
the node execution counter
FwPrDesc_t FwPrMakeTestPRDer1Static(FwPrDesc_t prDescBase, struct TestPrData *prData)
Create a derived procedure and override one of its actions and one of its guards. ...
FwPrErrCode_t errCode
either 'success' or the code of the last error encountered by the procedure
FwPrDesc_t FwPrMakeTestPR2(struct TestPrData *prData)
Operation to create the test procedure PR2.
void FwPrAddFlowDecToDec(FwPrDesc_t prDesc, FwPrCounterS1_t srcId, FwPrCounterS1_t destId, FwPrGuard_t cfGuard)
Create a control flow from a decision node to another decision node and add it to a procedure...
FwPrCounterS1_t outFlowIndex
index of first out-going control flow in control flow array
int fwPrLogMarker[LOG_ARRAY_SIZE]
Log array where the actions of the test procedures write their markers.
Declaration of the static creation interface for a FW Procedure.
FwPrDesc_t FwPrMakeTestPR5(struct TestPrData *prData)
Operation to create the test procedure PR5.
Return codes of a function which has completed execution without errors.
void FwPrAddDecisionNode(FwPrDesc_t prDesc, FwPrCounterS1_t nodeId, FwPrCounterS1_t nOfOutFlows)
Create a decision node with the given characteristics and add it to a procedure.
Declaration of functions to create and configure test procedures.
signed char FwPrCounterS1_t
Type used for signed counters with a "short" range.
Structure representing a procedure descriptor.
FwPrCounterS1_t nOfOutTrans
number of outgoing control flows from the decision node
FwPrAction_t * prActions
the procedure actions
#define N3
An action node identifier.
FwPrDesc_t FwPrMakeTestPR1(struct TestPrData *prData)
Operation to create the test procedure PR1.
#define D2
A decision node identifier.
FwPrDesc_t FwPrMakeTestPR6_3(struct TestPrData *prData)
Operation to create the test procedure PR6.
FwPrCounterS1_t FwPrGetCurNode(FwPrDesc_t prDesc)
Return the identifier of the current action node in a procedure.
struct TestPrData * GetTestPrData(FwPrDesc_t prDesc)
Get the pointer to the procedure data of a test procedure.
int counter_1
Counter incremented by the procedure actions.
int marker
Procedure's marker.
FwPrDesc_t FwPrMakeTestPRDer1(FwPrDesc_t prDescBase, struct TestPrData *prData)
Create a derived procedure and override one of its actions and one of its guards. ...
void FwPrAddFlowIniToAct(FwPrDesc_t prDesc, FwPrCounterS1_t destId, FwPrGuard_t cfGuard)
Create a control flow from the initial node to an action node and add it to a procedure.
void FwPrAddActionNode(FwPrDesc_t prDesc, FwPrCounterS1_t nodeId, FwPrAction_t action)
Create an action node with the given characteristics and add it to a procedure.
#define D1
A decision node identifier.
FwPrErrCode_t FwPrCheck(FwPrDesc_t prDesc)
Check the correctness and completeness of the configuration of a procedure descriptor.
FwPrCounterS1_t iFlow
index of out-going control flows
FwPrCounterU3_t prExecCnt
the procedure execution counter
FwPrGuard_t * prGuards
the control flow guards in the procedure
Type for the data structure passed to all procedures made by the functions declared by this header fi...
FwPrCounterS1_t nOfDNodes
the number of decision nodes in the procedure
int flag_3
Flag used in the procedure control flows.
void FwPrAddFlowDecToAct(FwPrDesc_t prDesc, FwPrCounterS1_t srcId, FwPrCounterS1_t destId, FwPrGuard_t cfGuard)
Create a control flow from a decision node to an action node and add it to a procedure.
FwPrCounterS1_t curNode
the current node of the procedure
FwPrBool_t(* FwPrGuard_t)(FwPrDesc_t)
Type for a pointer to a procedure guard.