Skip to content

Commit

Permalink
HPCC-31143 move GlobalGlobalCodeContextExtra into cpp file
Browse files Browse the repository at this point in the history
Signed-off-by: Shamser Ahmed <[email protected]>
  • Loading branch information
shamser committed Jan 29, 2024
1 parent 11340b3 commit cade573
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 18 deletions.
1 change: 1 addition & 0 deletions rtl/eclrtl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ set ( SRCS
rtlsize.hpp
rtltype.hpp
rtlbcdtest.cpp
wfcontext.cpp
wfcontext.hpp
)

Expand Down
88 changes: 88 additions & 0 deletions rtl/eclrtl/wfcontext.cpp
Original file line number Diff line number Diff line change
@@ -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);
}
36 changes: 18 additions & 18 deletions rtl/eclrtl/wfcontext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit cade573

Please sign in to comment.