00001 /***************************************************************************** 00002 * Author: Valient Gough <vgough@pobox.com> 00003 * 00004 ***************************************************************************** 00005 * Copyright (c) 2001, Valient Gough 00006 * 00007 * This library is free software; you can distribute it and/or modify it under 00008 * the terms of the GNU Lesser General Public License (LGPL), as published by 00009 * the Free Software Foundation; either version 2.1 of the License, or (at your 00010 * option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, but WITHOUT 00013 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 * FITNESS FOR A PARTICULAR PURPOSE. See the LGPL in the file COPYING for more 00015 * details. 00016 * 00017 */ 00018 00019 #ifndef _RemoteMapServer_incl 00020 #define _RemoteMapServer_incl 00021 00022 00023 #include <rel-base/VMap.h> 00024 #include <rel-server/ServerConnector.h> 00025 00026 namespace rel 00027 { 00028 00029 class RemoteMapServer 00030 { 00031 public: 00032 // Act as proxy for remote map. We own the connector passed to us. 00033 RemoteMapServer(const SmartPtr<ServerConnector> &connector); 00034 ~RemoteMapServer(); 00035 00036 // enter the main event loop and wait until the server is ready to 00037 // exit. Returns a value which can be used as the return value for the 00038 // program (0 means exited normally - other numbers indicate some sort 00039 // of error). 00040 int exec(); 00041 00042 // request the the server shutdown - it will return from the exec() 00043 // loop when it has finished the current processing. 00044 void shutdown(); 00045 00046 private: 00047 SmartPtr<ServerConnector> connector; 00048 }; 00049 00050 } // namespace rel 00051 00052 #endif 00053