00001 #ifndef ZING_TABLE_CLASS
00002 #define ZING_TABLE_CLASS
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "living_item.h"
00019
00020 #include <basis/object_base.h>
00021
00022
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
00104 zing_table(const zing_table &);
00105 zing_table &operator =(const zing_table &);
00106 };
00107
00108 #endif
00109