00001 #ifndef CLIENT_REGISTRY_CLASS 00002 #define CLIENT_REGISTRY_CLASS 00003 00004 /*****************************************************************************\ 00005 * * 00006 * Name : entity_registry * 00007 * Author : Chris Koeritz * 00008 * * 00009 ******************************************************************************* 00010 * Copyright (c) 2002-$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 "dll_tentacles.h" 00019 00020 // forward. 00021 class chaos; 00022 class octopus_entity; 00023 class safe_roller; 00024 class tcpip_stack; 00025 class time_stamp; 00026 00028 00033 class TENTACLES_CLASS_STYLE entity_registry 00034 { 00035 public: 00036 entity_registry(); 00037 virtual ~entity_registry(); 00038 00039 virtual bool authorized(const octopus_entity &entity) = 0; 00041 00044 virtual bool locate_entity(const octopus_entity &entity, 00045 time_stamp &last_active, byte_array &verification) = 0; 00047 00051 virtual bool add_entity(const octopus_entity &entity, 00052 const byte_array &verification) = 0; 00054 00061 virtual bool refresh_entity(const octopus_entity &entity) = 0; 00063 00066 virtual bool zap_entity(const octopus_entity &entity) = 0; 00068 00070 virtual istring text_form() = 0; 00072 00073 private: 00074 safe_roller *_sequencer; 00075 chaos *_rando; 00076 tcpip_stack *_stack; 00077 }; 00078 00080 00082 00087 class TENTACLES_CLASS_STYLE blank_entity_registry : public entity_registry 00088 { 00089 public: 00090 inline bool authorized(const octopus_entity &formal(entity)) { return true; } 00091 bool locate_entity(const octopus_entity &entity, 00092 time_stamp &last_active, byte_array &verification); 00093 inline bool add_entity(const octopus_entity &formal(entity), 00094 const byte_array &formal(verification)) { return true; } 00095 inline bool refresh_entity(const octopus_entity &formal(entity)) { return true; } 00096 inline bool zap_entity(const octopus_entity &formal(entity)) { return true; } 00097 istring text_form(); 00098 }; 00099 00100 #endif 00101
1.5.1