logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

TF_2Port, TF_Direct - transfer function subclasses

Description

       The TransferFunct abstract base class defines the transfer function protocol.  The library predefines two
       subclasses.  TF_2Port is a subclass that acts as an abstract base class for transfer functions having two
       sets of state variables, ``input'' and ``output'',  with  output  variables  always  dependent  on  input
       variables.  TF_Direct is a subclass of TF_2Port that defines a one-to-one assignment relationship between
       an input and an output state variable.

Name

       TF_2Port, TF_Direct - transfer function subclasses

See Also

TransferFunct(3U)

Unidraw                                           6 August 1990                                     transfns(3U)

Synopsis

#include<Unidraw/transfns.h>

Tf_2Port Protected Operations

TF_2Port()
              The constructor is protected to prevent instantiation.

       virtualvoidTransfer()
              Enforce the subclass-specific dependencies between the TF_2Port's state variables.  This operation
              does nothing by default.

       virtualbooleanChangedOutput(intindex=0)
              Return whether the output state variable with the given index has changed its value since the last
              call to Transfer.  Subclasses redefine this operation according to the semantics of their Transfer
              operation.

Tf_2Port Public Operations

voidEvaluate(Path*=nil)
              Evaluate  first  carries out information transfer between dependent state variables by calling the
              Transfer operation (described below).  Then it iterates through its output state variables;  those
              that  have changed (according to the ChangedOutput operation, described below) get Transmit called
              on the connector they're bound to.  Subclasses needn't redefine this operation if  they  implement
              Transfer and ChangedOutput appropriately.

       virtualStateVar*GetInput(intindex)virtualStateVar*GetOutput(intindex)virtualvoidSetInput(StateVar*,intindex)virtualvoidSetOutput(StateVar*,intindex)
              Retrieve  and  assign the TF_2Port's input and output state variables, identified serially.  These
              operations do nothing by default; subclasses must allocate the storage they require.

       virtualintInputs()virtualintOutputs()
              Return the number of input and output state variables.  These operations return zero by default.

Tf_Direct Protected Operations

virtualvoidTransfer()
              Assign the input state variable to the output state variable, setting a flag indicating  that  the
              output value has changed.

       virtualbooleanChangedOutput(intindex=0)
              Return  the  status  of  the  flag  set  by  Transfer.  The flag is reset as a side-effect of this
              operation.

Tf_Direct Public Operations

TF_Direct(StateVar*input=nil,StateVar*output=nil)
              Instantiate a new object, optionally specifying the input state variable and its dependent  output
              state variable.

       virtualStateVar*GetInput(intindex=0)virtualStateVar*GetOutput(intindex=0)virtualvoidSetInput(StateVar*,intindex=0)virtualvoidSetOutput(StateVar*,intindex=0)
              Retrieve and assign the TF_Direct's input and output state variables.  Specifying an index greater
              than  zero  does  nothing,  since  TF_Direct defines a dependency between one input and one output
              state variable.

       virtualintInputs()virtualintOutputs()
              Return the number of input and output state variables.  These operations return zero by default.

       virtualintInputs()virtualintOutputs()
              These operations return 1.

See Also