CORDET Framework - C2 Implementation

Definition of the OutManager component. More...

Go to the source code of this file.

Functions

FwSmDesc_t CrFwOutManagerMake (CrFwInstanceId_t outManagerId)
 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...
 

Detailed Description

Definition of the OutManager component.

The OutManager component is responsible for maintaining a list of pending OutComponents (see CrFwOutCmp.h) and for repeatedly executing them until they are either aborted or else they are serialized and sent to their destination.

The list of pending commands is called the Pending OutComponent List or POCL. The POCL has a fixed size which is defined statically in CrFwOutManagerUserPar.h.

The OutManager is defined as an extension of the Base Component (see CrFwBaseCmp.h). It uses the Execution Procedure of the Base Component to process the pending OutComponents. The OutManager component processes the pending OutComponents by sending them an Execute command. After each Execute command, the state of the OutComponent is reported to the OutRegistry (see CrFwOutRegistry.h). Commands which have been aborted or have been sent to their destination are removed from the POCL and are returned to the OutFactory (see CrFwOutFactory.h). The Execution Procedure of the OutManager is shown in the figure below.

Mode of Use of an OutManager Component

The configuration of the OutManager components is defined statically in CrFwOutManagerUserPar.h.

An OutManager component is created with function CrFwOutManagerMake. After being created, the OutManager must be initialized and reset. This is done with functions CrFwCmpInit and CrFwCmpReset. Nominally, after being initialized and reset the OutManager State Machine should be in state CONFIGURED (this can be checked by verifying that function FwSmGetCurState returns CR_FW_BASE_STATE_CONFIGURED).

An application can have any number of OutManagers.

An OutManager offers a Load operation (CrFwOutManagerLoad) through which an OutComponent can be added to the POCL. This operation is normally called by the OutLoader (see CrFwOutLoader.h).

There is no mechanism to “unload” a pending OutComponent. The OutManager autonomously returns an OutComponent to the OutFactory when the OutComponent has been sent to its destination (i.e. when the OutComponent is in state TERMINATED) or when it has been aborted (i.e. when the OutComponent is in state ABORTED).

After an OutManager has been configured, it can be executed by means of function FwSmExecute. Execution of an OutManager causes its Execution Procedure (see figure below) to be executed.

When an OutManager is reset or shutdown, its POCL is reset (all pending OutComponents are cleared and returned to the OutFactory).

OutManagerExecution.png
Author
Vaclav Cechticky vacla.nosp@m.v.ce.nosp@m.chtic.nosp@m.ky@p.nosp@m.np-so.nosp@m.ftwa.nosp@m.re.co.nosp@m.m
Alessandro Pasetti paset.nosp@m.ti@p.nosp@m.np-so.nosp@m.ftwa.nosp@m.re.co.nosp@m.m

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.h.

Function Documentation

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.

Parameters
smDescthe descriptor of the OutManager State Machine.
Returns
the number of OutComponents successfully loaded in the POCL of an OutManager.

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.

Parameters
smDescthe descriptor of the OutManager State Machine.
Returns
the number of OutComponents currently in the POCL of an OutManager.

Definition at line 276 of file CrFwOutManager.c.

CrFwCounterU1_t CrFwOutManagerGetPOCLSize ( FwSmDesc_t  smDesc)

Return the size of the POCL of an OutManager.

Parameters
smDescthe descriptor of the OutManager State Machine.
Returns
the size of the POCL of an OutManager.

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:

  • it is initialized to point to the first entry in the POCL;
  • after the execution of the load function, freePos either points to the next free position in the POCL or is equal to the POCL size if the POCL is full;
  • after execution of the OutManager, it is re-initialized to point to the first position in the POCL.
OutManagerLoad.png
Parameters
smDescthe descriptor of the OutManager State Machine.
outCmpthe descriptor of the OutComponent to be loaded in the OutManager
Returns
1 if the load operation was successful (the POCL was not full and the OutComponent was successfully loaded in the OutManager) or 0 if the load operation has failed (the POCL was full and the OutComponent could not 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.

Parameters
outManagerIdthe identifier of the OutManager
Returns
the descriptor of the OutManager State Machine or NULL if the state machine could not be created or if the identifier i is out of range.

Definition at line 95 of file CrFwOutManager.c.

P&P Software GmbH, Copyright 2012-2013, All Rights Reserved