Program Listing for File CoLaCommand.h

Return to documentation for file (include/sick_safevisionary_base/CoLaCommand.h)

// -- BEGIN LICENSE BLOCK ----------------------------------------------
// -- END LICENSE BLOCK ------------------------------------------------

#pragma once

#include "CoLaCommandType.h"
#include "CoLaError.h"
#include <cstdint>
#include <string>
#include <vector>

namespace visionary {

class CoLaCommand
{
private:
  std::vector<uint8_t> m_buffer;
  CoLaCommandType::Enum m_type;
  std::string m_name;
  size_t m_parameterOffset;
  CoLaError::Enum m_error;

  CoLaCommand(CoLaCommandType::Enum commandType, CoLaError::Enum error, const char* name);

public:
  CoLaCommand(std::vector<uint8_t> buffer);
  ~CoLaCommand();

  const std::vector<uint8_t>& getBuffer();

  CoLaCommandType::Enum getType();

  const char* getName();

  size_t getParameterOffset();

  CoLaError::Enum getError();

  static CoLaCommand networkErrorCommand();
};

} // namespace visionary