MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / const_buffer

Class const_buffer

3rdparty/cppzmq/zmq.hpp:1122–1150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1120}
1121
1122class const_buffer
1123{
1124 public:
1125 constexpr const_buffer() noexcept : _data(nullptr), _size(0) {}
1126 constexpr const_buffer(const void *p, size_t n) noexcept : _data(p), _size(n)
1127 {
1128#ifdef ZMQ_EXTENDED_CONSTEXPR
1129 assert(p != nullptr || n == 0);
1130#endif
1131 }
1132 constexpr const_buffer(const mutable_buffer &mb) noexcept :
1133 _data(mb.data()), _size(mb.size())
1134 {
1135 }
1136
1137 constexpr const void *data() const noexcept { return _data; }
1138 constexpr size_t size() const noexcept { return _size; }
1139 const_buffer &operator+=(size_t n) noexcept
1140 {
1141 const auto shift = (std::min)(n, _size);
1142 _data = static_cast<const char *>(_data) + shift;
1143 _size -= shift;
1144 return *this;
1145 }
1146
1147 private:
1148 const void *_data;
1149 size_t _size;
1150};
1151
1152inline const_buffer operator+(const const_buffer &cb, size_t n) noexcept
1153{

Callers 4

operator+Function · 0.85
bufferFunction · 0.85
str_bufferFunction · 0.85
operator""_zbufFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected