diff --git a/FunctionCore.cpp b/FunctionCore.cpp index 60db605..b03229d 100644 --- a/FunctionCore.cpp +++ b/FunctionCore.cpp @@ -126,7 +126,7 @@ TLocalIO * CFunctionCore::AddLocalIO( const char * IOName ) //--------------------------------------------------------------------------- // Automated Data Input/Output -bool CFunctionCore::AddInput( const char * IOName, CFunctionCore * OutFunction, const char * OutputName ) +bool CFunctionCore::AddInput( const char * IOName, CFunctionCore * OutFunction, const char * OutputName, bool Bidirectional ) { TLocalIO * LocalIO = NULL; TLinkedIO ** LinkedIO = NULL; @@ -158,11 +158,16 @@ bool CFunctionCore::AddInput( const char * IOName, CFunctionCore * OutFunction, LogMessage( dlLow, "%s: Input Linked - '%s'/'%s' <-- '%s'/'%s'", Name, Name, IOName, OutFunction->GetName(), OutputName ); } + // Link Return direction as well + if (Bidirectional) { + return OutFunction->AddInput( OutputName, this, IOName, false ); + } + return true; } //--------------------------------------------------------------------------- -bool CFunctionCore::AddOutput( const char * IOName, CFunctionCore * InFunction, const char * InputName ) +bool CFunctionCore::AddOutput( const char * IOName, CFunctionCore * InFunction, const char * InputName, bool Bidirectional ) { TLocalIO * LocalIO = NULL; TLinkedIO ** LinkedIO = NULL; @@ -192,7 +197,12 @@ bool CFunctionCore::AddOutput( const char * IOName, CFunctionCore * InFunction, // Log Event LogMessage( dlLow, "%s: Output Linked - '%s'/'%s' --> '%s'/'%s'", Name, Name, IOName, InFunction->GetName(), InputName ); -} + } + + // Link return direction as well + if (Bidirectional) { + return InFunction->AddOutput( InputName, this, IOName, false ); + } return true; } diff --git a/FunctionCore.h b/FunctionCore.h index e9654bc..3b4a553 100644 --- a/FunctionCore.h +++ b/FunctionCore.h @@ -79,8 +79,8 @@ public: virtual int Output( const char * IOName, const char * Data, int Len = -1 ); // Automated Data Input/Output - virtual bool AddInput( const char * IOName, CFunctionCore * OutFunction, const char * OutputName ); - virtual bool AddOutput( const char * IOName, CFunctionCore * InFunction, const char * InputName ); + virtual bool AddInput( const char * IOName, CFunctionCore * OutFunction, const char * OutputName, bool Bidirectional ); + virtual bool AddOutput( const char * IOName, CFunctionCore * InFunction, const char * InputName, bool Bidirectional ); virtual bool Process() = 0; };