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

#include <ma_codec_base.h>

Inheritance diagram for ma::Encoder:
Collaboration diagram for ma::Encoder:

Public Member Functions

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

Constructor & Destructor Documentation

◆ Encoder()

ma::Encoder::Encoder ( )
default

◆ ~Encoder()

virtual ma::Encoder::~Encoder ( )
virtualdefault

Member Function Documentation

◆ begin() [1/4]

virtual ma_err_t ma::Encoder::begin ( )
pure virtual

Encoder type for begin.

Return values
MA_OKon success

Implemented in ma::EncoderJSON.

Here is the caller graph for this function:

◆ begin() [2/4]

virtual ma_err_t ma::Encoder::begin ( ma_msg_type_t  type,
ma_err_t  code,
const std::string &  name 
)
pure virtual

Encoder type for begin.

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

Implemented in ma::EncoderJSON.

◆ begin() [3/4]

virtual ma_err_t ma::Encoder::begin ( ma_msg_type_t  type,
ma_err_t  code,
const std::string &  name,
const std::string &  data 
)
pure virtual

Encoder type for begin.

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

Implemented in ma::EncoderJSON.

◆ begin() [4/4]

virtual ma_err_t ma::Encoder::begin ( ma_msg_type_t  type,
ma_err_t  code,
const std::string &  name,
uint64_t  data 
)
pure virtual

Encoder type for begin.

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

Implemented in ma::EncoderJSON.

◆ data()

virtual const void* ma::Encoder::data ( ) const
pure virtual

Encoder type for get data.

Return values
data

Implemented in ma::EncoderJSON.

Here is the caller graph for this function:

◆ end()

virtual ma_err_t ma::Encoder::end ( )
pure virtual

Encoder type for end.

Return values
MA_OKon success

Implemented in ma::EncoderJSON.

Here is the caller graph for this function:

◆ operator bool()

virtual ma::Encoder::operator bool ( ) const
pure virtual

Encoder is valid.

Return values
trueif valid
falseif invalid

Implemented in ma::EncoderJSON.

◆ remove()

virtual ma_err_t ma::Encoder::remove ( const std::string &  key)
pure virtual

Encoder type for remove.

Parameters
[in]key
Return values
MA_OKon success

Implemented in ma::EncoderJSON.

◆ reset()

virtual ma_err_t ma::Encoder::reset ( )
pure virtual

Reset the proto object.

Return values
MA_OKon success

Implemented in ma::EncoderJSON.

◆ size()

virtual const size_t ma::Encoder::size ( ) const
pure virtual

Encoder type for get size.

Return values
size

Implemented in ma::EncoderJSON.

Here is the caller graph for this function:

◆ toString()

virtual const std::string& ma::Encoder::toString ( ) const
pure virtual

Encoder type for convert to string.

Return values
std::string

Implemented in ma::EncoderJSON.

◆ write() [1/27]

virtual ma_err_t ma::Encoder::write ( const in4_info_t &  value)
pure virtual

Implemented in ma::EncoderJSON.

◆ write() [2/27]

virtual ma_err_t ma::Encoder::write ( const in6_info_t &  value)
pure virtual

Implemented in ma::EncoderJSON.

◆ write() [3/27]

virtual ma_err_t ma::Encoder::write ( const ma_mqtt_config_t value,
int *  stat = nullptr 
)
pure virtual

Implemented in ma::EncoderJSON.

◆ write() [4/27]

virtual ma_err_t ma::Encoder::write ( const ma_mqtt_topic_config_t value)
pure virtual

Implemented in ma::EncoderJSON.

◆ write() [5/27]

virtual ma_err_t ma::Encoder::write ( const ma_wifi_config_t value,
int *  stat = nullptr 
)
pure virtual

Implemented in ma::EncoderJSON.

◆ write() [6/27]

virtual ma_err_t ma::Encoder::write ( const Sensor value,
size_t  preset 
)
pure virtual

Implemented in ma::EncoderJSON.

◆ write() [7/27]

virtual ma_err_t ma::Encoder::write ( const std::forward_list< ma_bbox_t > &  value)
pure virtual

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

Implemented in ma::EncoderJSON.

◆ write() [8/27]

virtual ma_err_t ma::Encoder::write ( const std::forward_list< ma_class_t > &  value)
pure virtual

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

Implemented in ma::EncoderJSON.

◆ write() [9/27]

virtual ma_err_t ma::Encoder::write ( const std::forward_list< ma_keypoint3f_t > &  value)
pure virtual

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

Implemented in ma::EncoderJSON.

◆ write() [10/27]

virtual ma_err_t ma::Encoder::write ( const std::forward_list< ma_point_t > &  value)
pure virtual

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

Implemented in ma::EncoderJSON.

◆ write() [11/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
const char *  buffer,
size_t  size 
)
pure virtual

Implemented in ma::EncoderJSON.

◆ write() [12/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
const std::string &  value 
)
pure virtual

Encoder type for write const std::string value.

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

Implemented in ma::EncoderJSON.

◆ write() [13/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
double  value 
)
pure virtual

Encoder type for write double value.

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

Implemented in ma::EncoderJSON.

◆ write() [14/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
float  value 
)
pure virtual

Encoder type for write float value.

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

Implemented in ma::EncoderJSON.

◆ write() [15/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
int16_t  value 
)
pure virtual

Encoder type for write int16_t value.

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

Implemented in ma::EncoderJSON.

◆ write() [16/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
int32_t  value 
)
pure virtual

Encoder type for write int32_t value.

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

Implemented in ma::EncoderJSON.

◆ write() [17/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
int64_t  value 
)
pure virtual

Encoder type for write int64_t value.

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

Implemented in ma::EncoderJSON.

◆ write() [18/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
int8_t  value 
)
pure virtual

Encoder type for write int8_t value.

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

Implemented in ma::EncoderJSON.

Here is the caller graph for this function:

◆ write() [19/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
ma_model_t  value 
)
pure virtual

Encoder type for write ma_model_t value.

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

Implemented in ma::EncoderJSON.

◆ write() [20/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
uint16_t  value 
)
pure virtual

Encoder type for write uint16_t value.

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

Implemented in ma::EncoderJSON.

◆ write() [21/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
uint32_t  value 
)
pure virtual

Encoder type for write uint32_t value.

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

Implemented in ma::EncoderJSON.

◆ write() [22/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
uint64_t  value 
)
pure virtual

Encoder type for write uint64_t value.

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

Implemented in ma::EncoderJSON.

◆ write() [23/27]

virtual ma_err_t ma::Encoder::write ( const std::string &  key,
uint8_t  value 
)
pure virtual

Encoder type for write uint8_t value.

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

Implemented in ma::EncoderJSON.

◆ write() [24/27]

virtual ma_err_t ma::Encoder::write ( const std::vector< ma_model_t > &  value)
pure virtual

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

Implemented in ma::EncoderJSON.

◆ write() [25/27]

virtual ma_err_t ma::Encoder::write ( const std::vector< Sensor * > &  value)
pure virtual

Implemented in ma::EncoderJSON.

◆ write() [26/27]

virtual ma_err_t ma::Encoder::write ( int  algo_id,
int  cat,
int  input_from,
int  tscore,
int  tiou 
)
pure virtual

Implemented in ma::EncoderJSON.

◆ write() [27/27]

virtual ma_err_t ma::Encoder::write ( ma_perf_t  value)
pure virtual

Encoder type for write ma_perf_t.

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

Implemented in ma::EncoderJSON.