transfns(3U)
π« transfns β it's giving transfer function subclasses π«
okay bestie, welcome to transfns(3U) from the InterViews Reference Manual, and no cap this one is lowkey the blueprint for how state variables talk to each other in Unidraw. π«Ά
β¨ NAME β¨
TF_2Port, TF_Direct β transfer function subclasses, periodt.
π SYNOPSIS π
#include <Unidraw/transfns.h>
π¦ DESCRIPTION π¦
so the TransferFunct abstract base class is literally the main character that defines the transfer function protocol. iconic. and the library predefines two subclasses for you:
TF_2Portβ a subclass that acts as an abstract base class for transfer functions that have two sets of state variables:input''</cyan> and <cyan>output''. the output variables are always dependent on the input variables. that's the whole vibe, iykyk.TF_Directβ a subclass ofTF_2Portthat defines a one-to-one assignment relationship between an input and an output state variable. simple, clean, slay.
π TF_2PORT PUBLIC OPERATIONS π
void Evaluate(Path* = nil)β okay so firstEvaluatecarries out information transfer between dependent state variables by calling theTransferoperation (more on that below π). then it iterates through its output state variables, and the ones that have changed (according to theChangedOutputoperation, also below) getTransmitcalled on the connector they're bound to. good news: subclasses don't need to redefine this operation if they implementTransferandChangedOutputappropriately. you're welcome. πvirtual StateVar* GetInput(int index)virtual StateVar* GetOutput(int index)virtual void SetInput(StateVar*, int index)virtual void SetOutput(StateVar*, int index)β retrieve and assign theTF_2Port's input and output state variables, identified serially. by default these operations do nothing π β subclasses must allocate the storage they require. no storage, no service.virtual int Inputs()virtual int Outputs()β return the number of input and output state variables. these operations returnzeroby default. yeah. zero. it's giving empty nest.
πΈ TF_2PORT PROTECTED OPERATIONS πΈ
TF_2Port()β the constructor is protected to prevent instantiation. so don't even try to instantiate it directly, bestie, it's not for you like that. π«virtual void Transfer()β enforce the subclass-specific dependencies between theTF_2Port's state variables. this operation does nothing by default.virtual boolean ChangedOutput(int index = 0)β return whether the output state variable with the givenindexhas changed its value since the last call toTransfer. subclasses redefine this operation according to the semantics of theirTransferoperation. the way that's so customisable of them β¨
π 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. cute, right?virtual StateVar* GetInput(int index = 0)virtual StateVar* GetOutput(int index = 0)virtual void SetInput(StateVar*, int index = 0)virtual void SetOutput(StateVar*, int index = 0)β retrieve and assign theTF_Direct's input and output state variables. specifying an index greater than zero does nothing, sinceTF_Directdefines a dependency between one input and one output state variable. one in, one out. monogamy. πvirtual int Inputs()virtual int Outputs()β return the number of input and output state variables. these operations returnzeroby default.virtual int Inputs()virtual int Outputs()β these operations return1.
not me listingInputsandOutputstwice because the page does π both entries are here, exactly as written, so you're not missing a single crumb. π
β TF_DIRECT PROTECTED OPERATIONS β
virtual void Transfer()β assign the input state variable to the output state variable, setting a flag indicating that the output value has changed. flag raised, glow up complete. π©β¨virtual boolean ChangedOutput(int index = 0)β return the status of the flag set byTransfer. the flag is reset as a side-effect of this operation. so reading it is a one-time deal, no cap β peek once and it's gone. π
π SEE ALSO π
TransferFunct(3U)
and that's the whole page, bestie, we ate and left no crumbs. π π
this was transfns(3U) from Unidraw, dated 6 August 1990 β yeah, she's vintage, and she's still serving. π mwah, go implement Transfer and ChangedOutput properly, love u, bye π«Άπ
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms