OpenRTM-aist  2.1.0
BufferStatus.h
Go to the documentation of this file.
1 // -*- C++ -*-
20 #ifndef RTC_BUFFERSTATUS_H
21 #define RTC_BUFFERSTATUS_H
22 
23 #include <cstdint>
24 
25 namespace RTC
26 {
56  enum class BufferStatus : uint8_t
57  {
58  OK = 0,
59  BUFFER_ERROR, // MSVC has the macro named "ERROR".
60  FULL,
61  EMPTY,
63  TIMEOUT,
65  };
66 
90  inline char const* toString(BufferStatus status)
91  {
92  static char const* const buffer_status[] = {
93  "BUFFER_OK",
94  "BUFFER_ERROR",
95  "BUFFER_FULL",
96  "BUFFER_EMPTY",
97  "NOT_SUPPORTED",
98  "TIMEOUT",
99  "PRECONDITION_NOT_MET"
100  };
101  return buffer_status[static_cast<std::size_t>(status)];
102  }
103 
104 } // namespace RTC
105 
106 #endif // RTC_BUFFERSTATUS_H
RT-Component.
char const * toString(BufferStatus status)
Convert BufferStatus into the string.
Definition: BufferStatus.h:90
BufferStatus
DataPortStatus return codes.
Definition: BufferStatus.h:57