zing_table.h

Go to the documentation of this file.
00001 #ifndef ZING_TABLE_CLASS
00002 #define ZING_TABLE_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : zing_table                                                        *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2001-$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 "living_item.h"
00019 
00020 #include <basis/object_base.h>
00021 
00022 // forward.
00023 class byte_array;
00024 class istring;
00025 class int_set;
00026 class memory_limiter;
00027 class mutex;
00028 class zing_queue_amorph;
00029 
00031 
00036 class EVENT_FLOW_CLASS_STYLE zing_table : public virtual object_base
00037 {
00038 public:
00039   zing_table(int overall_memory, int per_user_memory);
00041 
00045   ~zing_table();
00046 
00047   IMPLEMENT_CLASS_NAME("zing_table");
00048 
00049   bool add_client(int new_client_id);
00051 
00052   bool remove_client(int outgoing_client_id);
00054 
00055   void zing_event(int client_id, int event, const byte_array &data);
00056   void zing_event(int client_id, int event, const byte_array &data,
00057           const int_set &targets);
00059 
00062   int show_events(int client_id, const istring &name, istring &output,
00063           int indentation);
00065 
00068   bool pop_event(int client_id, int &event, byte_array &event_data,
00069           int_set &targets);
00071 
00074   bool peek_event(int client_id, int &event, int &data_length,
00075           int_set &targets) const;
00077 
00080   bool pop_events(int client_id, int &count, byte_array &event_data,
00081           int max_size);
00083 
00090   bool peek_events(int client_id, int &count, int &data_length) const;
00092 
00095   void flush_events(int client_id);
00097 
00098 private:
00099   zing_queue_amorph *_clients;  
00100   mutex *_lock;  
00101   memory_limiter *_limiter;  
00102 
00103   // forbidden.
00104   zing_table(const zing_table &);
00105   zing_table &operator =(const zing_table &);
00106 };
00107 
00108 #endif
00109 

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