Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

CopyControlBlock Class Reference
[Data Processing]

#include <CopyControlBlock.h>

Inheritance diagram for CopyControlBlock:

ControlBlock CC_RootObject DC_DummyCopyControlBlock DC_MatlabCopyPID List of all members.

Detailed Description

Base class for copy control blocks.

A copy control block is a control block that implements a copy link to its inputs and outputs. It adds to its ControlBlock base class the following attributes:<ul> The input buffers: internal data structure where the values of the control block inputs are copied at the beginning of a propagation cycle. The state propagation and output update services read the value of the inputs from the input buffers. The output buffers: internal data structure where the values of the control block outputs are written by the output update service. These values are intended to be copied to the external output destination locations. The input and output buffers are implemented as arrays. They are declared protected to give concrete subclasses ready access to them.

This class adds services to copy the input values from their external locations to the internal input buffers and to copy the output values from the internal output buffers to their external destinations.

Author:
Alessandro Pasetti (P&P Software GmbH)

Roberto Totaro

Version:
1.0

Definition at line 41 of file CopyControlBlock.h.

Public Member Functions

 CopyControlBlock (void)
 Instantiate a copy control block.

TD_Float getInput (unsigned int i) const
 Return the value of the i-th input.

TD_Float getOutput (unsigned int i) const
 Return the value of the i-th output.

void setInput (unsigned int i, TD_Float newValue)
 Set the value of the i-th input.

void setOutput (unsigned int i, TD_Float newValue)
 Set the value of the i-th output.

virtual void reset (void)
 Reset the control block bringing its state and input and output buffers to the values they had when the configuration process of the control block was terminated.


Protected Member Functions

virtual void setNumberOfInputs (unsigned int n)
 Set the number of inputs.

virtual void setNumberOfOutputs (unsigned int n)
 Set the number of outputs.


Protected Attributes

TD_Floatu
 Array to hold the input buffer.

TD_Floaty
 Array to hold the output buffer.


Constructor & Destructor Documentation

CopyControlBlock::CopyControlBlock void   ) 
 

Instantiate a copy control block.

The input and output buffers are initialized to illegal values to signify that the control block is not yet configured.

Definition at line 19 of file CopyControlBlock.cpp.


Member Function Documentation

TD_Float CopyControlBlock::getInput unsigned int  i  )  const
 

Return the value of the i-th input.

The argument i must lie in the interval [0,n-1] where n is the number of inputs. No check is performed on the legality of the index i.

Returns:
the value of the i-th input variable
Parameters:
i the index of the input variable

Definition at line 62 of file CopyControlBlock.cpp.

TD_Float CopyControlBlock::getOutput unsigned int  i  )  const
 

Return the value of the i-th output.

The argument i must lie in the interval [0,n-1] where n is the number of outputs. No check is performed on the legality of the index i.

Returns:
the value of the i-th output variable
Parameters:
i the index of the output variable

Definition at line 68 of file CopyControlBlock.cpp.

void CopyControlBlock::reset void   )  [virtual]
 

Reset the control block bringing its state and input and output buffers to the values they had when the configuration process of the control block was terminated.

A pseudocode implementation of this method is as follows:<PRE> ControlBlock::reset(); // call method in super class to reset the state reset the input buffers to zero; reset the output buffers to zero;

Reimplemented from ControlBlock.

Reimplemented in DC_DummyCopyControlBlock, and DC_MatlabCopyPID.

Definition at line 74 of file CopyControlBlock.cpp.

void CopyControlBlock::setInput unsigned int  i,
TD_Float  newValue
 

Set the value of the i-th input.

The argument i must lie in the interval [0,n-1] where n is the number of inputs. Illegal argument values trigger the generation of an event report EVT_ILLEGAL_CB.

Parameters:
newValue the new value of the i-th input variable
i the index of the input variable

Definition at line 44 of file CopyControlBlock.cpp.

void CopyControlBlock::setNumberOfInputs unsigned int  n  )  [protected, virtual]
 

Set the number of inputs.

This method causes the memory for the input buffer to be allocated. The number of inputs must be non-negative. The input values are initialized to zero. This is an initialization method: it shall be called only once.

Parameters:
n the number of inputs

Implements ControlBlock.

Definition at line 24 of file CopyControlBlock.cpp.

void CopyControlBlock::setNumberOfOutputs unsigned int  n  )  [protected, virtual]
 

Set the number of outputs.

This method causes the memory for the output buffer to be allocated. The number of outputs must be non-negative. The output values are initialized to zero. This is an initialization method: it shall be called only once.

Parameters:
n the number of outputs

Implements ControlBlock.

Definition at line 34 of file CopyControlBlock.cpp.

void CopyControlBlock::setOutput unsigned int  i,
TD_Float  newValue
 

Set the value of the i-th output.

The argument i must lie in the interval [0,n-1] where n is the number of outputs. Illegal argument values trigger the generation of an event report EVT_ILLEGAL_CB. This method should not normally be used since the output is computed internally by propagating the input and the state. It is provided for convenience only for non-nominal situations.

Parameters:
newValue the new value of the i-th output variable
i the index of the output variable

Definition at line 53 of file CopyControlBlock.cpp.


Member Data Documentation

TD_Float* CopyControlBlock::u [protected]
 

Array to hold the input buffer.

u[i] holds the i-th state variable with i lying in the interval [0,N-1] where N is the number of inputs.

See also:
ControlBlock::setNumberOfInputs

setInput

getInput

Definition at line 51 of file CopyControlBlock.h.

TD_Float* CopyControlBlock::y [protected]
 

Array to hold the output buffer.

y[i] holds the i-th output variable with i lying in the interval [0,N-1] where N is the number of outputs.

See also:
ControlBlock::setNumberOfOutputs

setOutput

getOutput

Definition at line 61 of file CopyControlBlock.h.


The documentation for this class was generated from the following files:
Copyright 2003 P&P Software GmbH - All Rights Reserved