CORDET Framework - C2 Implementation
|
Implementation of OutManager State Machine. More...
Go to the source code of this file.
Functions | |
static void | OutManagerInitAction (FwPrDesc_t initPr) |
Initialization action for OutManagers. More... | |
static void | OutManagerConfigAction (FwPrDesc_t initPr) |
Configuration action for OutManagers. More... | |
static void | OutManagerShutdownAction (FwSmDesc_t smDesc) |
Shutdown action for OutManager. More... | |
static void | OutManagerExecAction (FwPrDesc_t execPr) |
Implement the logic of the Execution Procedure (see figure below). More... | |
FwSmDesc_t | CrFwOutManagerMake (CrFwInstanceId_t i) |
Factory function to retrieve the i-th OutManager State Machine instance. More... | |
CrFwBool_t | CrFwOutManagerLoad (FwSmDesc_t smDesc, FwSmDesc_t outCmp) |
Load a new OutComponent into the OutManager. More... | |
CrFwCounterU1_t | CrFwOutManagerGetNOfPendingOutCmp (FwSmDesc_t smDesc) |
Return the number of OutComponents currently in the POCL of an OutManager. More... | |
CrFwCounterU2_t | CrFwOutManagerGetNOfLoadedOutCmp (FwSmDesc_t smDesc) |
Return the number of OutComponents successfully loaded in the POCL of an OutManager since the OutManager was last reset. More... | |
CrFwCounterU1_t | CrFwOutManagerGetPOCLSize (FwSmDesc_t smDesc) |
Return the size of the POCL of an OutManager. More... | |
Variables | |
static CrFwCounterU2_t | outManagerPoclSize [CR_FW_NOF_OUTMANAGER] = CR_FW_OUTMANAGER_POCLSIZE |
The sizes of the POCL in the OutManager components. More... | |
static FwSmDesc_t | outManagerDesc [CR_FW_NOF_OUTMANAGER] |
The descriptors of the OutManager State Machines. More... | |
static CrFwCmpData_t | outManagerData [CR_FW_NOF_OUTMANAGER] |
The data structures for the OutManager State Machines and their Procedures. More... | |
static CrFwOutManagerData_t | outManagerCmpSpecificData [CR_FW_NOF_OUTMANAGER] |
The component-specific data for the OutManager instances. | |
Implementation of OutManager State Machine.
This file is part of the CORDET Framework.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
For information on alternative licensing, please contact P&P Software GmbH.
Definition in file CrFwOutManager.c.
CrFwCounterU2_t CrFwOutManagerGetNOfLoadedOutCmp | ( | FwSmDesc_t | smDesc | ) |
Return the number of OutComponents successfully loaded in the POCL of an OutManager since the OutManager was last reset.
smDesc | the descriptor of the OutManager State Machine. |
Definition at line 283 of file CrFwOutManager.c.
CrFwCounterU1_t CrFwOutManagerGetNOfPendingOutCmp | ( | FwSmDesc_t | smDesc | ) |
Return the number of OutComponents currently in the POCL of an OutManager.
smDesc | the descriptor of the OutManager State Machine. |
Definition at line 276 of file CrFwOutManager.c.
CrFwCounterU1_t CrFwOutManagerGetPOCLSize | ( | FwSmDesc_t | smDesc | ) |
Return the size of the POCL of an OutManager.
smDesc | the descriptor of the OutManager State Machine. |
Definition at line 290 of file CrFwOutManager.c.
CrFwBool_t CrFwOutManagerLoad | ( | FwSmDesc_t | smDesc, |
FwSmDesc_t | outCmp | ||
) |
Load a new OutComponent into the OutManager.
The behaviour implemented by this function is shown in the activity diagram below. If the POCL is not full, the function identifies a free position in the POCL where to store the OutComponent. If the POCL is full, the function generates the error report crOutManagerPoclFull and then releases the OutCompoment and returns.
This function adds OutComponents to the POCL. The POCL is flushed when the OutManager is executed (i.e. it is flushed by function OutManagerExecAction
). The algorithms to identify a free position in the POCL and to process the POCL entries when the OutManager is executed are optimized for a situation where multiple load operations are performed before the OutManager is executed.
Additionally, these algorithms guarantee the following ordering constraint. Let OutComponents C1 to Cn be successfully loaded into an OutManager through a sequence of calls to function CrFwOutManagerLoad
and assume that this sequence of load operations is not interrupted by an execution of the OutManager. Under these conditions, when the OutManager is executed next, the OutComponents C1 to Cn will be processed in the order in which they have been loaded.
The implementation of function CrFwOutManagerLoad
is based on the internal variable freePos
. This variable has the following characteristics:
freePos
either points to the next free position in the POCL or is equal to the POCL size if the POCL is full;smDesc | the descriptor of the OutManager State Machine. |
outCmp | the descriptor of the OutComponent to be loaded in the OutManager |
Definition at line 179 of file CrFwOutManager.c.
FwSmDesc_t CrFwOutManagerMake | ( | CrFwInstanceId_t | outManagerId | ) |
Factory function to retrieve the i-th OutManager State Machine instance.
The first time this function is called with a certain value of the argument i, it creates the i-th OutManager State Machine instance. Subsequent calls returns the same instance.
The OutManager identifier i must be in the range: [0, CR_FW_NOF_OUTMANAGER
-1]. If the identifier is out of range, the function returns NULL and sets the application error code to: crOutManagerIllId
.
The first time this function is called with a certain value of i, it returns an OutManager State Machine which has been started but which still needs to be initialized and configured.
outManagerId | the identifier of the OutManager |
Definition at line 95 of file CrFwOutManager.c.
|
static |
Configuration action for OutManagers.
This function resets the POCL and releases all OutComponents in the POCL. The outcome of the initialization action is always: "success"
initPr | the Initialization Procedure of the OutManager |
Definition at line 240 of file CrFwOutManager.c.
|
static |
Implement the logic of the Execution Procedure (see figure below).
This function is executed every time the Execution Procedure of the OutManager is executed.
execPr | the Execution Procedure of the OutManager |
Definition at line 147 of file CrFwOutManager.c.
|
static |
Initialization action for OutManagers.
This function allocates the memory for the OutManager data structures and initializes them. The outcome of the initialization action is always "success" (the situation where the memory allocation fails is not handled).
initPr | the Initialization Procedure of the OutManager |
Definition at line 227 of file CrFwOutManager.c.
|
static |
Shutdown action for OutManager.
This function resets the POCL and releases all OutComponents in the POCL.
smDesc | the OutManager state machine |
Definition at line 259 of file CrFwOutManager.c.
|
static |
The data structures for the OutManager State Machines and their Procedures.
Definition at line 55 of file CrFwOutManager.c.
|
static |
The descriptors of the OutManager State Machines.
Definition at line 52 of file CrFwOutManager.c.
|
static |
The sizes of the POCL in the OutManager components.
Definition at line 49 of file CrFwOutManager.c.