CORDET Framework - C2 Implementation
|
Definition of the InRegistry Component. More...
Go to the source code of this file.
Enumerations | |
enum | CrFwInRegistryCmdRepState_t { crInRegistryNoEntry = 0 , crInRegistryPending = 1 , crInRegistryExecuting = 2 , crInRegistryAborted = 3 , crInRegistryTerminated = 4 , crInRegistryNotTracked = 5 } |
Enumerated type for the state of a command or report tracked by the InRegistry. More... | |
Functions | |
FwSmDesc_t | CrFwInRegistryMake () |
Factory function for the singleton instance of the InRegistry. More... | |
void | CrFwInRegistryStartTracking (FwSmDesc_t inCmp) |
Ask the InRegistry to start tracking an incoming command or report. More... | |
void | CrFwInRegistryUpdateState (FwSmDesc_t inCmp, CrFwInRegistryCmdRepState_t newState) |
Ask the InRegistry to update the state of an incoming command or report. More... | |
CrFwInRegistryCmdRepState_t | CrFwInRegistryGetState (CrFwInstanceId_t cmdRepId) |
Query the InRegistry for the state of an incoming command or report. More... | |
Definition of the InRegistry Component.
An InRegistry acts as a registry for incoming commands or reports (namely for commands or reports which have been loaded into an InManager). The InRegistry is responsible for keeping track of the state of an incoming command or report.
The InRegistry is a singleton component which is implemented as an extension of the Base Component of CrFwBaseCmp.h
.
The InRegistry maintains a list of the last N commands or reports to have been loaded in an InManager. The InRegistry maintains the state of each such command or report. The command's or report's state in the InRegistry can have one of the following values:
Note that the states EXECUTING and ABORTED only apply to incoming commands (incoming reports are only executed once and then are terminated).
The value of N (the maximum number of items which can be tracked by the InRegistry) is fixed and is an initialization parameter.
The InRegistry uses the instance identifier of the incoming command or report as the key through which the command or report state is tracked.
Mode of Use of an InRegistry Component
The configuration of the InRegistry component is defined statically in CrFwInRegistryUserPar.h
.
The InRegistry component is a "final" component that does not normally need to be extended.
An InRegistry component is created with function CrFwInRegistryMake
. After being created, the InRegistry must be initialized and reset. This is done with functions CrFwCmpInit
and CrFwCmpReset
. Nominally, after being initialized and reset the InRegistry State Machine should be in state CONFIGURED (this can be checked by verifying that function FwSmGetCurState
returns CR_FW_BASE_STATE_CONFIGURED).
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 CrFwInRegistry.h.
Enumerated type for the state of a command or report tracked by the InRegistry.
Definition at line 74 of file CrFwInRegistry.h.
CrFwInRegistryCmdRepState_t CrFwInRegistryGetState | ( | CrFwInstanceId_t | cmdRepId | ) |
Query the InRegistry for the state of an incoming command or report.
If the specified index does not correspond to any command or report being tracked by the InRegistry, a value of crInRegistryNotTracked
is returned. This function searches all locations in the InRegistry in sequence until it finds the incoming command or report.
cmdRepId | the instance identifier of the incoming command or report. |
crInRegistryNotTracked
if the command or report is not tracked) Definition at line 162 of file CrFwInRegistry.c.
FwSmDesc_t CrFwInRegistryMake | ( | ) |
Factory function for the singleton instance of the InRegistry.
The first time this function is called, it creates and configures the InRegistry. Subsequent calls returns the same singleton instance. The first time this function is called, it returns the InRegistry in state CREATED.
If the creation or the configuration of the InRegistry fails, the function returns NULL.
Definition at line 78 of file CrFwInRegistry.c.
void CrFwInRegistryStartTracking | ( | FwSmDesc_t | inCmp | ) |
Ask the InRegistry to start tracking an incoming command or report.
The InRegistry tracks the state of the last N incoming command or reports to have been loaded with this function. Initially, when this function is called, the incoming command or report is placed in state PENDING.
This function runs the procedure in the left-hand side of the activity diagram shown in the figure.
inCmp | the incoming command or report to be tracked |
Definition at line 121 of file CrFwInRegistry.c.
void CrFwInRegistryUpdateState | ( | FwSmDesc_t | inCmp, |
CrFwInRegistryCmdRepState_t | newState | ||
) |
Ask the InRegistry to update the state of an incoming command or report.
If the argument component is not tracked by the InRegistry (perhaps because too many commands and reports have been added to the list of tracked components), nothing is done. This function runs the procedure in the right-hand side of the activity diagram shown in the figure.
inCmp | the incoming command or report to be tracked |
newState | the new state of the incoming command or report |
Definition at line 143 of file CrFwInRegistry.c.