00001 #ifndef ZINGABLE_IMPLEMENTATION_FILE
00002 #define ZINGABLE_IMPLEMENTATION_FILE
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "zing_table.h"
00019 #include "zingable.h"
00020
00021 #include <data_struct/unique_id.h>
00022 #include <mechanisms/heartbeat.h>
00023
00024 using namespace nodes;
00025
00026 zingable::zingable(zing_table &zingers, const unique_int &id,
00027 const heartbeat &initial_beat)
00028 : living_item(id, initial_beat),
00029 _zingers(zingers)
00030 { _zingers.add_client(id.raw_id()); }
00031
00032 zingable::~zingable() { _zingers.remove_client(id().raw_id()); }
00033
00034 int zingable::show_events(istring &output, int indentation)
00035 {
00036 return _zingers.show_events(id().raw_id(), catalogable_name(), output,
00037 indentation);
00038 }
00039
00040 istring zingable::text_form() const
00041 {
00042 istring output;
00043 int count = 0;
00044 int data_len = 0;
00045 _zingers.peek_events(id().raw_id(), count, data_len);
00046
00047 output += istring(istring::SPRINTF, "[%d] items=%-4d data=%-8d "
00048 "%s class=%s", id().raw_id(), count, data_len,
00049 liveness().text_form().s(), catalogable_name().s());
00050 return output;
00051 }
00052
00053
00054 #endif //ZINGABLE_IMPLEMENTATION_FILE
00055