00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef PEEKABOT_PBAR_WRITER_HH_INCLUDED
00012 #define PEEKABOT_PBAR_WRITER_HH_INCLUDED
00013
00014
00015 #include <ostream>
00016 #include <boost/date_time/posix_time/posix_time.hpp>
00017
00018
00019 namespace peekabot
00020 {
00021 class Action;
00022
00023 class PbarWriter
00024 {
00025 public:
00026 PbarWriter(std::ostream &os, bool multi_client);
00027
00028 void write(
00029 const boost::shared_ptr<Action> a,
00030 const boost::posix_time::time_duration ×tamp,
00031 int32_t client_id);
00032
00033 void flush();
00034
00035 private:
00036 void write_preamble();
00037
00038 void write_epilogue();
00039
00040 private:
00041 std::ostream &m_os;
00042
00043 uint32_t m_action_count;
00044
00045 bool m_is_multi_client;
00046 };
00047 }
00048
00049
00050 #endif // PEEKABOT_PBAR_WRITER_HH_INCLUDED