diff --git a/include/inc-core/transform_step.h b/include/inc-core/transform_step.h index 7fb5ce9381d8ca4cd80ad21af8c46ce551442bc4..ea4ca8f570d54838feccb796568f2af0d1088240 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()); +// } +