summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/StoreStatus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/cluster/StoreStatus.cpp')
-rw-r--r--cpp/src/qpid/cluster/StoreStatus.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/StoreStatus.cpp b/cpp/src/qpid/cluster/StoreStatus.cpp
index a7da3baa50..72e4891566 100644
--- a/cpp/src/qpid/cluster/StoreStatus.cpp
+++ b/cpp/src/qpid/cluster/StoreStatus.cpp
@@ -31,6 +31,7 @@ namespace cluster {
using framing::Uuid;
using namespace framing::cluster;
using namespace boost::filesystem;
+using std::ostream;
StoreStatus::StoreStatus(const std::string& d)
: state(STORE_STATE_NO_STORE), dataDir(d)
@@ -90,5 +91,20 @@ void StoreStatus::clean(const Uuid& shutdownId_) {
save();
}
+ostream& operator<<(ostream& o, const StoreStatus& s) {
+ switch (s.getState()) {
+ case STORE_STATE_NO_STORE: o << "no store"; break;
+ case STORE_STATE_EMPTY_STORE: o << "empty store"; break;
+ case STORE_STATE_DIRTY_STORE:
+ o << "dirty store, cluster-id=" << s.getClusterId();
+ break;
+ case STORE_STATE_CLEAN_STORE:
+ o << "clean store, cluster-id=" << s.getClusterId()
+ << " shutdown-id=" << s.getShutdownId();
+ break;
+ }
+ return o;
+}
+
}} // namespace qpid::cluster