Program Listing for File CoLaParameterWriter.h
↰ Return to documentation for file (include/sick_safevisionary_base/CoLaParameterWriter.h
)
// -- BEGIN LICENSE BLOCK ----------------------------------------------
// -- END LICENSE BLOCK ------------------------------------------------
#pragma once
#include <cstdint>
#include <vector>
#include "CoLaCommand.h"
#include "CoLaCommandType.h"
namespace visionary {
class CoLaParameterWriter
{
private:
CoLaCommandType::Enum m_type;
const char* m_name;
std::vector<uint8_t> m_buffer;
public:
CoLaParameterWriter(CoLaCommandType::Enum type, const char* name);
~CoLaParameterWriter();
CoLaParameterWriter& parameterSInt(const int8_t sInt);
CoLaParameterWriter& parameterUSInt(const uint8_t uSInt);
CoLaParameterWriter& parameterInt(const int16_t integer);
CoLaParameterWriter& parameterUInt(const uint16_t uInt);
CoLaParameterWriter& parameterDInt(const int32_t dInt);
CoLaParameterWriter& parameterUDInt(const uint32_t uDInt);
CoLaParameterWriter& parameterReal(const float real);
CoLaParameterWriter& parameterLReal(const double lReal);
CoLaParameterWriter& parameterBool(const bool boolean);
CoLaParameterWriter& parameterPasswordMD5(const std::string& str);
CoLaParameterWriter& parameterFlexString(const std::string& str);
CoLaParameterWriter& operator<<(const char* str);
CoLaParameterWriter& operator<<(const int8_t sInt);
CoLaParameterWriter& operator<<(const uint8_t uSInt);
CoLaParameterWriter& operator<<(const int16_t integer);
CoLaParameterWriter& operator<<(const uint16_t uInt);
CoLaParameterWriter& operator<<(const int32_t dInt);
CoLaParameterWriter& operator<<(const uint32_t uDInt);
CoLaParameterWriter& operator<<(const float real);
CoLaParameterWriter& operator<<(const double lReal);
CoLaParameterWriter& operator<<(const bool boolean);
const CoLaCommand build();
private:
void writeHeader(CoLaCommandType::Enum type, const char* name);
// static uint8_t calculateChecksum(const std::vector<uint8_t>& buffer);
};
} // namespace visionary