zingable.cpp

Go to the documentation of this file.
00001 #ifndef ZINGABLE_IMPLEMENTATION_FILE
00002 #define ZINGABLE_IMPLEMENTATION_FILE
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : zingable                                                          *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 1996-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
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 

Generated on Fri Nov 28 04:28:55 2008 for HOOPLE Libraries by  doxygen 1.5.1