summaryrefslogtreecommitdiffstats
path: root/src/mon
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2012-02-07 00:50:50 +0100
committerSage Weil <sage@newdream.net>2012-02-08 22:12:18 +0100
commit8cf81ccf9208db8b87e7323c13e06dbe1ea4d420 (patch)
tree34b1e23241eb3aec66c8a4105660202b3ef495d6 /src/mon
parentmon: uninline Monmap encode/decode (diff)
downloadceph-8cf81ccf9208db8b87e7323c13e06dbe1ea4d420.tar.xz
ceph-8cf81ccf9208db8b87e7323c13e06dbe1ea4d420.zip
ceph-dencoder: MonMap
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'src/mon')
-rw-r--r--src/mon/MonMap.cc10
-rw-r--r--src/mon/MonMap.h10
2 files changed, 13 insertions, 7 deletions
diff --git a/src/mon/MonMap.cc b/src/mon/MonMap.cc
index 5e62c0a133e..4e90f8c69df 100644
--- a/src/mon/MonMap.cc
+++ b/src/mon/MonMap.cc
@@ -57,6 +57,16 @@ void MonMap::decode(bufferlist::iterator &p)
calc_ranks();
}
+void MonMap::generate_test_instances(list<MonMap*>& o)
+{
+ o.push_back(new MonMap);
+ o.push_back(new MonMap);
+ o.back()->epoch = 1;
+ o.back()->last_changed = utime_t(123, 456);
+ o.back()->created = utime_t(789, 101112);
+ o.back()->add("one", entity_addr_t());
+}
+
// read from/write to a file
int MonMap::write(const char *fn)
{
diff --git a/src/mon/MonMap.h b/src/mon/MonMap.h
index 2159c5f3968..44f91ad2327 100644
--- a/src/mon/MonMap.h
+++ b/src/mon/MonMap.h
@@ -186,14 +186,10 @@ class MonMap {
void print(ostream& out) const;
void print_summary(ostream& out) const;
void dump(ceph::Formatter *f) const;
-};
-inline void encode(MonMap &m, bufferlist &bl) {
- m.encode(bl);
-}
-inline void decode(MonMap &m, bufferlist::iterator &p) {
- m.decode(p);
-}
+ static void generate_test_instances(list<MonMap*>& o);
+};
+WRITE_CLASS_ENCODER(MonMap)
inline ostream& operator<<(ostream& out, MonMap& m) {
m.print_summary(out);