From cade57386d244cfdbd5b0eab52d4c859ccd95936 Mon Sep 17 00:00:00 2001 From: Shamser Ahmed Date: Mon, 29 Jan 2024 10:59:49 +0000 Subject: [PATCH] HPCC-31143 move GlobalGlobalCodeContextExtra into cpp file Signed-off-by: Shamser Ahmed --- rtl/eclrtl/CMakeLists.txt | 1 + rtl/eclrtl/wfcontext.cpp | 88 +++++++++++++++++++++++++++++++++++++++ rtl/eclrtl/wfcontext.hpp | 36 ++++++++-------- 3 files changed, 107 insertions(+), 18 deletions(-) create mode 100644 rtl/eclrtl/wfcontext.cpp diff --git a/rtl/eclrtl/CMakeLists.txt b/rtl/eclrtl/CMakeLists.txt index 6f2b47c91d3..52dcb0ffc2f 100644 --- a/rtl/eclrtl/CMakeLists.txt +++ b/rtl/eclrtl/CMakeLists.txt @@ -64,6 +64,7 @@ set ( SRCS rtlsize.hpp rtltype.hpp rtlbcdtest.cpp + wfcontext.cpp wfcontext.hpp ) diff --git a/rtl/eclrtl/wfcontext.cpp b/rtl/eclrtl/wfcontext.cpp new file mode 100644 index 00000000000..f24b1cec64a --- /dev/null +++ b/rtl/eclrtl/wfcontext.cpp @@ -0,0 +1,88 @@ +#include "platform.h" +#include "wfcontext.hpp" + + +ICodeContext * GlobalCodeContextExtra::queryCodeContext() +{ + return &codeContextEx; +} + +void GlobalCodeContextExtra::fail(int code, const char *msg) +{ + gctx->fail(code, msg); +} + +bool GlobalCodeContextExtra::isResult(const char * name, unsigned sequence) +{ + return gctx->isResult(name, sequence); +} + +unsigned GlobalCodeContextExtra::getWorkflowIdDeprecated() +{ + return gctx->getWorkflowIdDeprecated(); +} + +void GlobalCodeContextExtra::doNotify(char const * name, char const * text) +{ + gctx->doNotify(name, text); +} + +int GlobalCodeContextExtra::queryLastFailCode() +{ + return gctx->queryLastFailCode(); +} + +void GlobalCodeContextExtra::getLastFailMessage(size32_t & outLen, char * & outStr, const char * tag) +{ + gctx->getLastFailMessage(outLen, outStr, tag); +} + +bool GlobalCodeContextExtra::fileExists(const char * filename) +{ + return gctx->fileExists(filename); +} + +void GlobalCodeContextExtra::deleteFile(const char * logicalName) +{ + gctx->deleteFile(logicalName); +} + +void GlobalCodeContextExtra::selectCluster(const char * cluster) +{ + gctx->selectCluster(cluster); +} + +void GlobalCodeContextExtra::restoreCluster() +{ + gctx->restoreCluster(); +} + +void GlobalCodeContextExtra::setWorkflowCondition(bool value) +{ + gctx->setWorkflowCondition(value); +} + +void GlobalCodeContextExtra::returnPersistVersion(const char * logicalName, unsigned eclCRC, unsigned __int64 allCRC, bool isFile) +{ + gctx->returnPersistVersion(logicalName, eclCRC, allCRC, isFile); +} + +void GlobalCodeContextExtra::setResultDataset(const char * name, unsigned sequence, size32_t len, const void *val, unsigned numRows, bool extend) +{ + gctx->setResultDataset(name, sequence, len, val, numRows, extend); +} + +void GlobalCodeContextExtra::getEventName(size32_t & outLen, char * & outStr) +{ + gctx->getEventName(outLen, outStr); +} + +void GlobalCodeContextExtra::getEventExtra(size32_t & outLen, char * & outStr, const char * tag) +{ + gctx->getEventExtra(outLen, outStr, tag); +} + +void GlobalCodeContextExtra::doNotify(char const * name, char const * text, const char * target) +{ + gctx->doNotify(name, text, target); +} diff --git a/rtl/eclrtl/wfcontext.hpp b/rtl/eclrtl/wfcontext.hpp index 2a9ab148c87..8e76330b02b 100644 --- a/rtl/eclrtl/wfcontext.hpp +++ b/rtl/eclrtl/wfcontext.hpp @@ -308,7 +308,7 @@ class IndirectCodeContext : implements ICodeContext ICodeContext * ctx; }; -class GlobalCodeContextExtra : implements IGlobalCodeContext +class ECLRTL_API GlobalCodeContextExtra : implements IGlobalCodeContext { private: // Wraps ICodeContext and overrides getWorkflowId() method @@ -322,23 +322,23 @@ class GlobalCodeContextExtra : implements IGlobalCodeContext IGlobalCodeContext * gctx; public: GlobalCodeContextExtra(IGlobalCodeContext * _gctx, unsigned _wfid) : codeContextEx(_gctx->queryCodeContext(), _wfid), gctx(_gctx) {} - virtual ICodeContext * queryCodeContext() override { return &codeContextEx; } - virtual void fail(int, const char *) override { gctx->fail(0, NULL); } - virtual bool isResult(const char * name, unsigned sequence) override { return gctx->isResult(name, sequence); } - virtual unsigned getWorkflowIdDeprecated() override { return gctx->getWorkflowIdDeprecated(); } - virtual void doNotify(char const * name, char const * text) override { gctx->doNotify(name, text); } - virtual int queryLastFailCode() override { return gctx->queryLastFailCode(); } - virtual void getLastFailMessage(size32_t & outLen, char * & outStr, const char * tag) override { gctx->getLastFailMessage(outLen, outStr, tag); } - virtual bool fileExists(const char * filename) override { return gctx->fileExists(filename); } - virtual void deleteFile(const char * logicalName) override { gctx->deleteFile(logicalName); } - virtual void selectCluster(const char * cluster) override { gctx->selectCluster(cluster); } - virtual void restoreCluster() override { gctx->restoreCluster(); } - virtual void setWorkflowCondition(bool value) override { gctx->setWorkflowCondition(value); } - virtual void returnPersistVersion(const char * logicalName, unsigned eclCRC, unsigned __int64 allCRC, bool isFile) override { gctx->returnPersistVersion(logicalName, eclCRC, allCRC, isFile); } - virtual void setResultDataset(const char * name, unsigned sequence, size32_t len, const void *val, unsigned numRows, bool extend) override { gctx->setResultDataset(name, sequence, len, val, numRows, extend); } - virtual void getEventName(size32_t & outLen, char * & outStr) override { gctx->getEventName(outLen, outStr); } - virtual void getEventExtra(size32_t & outLen, char * & outStr, const char * tag) override { gctx->getEventExtra(outLen, outStr, tag); } - virtual void doNotify(char const * name, char const * text, const char * target) override { gctx->doNotify(name, text, target); } + virtual ICodeContext * queryCodeContext() override; + virtual void fail(int code, const char *msg) override; + virtual bool isResult(const char * name, unsigned sequence) override; + virtual unsigned getWorkflowIdDeprecated() override; + virtual void doNotify(char const * name, char const * text); + virtual int queryLastFailCode() override; + virtual void getLastFailMessage(size32_t & outLen, char * & outStr, const char * tag); + virtual bool fileExists(const char * filename) override; + virtual void deleteFile(const char * logicalName) override; + virtual void selectCluster(const char * cluster) override; + virtual void restoreCluster() override; + virtual void setWorkflowCondition(bool value) override; + virtual void returnPersistVersion(const char * logicalName, unsigned eclCRC, unsigned __int64 allCRC, bool isFile) override; + virtual void setResultDataset(const char * name, unsigned sequence, size32_t len, const void *val, unsigned numRows, bool extend) override; + virtual void getEventName(size32_t & outLen, char * & outStr) override; + virtual void getEventExtra(size32_t & outLen, char * & outStr, const char * tag) override; + virtual void doNotify(char const * name, char const * text, const char * target) override; }; #endif