SSCMA-Micro CPP SDK  v2.0.0
SSCMA-Micro is a cross-platform machine learning inference framework designed for embedded devices.
ma::EncoderJSON Class Referencefinal

#include <ma_codec_json.h>

Inheritance diagram for ma::EncoderJSON:
Collaboration diagram for ma::EncoderJSON:

Public Member Functions

 EncoderJSON ()
 
 ~EncoderJSON ()
 
 operator bool () const override
 Encoder is valid. More...
 
ma_err_t begin () override
 Encoder type for begin. More...
 
ma_err_t begin (ma_msg_type_t type, ma_err_t code, const std::string &name) override
 Encoder type for begin. More...
 
ma_err_t begin (ma_msg_type_t type, ma_err_t code, const std::string &name, const std::string &data) override
 Encoder type for begin. More...
 
ma_err_t begin (ma_msg_type_t type, ma_err_t code, const std::string &name, uint64_t data) override
 Encoder type for begin. More...
 
ma_err_t end () override
 Encoder type for end. More...
 
ma_err_t reset () override
 Reset the proto object. More...
 
ma_err_t remove (const std::string &key) override
 Encoder type for remove. More...
 
ma_err_t write (const std::string &key, const char *buffer, size_t size) override
 
ma_err_t write (const std::string &key, int8_t value) override
 Encoder type for write int8_t value. More...
 
ma_err_t write (const std::string &key, int16_t value) override
 Encoder type for write int16_t value. More...
 
ma_err_t write (const std::string &key, int32_t value) override
 Encoder type for write int32_t value. More...
 
ma_err_t write (const std::string &key, int64_t value) override
 Encoder type for write int64_t value. More...
 
ma_err_t write (const std::string &key, uint8_t value) override
 Encoder type for write uint8_t value. More...
 
ma_err_t write (const std::string &key, uint16_t value) override
 Encoder type for write uint16_t value. More...
 
ma_err_t write (const std::string &key, uint32_t value) override
 Encoder type for write uint32_t value. More...
 
ma_err_t write (const std::string &key, uint64_t value) override
 Encoder type for write uint64_t value. More...
 
ma_err_t write (const std::string &key, float value) override
 Encoder type for write float value. More...
 
ma_err_t write (const std::string &key, double value) override
 Encoder type for write double value. More...
 
ma_err_t write (const std::string &key, const std::string &value) override
 Encoder type for write const std::string value. More...
 
ma_err_t write (const std::string &key, ma_model_t value) override
 Encoder type for write ma_model_t value. More...
 
ma_err_t write (ma_perf_t value) override
 Encoder type for write ma_perf_t. More...
 
ma_err_t write (const std::forward_list< ma_class_t > &value) override
 Encoder type for write std::forward_list<ma_class_t> value. More...
 
ma_err_t write (const std::forward_list< ma_point_t > &value) override
 Encoder type for write std::vector<ma_point_t> value. More...
 
ma_err_t write (const std::forward_list< ma_bbox_t > &value) override
 Encoder type for write std::forward_list<ma_bbox_t> value. More...
 
ma_err_t write (const std::forward_list< ma_keypoint3f_t > &value) override
 Encoder type for write std::forward_list<ma_keypoint3f_t> value. More...
 
ma_err_t write (const std::vector< ma_model_t > &value) override
 Encoder type for write std::forward_list<ma_model_t> value. More...
 
ma_err_t write (const std::vector< Sensor * > &value) override
 
ma_err_t write (const Sensor *value, size_t preset) override
 
ma_err_t write (const in4_info_t &value) override
 
ma_err_t write (const in6_info_t &value) override
 
ma_err_t write (const ma_wifi_config_t &value, int *stat=nullptr) override
 
ma_err_t write (const ma_mqtt_config_t &value, int *stat=nullptr) override
 
ma_err_t write (const ma_mqtt_topic_config_t &value) override
 
ma_err_t write (int algo_id, int cat, int input_from, int tscore, int tiou) override
 
const std::string & toString () const override
 Encoder type for convert to string. More...
 
const void * data () const override
 Encoder type for get data. More...
 
