/usr/include/caf/io/receive_policy.hpp is in libcaf-dev 0.13.2-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #ifndef RECEIVE_POLICY_H
#define RECEIVE_POLICY_H
#include <cstddef>
#include <utility>
namespace caf {
namespace io {
enum class receive_policy_flag {
at_least,
at_most,
exactly
};
class receive_policy {
receive_policy() = delete;
public:
using config = std::pair<receive_policy_flag, size_t>;
static inline config at_least(size_t num_bytes) {
CAF_ASSERT(num_bytes > 0);
return {receive_policy_flag::at_least, num_bytes};
}
static inline config at_most(size_t num_bytes) {
CAF_ASSERT(num_bytes > 0);
return {receive_policy_flag::at_most, num_bytes};
}
static inline config exactly(size_t num_bytes) {
CAF_ASSERT(num_bytes > 0);
return {receive_policy_flag::exactly, num_bytes};
}
};
} // namespace io
} // namespace caf
#endif // RECEIVE_POLICY_H
|