// cppcheck-suppress noExplicitConstructor
client_t(int64_t _v = -2) : v(_v) {}
- void encode(bufferlist& bl) const {
+ void encode(ceph::buffer::list& bl) const {
using ceph::encode;
encode(v, bl);
}
- void decode(bufferlist::const_iterator& bl) {
+ void decode(ceph::buffer::list::const_iterator& bl) {
using ceph::decode;
decode(v, bl);
}
static inline bool operator>=(const client_t& l, int64_t o) { return l.v >= o; }
static inline bool operator<(const client_t& l, int64_t o) { return l.v < o; }
-inline ostream& operator<<(ostream& out, const client_t& c) {
+inline std::ostream& operator<<(std::ostream& out, const client_t& c) {
return out << c.v;
}
// --
namespace {
- inline ostream& format_u(ostream& out, const uint64_t v, const uint64_t n,
+inline std::ostream& format_u(std::ostream& out, const uint64_t v, const uint64_t n,
const int index, const uint64_t mult, const char* u)
{
char buffer[32];
explicit si_u_t(uint64_t _v) : v(_v) {};
};
-inline ostream& operator<<(ostream& out, const si_u_t& b)
+inline std::ostream& operator<<(std::ostream& out, const si_u_t& b)
{
uint64_t n = b.v;
int index = 0;
explicit byte_u_t(uint64_t _v) : v(_v) {};
};
-inline ostream& operator<<(ostream& out, const byte_u_t& b)
+inline std::ostream& operator<<(std::ostream& out, const byte_u_t& b)
{
uint64_t n = b.v;
int index = 0;
return format_u(out, b.v, n, index, 1ULL << (10 * index), u[index]);
}
-inline ostream& operator<<(ostream& out, const ceph_mon_subscribe_item& i)
+inline std::ostream& operator<<(std::ostream& out, const ceph_mon_subscribe_item& i)
{
return out << i.start
<< ((i.flags & CEPH_SUBSCRIBE_ONETIME) ? "" : "+");
weightf_t(float _v) : v(_v) {}
};
-inline ostream& operator<<(ostream& out, const weightf_t& w)
+inline std::ostream& operator<<(std::ostream& out, const weightf_t& w)
{
if (w.v < -0.01F) {
return out << "-";
const static shard_id_t NO_SHARD;
- void encode(bufferlist &bl) const {
+ void encode(ceph::buffer::list &bl) const {
using ceph::encode;
encode(id, bl);
}
- void decode(bufferlist::const_iterator &bl) {
+ void decode(ceph::buffer::list::const_iterator &bl) {
using ceph::decode;
decode(id, bl);
}
WRITE_CLASS_ENCODER(shard_id_t)
WRITE_EQ_OPERATORS_1(shard_id_t, id)
WRITE_CMP_OPERATORS_1(shard_id_t, id)
-ostream &operator<<(ostream &lhs, const shard_id_t &rhs);
+std::ostream &operator<<(std::ostream &lhs, const shard_id_t &rhs);
#if defined(__sun) || defined(_AIX) || defined(__APPLE__) || defined(__FreeBSD__)
__s32 ceph_to_hostos_errno(__s32 e);
int operator<(int i) { return code < i; }
int operator<=(int i) { return code <= i; }
- void encode(bufferlist &bl) const {
+ void encode(ceph::buffer::list &bl) const {
using ceph::encode;
__s32 newcode = hostos_to_ceph_errno(code);
encode(newcode, bl);
}
- void decode(bufferlist::const_iterator &bl) {
+ void decode(ceph::buffer::list::const_iterator &bl) {
using ceph::decode;
decode(code, bl);
code = ceph_to_hostos_errno(code);
// as sha_digest_t is a part of our public API.
unsigned char v[S] = {0};
- string to_str() const {
+ std::string to_str() const {
char str[S * 2 + 1] = {0};
str[0] = '\0';
for (size_t i = 0; i < S; i++) {
return ::memcmp(v, r.v, SIZE) != 0;
}
- void encode(bufferlist &bl) const {
+ void encode(ceph::buffer::list &bl) const {
// copy to avoid reinterpret_cast, is_pod and other nasty things
using ceph::encode;
std::array<unsigned char, SIZE> tmparr;
memcpy(tmparr.data(), v, SIZE);
encode(tmparr, bl);
}
- void decode(bufferlist::const_iterator &bl) {
+ void decode(ceph::buffer::list::const_iterator &bl) {
using ceph::decode;
std::array<unsigned char, SIZE> tmparr;
decode(tmparr, bl);
}
};
-template <uint8_t S>
-inline ostream &operator<<(ostream &out, const sha_digest_t<S> &b) {
- string str = b.to_str();
+template<uint8_t S>
+inline std::ostream &operator<<(std::ostream &out, const sha_digest_t<S> &b) {
+ std::string str = b.to_str();
return out << str;
}