/
NNObject

NNObject

class NNObject { public: virtual uint64_t getID(); virtual void setID(uint64_t dataID); virtual uint64_t getTime(); public: // Integer data storage and retrieval methods virtual void setInt(uint32_t key, int32_t value); virtual int getInt(uint32_t key, int32_t& value); // Boolean data storage and retrieval methods virtual void setBool(uint32_t key, bool value); virtual int getBool(uint32_t key, bool& value); // Float data storage and retrieval methods virtual void setFloat(uint32_t key, float value); virtual int getFloat(uint32_t key, float& value); // String data storage and retrieval methods virtual void setString(uint32_t key, std::string value); virtual int getString(uint32_t key, std::string& value); // Raw data storage and retrieval methods virtual void setRawData(uint32_t key, std::shared_ptr<NNRawData> value); virtual int getRawData(uint32_t key, std::shared_ptr<NNRawData>& value); };

Introduction to the class

A base class for neural network objects that encapsulates common attributes and methods for data storage and retrieval.

This class provides a framework for storing and retrieving various types of data (integers, booleans, floats, strings, and raw data) associated with a unique ID and timestamp. It uses virtual methods to allow for extension and customization in derived classes.

Introduction to the class's methods

  1. uint64_t getID()

    • brief: Gets the unique ID associated with this object

    • return uint64_t: The unique ID.

  2. void setID(uint64_t dataID)

    • brief: Sets the unique ID for this object.

    • param

      • dataID: A shared pointer to an `NNResultListener` object.

  3. uint64_t getTime()

    • brief: Gets the timestamp associated with this object.

    • return uint64_t: The timestamp.

  4. void setInt(uint32_t key, int32_t value)

    • brief: Sets an integer value associated with a specific key.

    • param

      • key: The key to associate the value with.

      • value: The integer value to set.

  5. int getInt(uint32_t key, int32_t& value)

    • brief: Gets an integer value associated with a specific key.

    • param

      • key: The key to retrieve the value for.

      • value: A reference to store the retrieved integer value.

    • return int: 0 if the key is found and value is set, otherwise a non-zero error code.

  6. void setBool(uint32_t key, bool value)

    • brief: Sets an boolean value associated with a specific key.

    • param

      • key: The key to associate the value with.

      • value: The boolean value to set.

  7. int getBool(uint32_t key, bool& value)

    • brief: Gets an boolean value associated with a specific key.

    • param

      • key: The key to retrieve the value for.

      • value: A reference to store the retrieved boolean value..

    • return bool: 0 if the key is found and value is set, otherwise a non-zero error code.

  8. void setFloat(uint32_t key, float value)

    • brief: Sets an float value associated with a specific key.

    • param

      • key: The key to associate the value with.

      • value: The float value to set.

  9. int getFloat(uint32_t key, float& value)

    • brief: Gets an float value associated with a specific key.

    • param

      • key: The key to retrieve the value for.

      • value: A reference to store the retrieved float value.

    • return float: 0 if the key is found and value is set, otherwise a non-zero error code.

  10. void setString(uint32_t key, std::string value)

    • brief: Sets an string value associated with a specific key.

    • param

      • key: The key to associate the value with.

      • value: The string value to set.

  11. int getString(uint32_t key, std::string& value)

    • brief: Gets an string value associated with a specific key.

    • param

      • key: The key to retrieve the value for.

      • value: A reference to store the retrieved string value..

    • return float: 0 if the key is found and value is set, otherwise a non-zero error code.

  12. void setRawData(uint32_t key, std::shared_ptr<NNRawData> value)

    • brief: Sets raw data associated with a specific key.

    • param

      • key: The key to associate the value with.

      • value: The shared pointer to raw data to set.

  13. int getRawData(uint32_t key, std::shared_ptr<NNRawData>& value)

    • brief: Gets raw data associated with a specific key.

    • param

      • key: The key to retrieve the value for.

      • value: A reference to store the retrieved shared pointer to raw data.

    • return float: 0 if the key is found and value is set, otherwise a non-zero error code.