00001 00002 /* Copyright (c) 2005-2009, Stefan Eilemann <eile@equalizergraphics.com> 00003 * 00004 * This library is free software; you can redistribute it and/or modify it under 00005 * the terms of the GNU Lesser General Public License version 2.1 as published 00006 * by the Free Software Foundation. 00007 * 00008 * This library is distributed in the hope that it will be useful, but WITHOUT 00009 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00010 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00011 * details. 00012 * 00013 * You should have received a copy of the GNU Lesser General Public License 00014 * along with this library; if not, write to the Free Software Foundation, Inc., 00015 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00016 */ 00017 00018 #ifndef EQ_CLIENT_H 00019 #define EQ_CLIENT_H 00020 00021 #include <eq/client/types.h> // basic types 00022 #include <eq/client/windowSystem.h> // WindowSystem enum 00023 00024 #include <eq/net/command.h> // member 00025 #include <eq/net/node.h> // base class 00026 00027 namespace eq 00028 { 00029 class CommandQueue; 00030 class Server; 00031 00035 class Client : public net::Node 00036 { 00037 public: 00041 EQ_EXPORT Client(); 00042 00046 EQ_EXPORT virtual ~Client(); 00047 00054 EQ_EXPORT bool connectServer( ServerPtr server ); 00055 00063 EQ_EXPORT bool disconnectServer( ServerPtr server ); 00064 00066 EQ_EXPORT bool hasCommands(); 00067 00072 EQ_EXPORT void processCommand(); 00073 00075 EQ_EXPORT virtual bool listen(); 00077 EQ_EXPORT virtual bool stopListening(); 00078 00084 EQ_EXPORT void setWindowSystem( const WindowSystem windowSystem ); 00085 00087 CommandQueue* getNodeThreadQueue() { return _nodeThreadQueue; } 00088 00089 protected: 00091 EQ_EXPORT virtual bool clientLoop(); 00093 EQ_EXPORT virtual bool exitClient(); 00094 00095 private: 00097 CommandQueue* _nodeThreadQueue; 00098 00099 bool _running; 00100 00101 union // placeholder for binary-compatible changes 00102 { 00103 char dummy[64]; 00104 }; 00105 00107 EQ_EXPORT virtual net::NodePtr createNode( const uint32_t type ); 00108 00110 EQ_EXPORT virtual bool dispatchCommand( net::Command& command ); 00111 00113 EQ_EXPORT virtual net::CommandResult invokeCommand( net::Command& ); 00114 00116 net::CommandResult _cmdExit( net::Command& command ); 00117 }; 00118 } 00119 00120 #endif // EQ_CLIENT_H
0.9 by
1.5.8