lib/client/client.h

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 
00038     class Client : public net::Node
00039     {
00040     public:
00042         EQ_EXPORT Client();
00043 
00045         EQ_EXPORT virtual ~Client();
00046 
00055         EQ_EXPORT bool connectServer( ServerPtr server );
00056 
00064         EQ_EXPORT bool disconnectServer( ServerPtr server );
00065 
00067         EQ_EXPORT bool hasCommands();
00068 
00074         EQ_EXPORT void processCommand();
00075 
00077         CommandQueue* getNodeThreadQueue() { return _nodeThreadQueue; }
00078 
00079     protected:
00090         EQ_EXPORT virtual bool clientLoop();
00091 
00096         EQ_EXPORT virtual bool exitClient();
00097 
00099         EQ_EXPORT virtual bool listen();
00100 
00102         EQ_EXPORT virtual bool close();
00103 
00104     private:
00106         CommandQueue* _nodeThreadQueue;
00107         
00108         bool _running;
00109 
00110         union // placeholder for binary-compatible changes
00111         {
00112             char dummy[64];
00113         };
00114 
00116         EQ_EXPORT virtual net::NodePtr createNode( const uint32_t type );
00117         
00119         EQ_EXPORT virtual bool dispatchCommand( net::Command& command );
00120 
00122         EQ_EXPORT virtual net::CommandResult invokeCommand( net::Command& );
00123 
00125         net::CommandResult _cmdExit( net::Command& command );
00126     };
00127 }
00128 
00129 #endif // EQ_CLIENT_H
Generated on Sat Feb 6 12:59:46 2010 for Equalizer 0.9.1 by  doxygen 1.6.1