mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 09:55:49 +08:00
46 lines
1010 B
C++
46 lines
1010 B
C++
#pragma once
|
|
|
|
#include <ostream>
|
|
#include <sstream>
|
|
#include <string>
|
|
|
|
namespace ray {
|
|
namespace streaming {
|
|
|
|
enum class StreamingStatus : uint32_t {
|
|
OK = 0,
|
|
ReconstructTimeOut = 1,
|
|
QueueIdNotFound = 3,
|
|
ResubscribeFailed = 4,
|
|
EmptyRingBuffer = 5,
|
|
FullChannel = 6,
|
|
NoSuchItem = 7,
|
|
InitQueueFailed = 8,
|
|
GetBundleTimeOut = 9,
|
|
SkipSendEmptyMessage = 10,
|
|
Interrupted = 11,
|
|
WaitQueueTimeOut = 12,
|
|
OutOfMemory = 13,
|
|
Invalid = 14,
|
|
UnknownError = 15,
|
|
TailStatus = 999,
|
|
MIN = OK,
|
|
MAX = TailStatus
|
|
};
|
|
|
|
static inline std::ostream &operator<<(std::ostream &os, const StreamingStatus &status) {
|
|
os << static_cast<std::underlying_type<StreamingStatus>::type>(status);
|
|
return os;
|
|
}
|
|
|
|
#define RETURN_IF_NOT_OK(STATUS_EXP) \
|
|
{ \
|
|
StreamingStatus state = STATUS_EXP; \
|
|
if (StreamingStatus::OK != state) { \
|
|
return state; \
|
|
} \
|
|
}
|
|
|
|
} // namespace streaming
|
|
} // namespace ray
|