9 #define MA_STORAGE_KEY_ALGORITHM_ID "ma#algorithm_id"
22 bool called_by_event =
false) {
24 const auto& cmd = argv[0];
25 const size_t algorithm_id = std::atoi(argv[1].c_str());
30 if (!called_by_event) {
31 MA_STORAGE_SET_POD(ret,
40 transport.
send(
reinterpret_cast<const char*
>(encoder.
data()), encoder.
size());
49 if (!transport || !*transport) {
54 size_t algorithm_id = 0;
58 std::vector<std::string> args{
"INIT@ALGORITHM", std::to_string(
static_cast<int>(algorithm_id))};
64 const auto& cmd = argv[0];
70 transport.
send(
reinterpret_cast<const char*
>(encoder.
data()), encoder.
size());
#define MA_STORAGE_KEY_ALGORITHM_ID
Definition: algorithm.hpp:9
Definition: ma_codec_base.h:14
virtual ma_err_t end()=0
Encoder type for end.
virtual const void * data() const =0
Encoder type for get data.
virtual ma_err_t begin()=0
Encoder type for begin.
virtual ma_err_t write(const std::string &key, int8_t value)=0
Encoder type for write int8_t value.
virtual const size_t size() const =0
Encoder type for get size.
Definition: ma_transport.h:12
virtual size_t send(const char *data, size_t length) noexcept=0
#define MA_LOGD(TAG,...)
Definition: ma_debug.h:79
#define MA_ASSERT(expr)
Definition: ma_debug.h:119
#define MA_TAG
Definition: ma_debug.h:9
@ MA_MSG_TYPE_RESP
Definition: ma_types.h:252
ma_err_t
Definition: ma_types.h:21
@ MA_OK
Definition: ma_types.h:23
Definition: algorithm.hpp:11
void getAvailableAlgorithms(const std::vector< std::string > &argv, Transport &transport, Encoder &encoder)
Definition: algorithm.hpp:13
void getAlgorithmInfo(const std::vector< std::string > &argv, Transport &transport, Encoder &encoder)
Definition: algorithm.hpp:62
void configureAlgorithm(const std::vector< std::string > &argv, Transport &transport, Encoder &encoder, bool called_by_event=false)
Definition: algorithm.hpp:19
void initDefaultAlgorithm(Encoder &encoder)
Definition: algorithm.hpp:43
#define static_resource
Definition: resource.hpp:64