const size_t size () const override
 Encoder type for get size. More...
 
- Public Member Functions inherited from ma::Encoder
 Encoder ()=default
 
virtual ~Encoder ()=default
 

Constructor & Destructor Documentation

◆ EncoderJSON()

ma::EncoderJSON::EncoderJSON ( )
Here is the call graph for this function:

◆ ~EncoderJSON()

ma::EncoderJSON::~EncoderJSON ( )

Member Function Documentation

◆ begin() [1/4]

ma_err_t ma::EncoderJSON::begin ( )
overridevirtual

Encoder type for begin.

Return values
MA_OKon success

Implements ma::Encoder.

Here is the call graph for this function:

◆ begin() [2/4]

ma_err_t ma::EncoderJSON::begin ( ma_msg_type_t  type,
ma_err_t  code,
const std::string &  name 
)
overridevirtual

Encoder type for begin.

Parameters
[in]type
[in]code
[in]name
Return values
MA_OKon success

Implements ma::Encoder.

Here is the call graph for this function:

◆ begin() [3/4]

ma_err_t ma::EncoderJSON::begin ( ma_msg_type_t  type,
ma_err_t  code,
const std::string &  name,
const std::string &  data 
)
overridevirtual

Encoder type for begin.

Parameters
[in]type
[in]code
[in]name
[in]data
Return values
MA_OKon success

Implements ma::Encoder.

Here is the call graph for this function:

◆ begin() [4/4]

ma_err_t ma::EncoderJSON::begin ( ma_msg_type_t  type,
ma_err_t  code,
const std::string &  name,
uint64_t  data 
)
overridevirtual

Encoder type for begin.

Parameters
[in]type
[in]code
[in]name
[in]data
Return values
MA_OKon success

Implements ma::Encoder.

Here is the call graph for this function:

◆ data()

const void * ma::EncoderJSON::data ( ) const
overridevirtual

Encoder type for get data.

Return values
data

Implements ma::Encoder.

Here is the caller graph for this function:

◆ end()

ma_err_t ma::EncoderJSON::end ( )
overridevirtual

Encoder type for end.

Return values
MA_OKon success

Implements ma::Encoder.

Here is the call graph for this function:

◆ operator bool()

ma::EncoderJSON::operator bool ( ) const
overridevirtual

Encoder is valid.

Return values
trueif valid
falseif invalid

Implements ma::Encoder.

◆ remove()

ma_err_t ma::EncoderJSON::remove ( const std::string &  key)
overridevirtual

Encoder type for remove.

Parameters
[in]key
Return values
MA_OKon success

Implements ma::Encoder.

◆ reset()

ma_err_t ma::EncoderJSON::reset ( )
overridevirtual

Reset the proto object.

Return values
MA_OKon success

Implements ma::Encoder.

Here is the caller graph for this function:

◆ size()

const size_t ma::EncoderJSON::size ( ) const
overridevirtual

Encoder type for get size.

Return values
size

Implements ma::Encoder.

◆ toString()

const std::string & ma::EncoderJSON::toString ( ) const
overridevirtual

Encoder type for convert to string.

Return values
std::string

Implements ma::Encoder.

◆ write() [1/27]

ma_err_t ma::EncoderJSON::write ( const in4_info_t &  value)
overridevirtual

Implements ma::Encoder.

◆ write() [2/27]

ma_err_t ma::EncoderJSON::write ( const in6_info_t &  value)
overridevirtual

Implements ma::Encoder.

◆ write() [3/27]

ma_err_t ma::EncoderJSON::write ( const ma_mqtt_config_t value,
int *  stat = nullptr 
)
overridevirtual

Implements ma::Encoder.

◆ write() [4/27]

ma_err_t ma::EncoderJSON::write ( const ma_mqtt_topic_config_t value)
overridevirtual

Implements ma::Encoder.

◆ write() [5/27]

ma_err_t ma::EncoderJSON::write ( const ma_wifi_config_t value,
int *  stat = nullptr 
)
overridevirtual

Implements ma::Encoder.

◆ write() [6/27]

ma_err_t ma::EncoderJSON::write ( const Sensor value,
size_t  preset 
)
overridevirtual

