From dd1ec536daf04863d614cabbfb7b07aabcc6643e Mon Sep 17 00:00:00 2001 From: Jason Hiser <jdhiser@gmail.com> Date: Tue, 12 Mar 2019 19:41:49 -0400 Subject: [PATCH] cleaning up thanos-plugin capability --- include/inc-core/transform_step.h | 34 +++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/include/inc-core/transform_step.h b/include/inc-core/transform_step.h index 7fb5ce9..ea4ca8f 100644 --- a/include/inc-core/transform_step.h +++ b/include/inc-core/transform_step.h @@ -17,18 +17,36 @@ namespace IRDB_SDK { + class TransformStepState_t; + class ThanosPlugin_t; + using namespace std; class TransformStep_t { - protected: - TransformStep_t() { } public: virtual ~TransformStep_t(void) { } - virtual string getStepName(void) const = 0; + // abstract methods for plugin to implement + virtual string getStepName(void) const = 0; + + virtual int parseArgs(const vector<string> step_args) = 0; + virtual int executeStep() = 0; + + protected: + TransformStep_t() { } // Thanos plugins can create these + + // helper methods for plugin to use + virtual File_t* getMainFile() final; + virtual FileIR_t* getMainFileIR() final; + virtual DatabaseID_t getVariantID() final; + virtual IRDBObjects_t*const getIRDBObjects() final; + + private: + // private data can only be accessed by protected accessors. + TransformStepState_t* m_state = nullptr; + virtual void setState(TransformStepState_t* p_state) final; + friend class ThanosPlugin_t; - virtual int parseArgs(const vector<string> step_args) = 0; - virtual int executeStep(IRDBObjects_t *const irdb_objects) = 0; }; } @@ -38,6 +56,10 @@ namespace IRDB_SDK // so that thanos can use it as a factory to create your transform class. It must // follow this signature: // -// extern "C" std::shared_ptr<TransformStep_t> GetTransformStep(void); +// extern "C" std::shared_ptr<TransformStep_t> getTransformStep(void); +// { +// return shared_ptr<TransformStep_t>(new YourClassHere_t()); +// } + -- GitLab