CORDET Framework - C2 Implementation

Definition of the OutLoader component. More...

Go to the source code of this file.

Typedefs

typedef FwSmDesc_t(* CrFwOutManagerSelect_t) (FwSmDesc_t outCmp)
 Type for a pointer to a function implementing the OutManager Selection Operation. More...
 
typedef void(* CrFwOutManagerActivate_t) (FwSmDesc_t outManager)
 Type for a pointer to a function implementing the OutManager Activation Operation. More...
 

Functions

FwSmDesc_t CrFwOutLoaderMake ()
 Factory function to retrieve the OutLoader State Machine instance. More...
 
CrFwBool_t CrFwOutLoaderLoad (FwSmDesc_t outCmp)
 Load an OutComponent into its OutManager. More...
 
FwSmDesc_t CrFwOutLoaderDefOutManagerSelect (FwSmDesc_t outCmp)
 Default implementation of the OutManager Selection Operation. More...
 
void CrFwOutLoadDefOutManagerActivate (FwSmDesc_t outManager)
 Default implementation of the OutManager Activation Operation. More...
 

Detailed Description

Definition of the OutLoader component.

After a user application has obtained an OutComponent component from an OutFactory, it loads it into the OutLoader. This component is responsible for selecting the appropriate OutManager to process the out-going command or report. For this purpose, the OutLoader maintains a list of all OutManagers in an application (the List of OutManagers or LOM).

The OutLoader is defined as an extension of the Base Component (see CrFwBaseCmp.h). The OutLoader component offers one operation – the Load operation – to load an OutComponent into an OutLoader. This operation executes the behaviour shown in the figure below.

When the Load operation is called, the OutLoader decides to which OutManager in the LOM to load an OutComponent. The policy for selecting the OutManager in the LOM is an adaptation point. After the OutComponent is loaded into the selected OutManager, the procedure may activate the selected OutManager (i.e. it may release the thread which is controlling the execution of the selected OutManager). This is useful where there is a need to process the out-going command or report as soon as it is loaded into the OutManager (since the command or report is only processed when the OutManager is executed).

Mode of Use of an OutLoader Component

The configuration of the OutLoader components is defined statically in CrFwOutLoaderUserPar.h.

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

Note that the OutLoader is a singleton and an application can only have one instance of an OutLoader.

An OutLoader offers a Load operation (CrFwOutLoaderLoad) through which an OutComponent can be loaded into an OutManager. This operation is normally called by a user component after it has configured an OutComponent and when it wishes the OutComponent to be sent to its destination.

The OutLoader autonomously selects the OutManager to which an OutComponent should be loaded. The selection algorithm is an adaptation point for the OutLoader.

By default, the initialization, reset and shutdown operations are the same as on the Base Component but these operations are implemented as adaptation points so that the user has a chance to use them to initialize or reset the data structures which are used to control the selection of the OutManager where an out-going command or report is loaded.

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

Typedef Documentation

◆ CrFwOutManagerActivate_t

typedef void(* CrFwOutManagerActivate_t) (FwSmDesc_t outManager)

Type for a pointer to a function implementing the OutManager Activation Operation.

The OutManager Activation Operation is one of the adaptation points of the framework. This function can be used to activate an OutManager. An OutManager is activated by releasing the thread which controls its execution.

Definition at line 92 of file CrFwOutLoader.h.

◆ CrFwOutManagerSelect_t

typedef FwSmDesc_t(* CrFwOutManagerSelect_t) (FwSmDesc_t outCmp)

Type for a pointer to a function implementing the OutManager Selection Operation.

The OutManager Selection Operation is one of the adaptation points of the framework. A function which implements this operation takes an OutComponent as argument and returns the OutManager where the OutComponent should be loaded.

Definition at line 84 of file CrFwOutLoader.h.

Function Documentation

◆ CrFwOutLoadDefOutManagerActivate()

void CrFwOutLoadDefOutManagerActivate ( FwSmDesc_t  outManager)

Default implementation of the OutManager Activation Operation.

This implementation returns without doing anything.

Parameters
outManagerthe descriptor of the OutManager to be activated (this argument is not used in this implementation)

Definition at line 139 of file CrFwOutLoader.c.

◆ CrFwOutLoaderDefOutManagerSelect()

FwSmDesc_t CrFwOutLoaderDefOutManagerSelect ( FwSmDesc_t  outCmp)

Default implementation of the OutManager Selection Operation.

This implementation always returns the first OutManager (i.e. the OutManager returned by CrFwOutManagerMake when it is called with an argument equal to zero).

Parameters
outCmpthe descriptor of the OutComponent loaded into the OutLoader (this argument is not used in this implementation)
Returns
the first OutManager

Definition at line 133 of file CrFwOutLoader.c.

◆ CrFwOutLoaderLoad()

CrFwBool_t CrFwOutLoaderLoad ( FwSmDesc_t  outCmp)

Load an OutComponent into its OutManager.

This function runs the procedure shown in the figure below. The procedure has two adaptation points which are defined by specifying two functions in CrFwOutLoaderUserPar.h.

After execution of this function, the OutComponent must not be used by the caller because it has either been released (if the load operation in the OutManager was not successful) or will be released by the OutManager after it is executed.

Parameters
outCmpthe descriptor of the OutComponent to be loaded in the OutManager
Returns
1 if the OutComponent was successfully loaded in the OutManager; 0 otherwise

Definition at line 121 of file CrFwOutLoader.c.

◆ CrFwOutLoaderMake()

FwSmDesc_t CrFwOutLoaderMake ( )

Factory function to retrieve the OutLoader State Machine instance.

The first time this function is called, it creates the OutLoader instance. Subsequent calls returns the same instance.

The first time this function is called, it returns the OutLoader State Machine which has been started but which still needs to be initialized and configured.

Returns
the descriptor of the OutLoader State Machine or NULL if the state machine could not be created.

Definition at line 75 of file CrFwOutLoader.c.

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