Help Center/
    
      
      Atlas 300 Application (Model 3000)/
      
      
        
        
        Matrix API Reference/
        
        
        Model Manager APIs (C++ Language)/
        
        
        Data Types/
        
      
      AIContext
    
  
  
    
        Updated on 2022-03-13 GMT+08:00
        
          
          
        
      
      
      
      
      
      
      
      
  
      
      
      
        
AIContext
  Saves the process context when the Process interface of the model manager is called asynchronously, including the key-value pair of the string type. This data type is defined in ai_types.h.
  
class AIContext
{
public:
    /*
    * @brief   Obtain a parameter.
    * @param [in] key   Key corresponding to the parameter
    * @return sring   Value corresponding to the key. If the value does not exist, a null string is returned.
    */
    const std::string GetPara(const std::string &key) const;
    /*
    * @brief   Set a parameter.
    * @param [in] key   Key corresponding to the parameter
    * @param [in] value   Value corresponding to the parameter
    */
    void AddPara(const std::string &key, const std::string &value);
    /*
    * @brief   Delete a parameter.
    * @param [in] key   Key corresponding to the parameter to be deleted
    */
    void DeletePara(const std::string &key);
    /*
     * @brief    Obtain all parameters.
    * @param [out] keys  Key corresponding to all parameters that have been set
    */
    void GetAllKeys(std::vector<std::string> &keys);
#if defined( __ANDROID__) || defined(ANDROID)
        std::string  Serialize();
        AIStatus  Deserialize(std::string str);
#endif
private:
    std::map<std::string, std::string> paras_; /** Definition of the name-value pairs of parameters */
};
 
   Parent topic: Data Types
  
 Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
                The system is busy. Please try again later.
                
            
        For any further questions, feel free to contact us through the chatbot.
Chatbot