-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcls_refcount_ops.cc
80 lines (64 loc) · 2.02 KB
/
cls_refcount_ops.cc
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include "cls_refcount_ops.h"
#include "common/Formatter.h"
#include "common/ceph_json.h"
void cls_refcount_get_op::dump(ceph::Formatter *f) const
{
f->dump_string("tag", tag);
f->dump_int("implicit_ref", (int)implicit_ref);
}
void cls_refcount_get_op::generate_test_instances(list<cls_refcount_get_op*>& ls)
{
ls.push_back(new cls_refcount_get_op);
ls.push_back(new cls_refcount_get_op);
ls.back()->tag = "foo";
ls.back()->implicit_ref = true;
}
void cls_refcount_put_op::dump(ceph::Formatter *f) const
{
f->dump_string("tag", tag);
f->dump_int("implicit_ref", (int)implicit_ref);
}
void cls_refcount_put_op::generate_test_instances(list<cls_refcount_put_op*>& ls)
{
ls.push_back(new cls_refcount_put_op);
ls.push_back(new cls_refcount_put_op);
ls.back()->tag = "foo";
ls.back()->implicit_ref = true;
}
void cls_refcount_set_op::dump(ceph::Formatter *f) const
{
encode_json("refs", refs, f);
}
void cls_refcount_set_op::generate_test_instances(list<cls_refcount_set_op*>& ls)
{
ls.push_back(new cls_refcount_set_op);
ls.push_back(new cls_refcount_set_op);
ls.back()->refs.push_back("foo");
ls.back()->refs.push_back("bar");
}
void cls_refcount_read_op::dump(ceph::Formatter *f) const
{
f->dump_int("implicit_ref", (int)implicit_ref);
}
void cls_refcount_read_op::generate_test_instances(list<cls_refcount_read_op*>& ls)
{
ls.push_back(new cls_refcount_read_op);
ls.push_back(new cls_refcount_read_op);
ls.back()->implicit_ref = true;
}
void cls_refcount_read_ret::dump(ceph::Formatter *f) const
{
f->open_array_section("refs");
for (list<string>::const_iterator p = refs.begin(); p != refs.end(); ++p)
f->dump_string("ref", *p);
f->close_section();
}
void cls_refcount_read_ret::generate_test_instances(list<cls_refcount_read_ret*>& ls)
{
ls.push_back(new cls_refcount_read_ret);
ls.push_back(new cls_refcount_read_ret);
ls.back()->refs.push_back("foo");
ls.back()->refs.push_back("bar");
}