Implements ma::Encoder.

Here is the call graph for this function:

◆ write() [7/27]

ma_err_t ma::EncoderJSON::write ( const std::forward_list< ma_bbox_t > &  value)
overridevirtual

Encoder type for write std::forward_list<ma_bbox_t> value.

Parameters
[in]valuestd::forward_list<ma_bbox_t> typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [8/27]

ma_err_t ma::EncoderJSON::write ( const std::forward_list< ma_class_t > &  value)
overridevirtual

Encoder type for write std::forward_list<ma_class_t> value.

Parameters
[in]valuestd::forward_list<ma_class_t> typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [9/27]

ma_err_t ma::EncoderJSON::write ( const std::forward_list< ma_keypoint3f_t > &  value)
overridevirtual

Encoder type for write std::forward_list<ma_keypoint3f_t> value.

Parameters
[in]valuestd::forward_list<ma_keypoint3f_t> typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [10/27]

ma_err_t ma::EncoderJSON::write ( const std::forward_list< ma_point_t > &  value)
overridevirtual

Encoder type for write std::vector<ma_point_t> value.

Parameters
[in]valuestd::vector<ma_point_t> typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [11/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
const char *  buffer,
size_t  size 
)
overridevirtual

Implements ma::Encoder.

◆ write() [12/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
const std::string &  value 
)
overridevirtual

Encoder type for write const std::string value.

Parameters
[in]key
[in]valueconst std::string typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [13/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
double  value 
)
overridevirtual

Encoder type for write double value.

Parameters
[in]key
[in]valuedouble typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [14/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
float  value 
)
overridevirtual

Encoder type for write float value.

Parameters
[in]key
[in]valuefloat typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [15/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
int16_t  value 
)
overridevirtual

Encoder type for write int16_t value.

Parameters
[in]key
[in]valueint16_t typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [16/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
int32_t  value 
)
overridevirtual

Encoder type for write int32_t value.

Parameters
[in]key
[in]valueint32_t typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [17/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
int64_t  value 
)
overridevirtual

Encoder type for write int64_t value.

Parameters
[in]key
[in]valueint64_t typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [18/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
int8_t  value 
)
overridevirtual

Encoder type for write int8_t value.

Parameters
[in]key
[in]valueint8_t typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [19/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
ma_model_t  value 
)
overridevirtual

Encoder type for write ma_model_t value.

Parameters
[in]key
[in]valuema_model_t typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [20/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
uint16_t  value 
)
overridevirtual

Encoder type for write uint16_t value.

Parameters
[in]key
[in]valueuint16_t typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [21/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
uint32_t  value 
)
overridevirtual

Encoder type for write uint32_t value.

Parameters
[in]key
[in]valueuint32_t typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [22/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
uint64_t  value 
)
overridevirtual

Encoder type for write uint64_t value.

Parameters
[in]key
[in]valueuint64_t typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [23/27]

ma_err_t ma::EncoderJSON::write ( const std::string &  key,
uint8_t  value 
)
overridevirtual

Encoder type for write uint8_t value.

Parameters
[in]key
[in]valueuint8_t typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [24/27]

ma_err_t ma::EncoderJSON::write ( const std::vector< ma_model_t > &  value)
overridevirtual

Encoder type for write std::forward_list<ma_model_t> value.

Parameters
[in]valuestd::forward_list<ma_model_t> typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.

◆ write() [25/27]

ma_err_t ma::EncoderJSON::write ( const std::vector< Sensor * > &  value)
overridevirtual

Implements ma::Encoder.

◆ write() [26/27]

ma_err_t ma::EncoderJSON::write ( int  algo_id,
int  cat,
int  input_from,
int  tscore,
int  tiou 
)
overridevirtual

Implements ma::Encoder.

◆ write() [27/27]

ma_err_t ma::EncoderJSON::write ( ma_perf_t  value)
overridevirtual

Encoder type for write ma_perf_t.

Parameters
[in]valuema_perf_t typed value to write.
Return values
MA_OKon success

Implements ma::Encoder.