diff --git a/cpp/dynmodule.cc b/cpp/dynmodule.cc new file mode 100644 index 0000000..610750e --- /dev/null +++ b/cpp/dynmodule.cc @@ -0,0 +1,41 @@ +#include "dynmodule.h" + +DynModule::DynModule() +{ +} + +DynModule::~DynModule() +{ + +} + +bool DynModule::IsDataMsg(int msgid) +{ + return false; +} + +bool DynModule::IsPending() +{ + return module_state_.pending; +} + +bool DynModule::DataIsValid() +{ + return module_state_.data_is_valid; +} + +void DynModule::MarkDataValid() +{ + module_state_.data_is_valid = true; +} + +void DynModule::MarkPending() +{ + module_state_.pending = true; +} + +void DynModule::CancelPending() +{ + module_state_.pending = false; +} + diff --git a/cpp/dynmodule.h b/cpp/dynmodule.h new file mode 100644 index 0000000..c64e313 --- /dev/null +++ b/cpp/dynmodule.h @@ -0,0 +1,24 @@ +#pragma once + +struct DynModuleState +{ + bool pending = false; + bool data_is_valid = false;; +}; + +class DynModule +{ + public: + DynModule(); + ~DynModule(); + virtual bool IsDataMsg(int msgid); + bool IsPending(); + bool DataIsValid(); + void MarkDataValid(); + void MarkPending(); + void CancelPending(); + + private: + DynModuleState module_state_; +}; +