OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ActionAndFunctionHandler.h
Go to the documentation of this file.
1#pragma once
2
3// OpenTwin header
4#include "OTCore/JSON.h"
6
7// std header
8#include <string>
9
12public:
15
16 void setDontDeleteHandler(bool _dontDelete = true) { m_dontDeleteHandler = _dontDelete; };
17 void setNextHandler(ActionAndFunctionHandler* _nextHandler) { m_nextHandler = _nextHandler; };
18
19 bool tryToHandleAction(const std::string& _action, ot::JsonDocument& _doc);
20
21protected:
22 virtual bool handleAction(const std::string& _action, ot::JsonDocument& _doc) { return false; };
23
24private:
25 ActionAndFunctionHandler* getNextHandler(void) { return m_nextHandler; }
26 ActionAndFunctionHandler* m_nextHandler;
27 bool m_dontDeleteHandler;
28};
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
Definition ActionAndFunctionHandler.h:10
virtual bool handleAction(const std::string &_action, ot::JsonDocument &_doc)
Definition ActionAndFunctionHandler.h:22
ActionAndFunctionHandler()
Definition ActionAndFunctionHandler.cpp:6
virtual ~ActionAndFunctionHandler()
Definition ActionAndFunctionHandler.cpp:12
void setNextHandler(ActionAndFunctionHandler *_nextHandler)
Definition ActionAndFunctionHandler.h:17
void setDontDeleteHandler(bool _dontDelete=true)
Definition ActionAndFunctionHandler.h:16
bool tryToHandleAction(const std::string &_action, ot::JsonDocument &_doc)
Definition ActionAndFunctionHandler.cpp:21
JSON document.
Definition JSON.h:276