/
NNRawData

NNRawData

class NNRawData { public: static std::shared_ptr<NNRawData> createRawData(uint32_t bufferSize); static std::shared_ptr<NNRawData> createRawData(uint8_t* buffer, uint32_t dataSize); public: uint8_t* getBuffer(); uint32_t getBufferSize(); void setDataSize(uint32_t dataSize); uint32_t getDataSize(); void setDataType(uint32_t dataType); uint32_t getDataType(); public: virtual std::string toString(); };

Introduction to the class

A class representing raw data buffer.

This class manages raw data buffers used in neural network operations. It provides methods for creating, accessing, and manipulating the data buffer.

Introduction to the class's methods

  1. static std::shared_ptr<NNRawData> createRawData(uint32_t bufferSize)

    • brief: Creates a new `NNRawData` object with a buffer of a specified size. This method allocates a new buffer of the given size and initializes the `NNRawData` object with it.

    • param

      • bufferSize: The size of the buffer to allocate.

    • return shared_ptr<NNRawData>: A shared pointer to the created `NNRawData` object.

  2. static std::shared_ptr<NNRawData> createRawData(uint8_t* buffer, uint32_t dataSize)

    • brief: Creates a new `NNRawData` object using an existing buffer. This method initializes the `NNRawData` object with an existing buffer. Depending on the `deepCopy` parameter, it may create a deep copy of the buffer.

    • param

      • buffer: The existing buffer to use.

      • dataSize: The size of the data within the buffer.

    • return shared_ptr<NNRawData>: A shared pointer to the created `NNRawData` object.

  3. uint8_t* getBuffer()

    • brief: Gets the data buffer.

    • return uint8_t*: A pointer to the data buffer.

  4. uint32_t getBufferSize()

    • brief: Gets the size of the data buffer.

    • return uint32_t: The size of the data buffer.

  5. void setDataSize(uint32_t dataSize)

    • brief: Sets the size of the valid data within the buffer.

    • param

      • dataSize: The size of the valid data.

  6. uint32_t getDataSize()

    • brief: Gets the size of the valid data within the buffer.

    • return uint32_t: The size of the valid data.

  7. void setDataType(uint32_t dataType)

    • brief: Sets the type of the data.

    • param

      • dataSize: The type of the data.

  8. uint32_t getDataType()

    • brief: Gets the type of the data.

    • return uint32_t: The type of the data.

  9. std::string toString()

    • brief: Converts the object to a string representation. This method provides a string representation of the `NNRawData` object.

    • return string: A string representation of the object.

Related content

NNFloatData
More like this
NNObject
More like this
NNData
More like this
NNFile
More like this
NNImage
More like this
NNSequential
NNSequential
More like this