Program Listing for File ParseGeneralSystemState.h

Return to documentation for file (/tmp/ws/src/sick_safetyscanners_base/include/sick_safetyscanners_base/data_processing/ParseGeneralSystemState.h)

// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-

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

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

//----------------------------------------------------------------------
//----------------------------------------------------------------------

#ifndef SICK_SAFETYSCANNERS_BASE_DATA_PROCESSING_PARSEGENERALSYSTEMSTATE_H
#define SICK_SAFETYSCANNERS_BASE_DATA_PROCESSING_PARSEGENERALSYSTEMSTATE_H

#include "sick_safetyscanners_base/datastructure/Data.h"
#include "sick_safetyscanners_base/datastructure/DerivedValues.h"
#include "sick_safetyscanners_base/datastructure/PacketBuffer.h"

#include "sick_safetyscanners_base/data_processing/ReadWriteHelper.hpp"

#include <vector>

namespace sick {
namespace data_processing {

class ParseGeneralSystemState
{
public:
  ParseGeneralSystemState();

  datastructure::GeneralSystemState
  parseUDPSequence(const sick::datastructure::PacketBuffer& buffer,
                   datastructure::Data& data) const;

private:
  void setDataInGeneralSystemState(std::vector<uint8_t>::const_iterator data_ptr,
                                   datastructure::GeneralSystemState& general_system_state) const;
  void
  setStatusBitsInGeneralSystemState(std::vector<uint8_t>::const_iterator data_ptr,
                                    datastructure::GeneralSystemState& general_system_state) const;
  void setSafeCutOffPathInGeneralSystemState(
    std::vector<uint8_t>::const_iterator data_ptr,
    datastructure::GeneralSystemState& general_system_state) const;
  void setNonSafeCutOffPathInGeneralSystemState(
    std::vector<uint8_t>::const_iterator data_ptr,
    datastructure::GeneralSystemState& general_system_state) const;
  void setResetRequiredCutOffPathInGeneralSystemState(
    std::vector<uint8_t>::const_iterator data_ptr,
    datastructure::GeneralSystemState& general_system_state) const;
  void setCurrentMonitoringCasesInGeneralSystemState(
    std::vector<uint8_t>::const_iterator data_ptr,
    datastructure::GeneralSystemState& general_system_state) const;
  void setErrorsInGeneralSystemState(std::vector<uint8_t>::const_iterator data_ptr,
                                     datastructure::GeneralSystemState& general_system_state) const;
  bool checkIfPreconditionsAreMet(const datastructure::Data& data) const;
  bool checkIfGeneralSystemStateIsPublished(const datastructure::Data& data) const;
  bool checkIfDataContainsNeededParsedBlocks(const datastructure::Data& data) const;
};

} // namespace data_processing
} // namespace sick

#endif // SICK_SAFETYSCANNERS_BASE_DATA_PROCESSING_PARSEGENERALSYSTEMSTATE_H