Equalizer  1.9.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
client.h
1 
2 /* Copyright (c) 2005-2014, Stefan Eilemann <eile@equalizergraphics.com>
3  * 2012, Daniel Nachbaur <danielnachbaur@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef EQ_CLIENT_H
20 #define EQ_CLIENT_H
21 
22 #include <eq/api.h>
23 #include <eq/commandQueue.h> // member
24 #include <eq/types.h> // basic types
25 #include <eq/fabric/client.h> // base class
26 
27 namespace eq
28 {
29 namespace detail { class Client; }
30 
39 class Client : public fabric::Client
40 {
41 public:
43  EQ_API Client();
44 
55  EQ_API bool connectServer( ServerPtr server );
56 
66  EQ_API bool disconnectServer( ServerPtr server );
67 
94  EQ_API virtual bool initLocal( const int argc, char** argv );
95 
97  EQ_API virtual bool exitLocal();
98 
103  EQ_API bool hasCommands();
104 
106  EQ_API virtual co::CommandQueue* getMainThreadQueue();
107 
112  EQ_API void addActiveLayout( const std::string& activeLayout );
113 
115  const Strings& getActiveLayouts();
116 
118  const std::string& getGPUFilter() const;
119 
121  float getModelUnit() const;
122 
124  void interruptMainThread();
125 
126 protected:
128  EQ_API virtual ~Client();
129 
140  EQ_API virtual void clientLoop();
141 
143  EQ_API virtual void exitClient();
144 
145 private:
146  detail::Client* const _impl;
147 
149  EQ_API co::NodePtr createNode( const uint32_t type ) override;
150 
152  EQ_API void notifyDisconnect( co::NodePtr node ) override;
153 
154  bool _setupClient( const std::string& clientArgs );
155 
157  bool _cmdExit( co::ICommand& command );
158  bool _cmdInterrupt( co::ICommand& command );
159 };
160 }
161 
162 #endif // EQ_CLIENT_H
virtual EQ_API co::CommandQueue * getMainThreadQueue()
Defines export visibility macros for Equalizer.
EQ_API Client()
Construct a new client.
virtual EQ_API bool exitLocal()
De-initialize a local, listening node.
EQ_API void addActiveLayout(const std::string &activeLayout)
Add an active layout programmatically, like –eq-layout does.
lunchbox::RefPtr< Server > ServerPtr
A reference-counted pointer to an eq::Server.
Definition: types.h:210
virtual EQ_API bool initLocal(const int argc, char **argv)
Initialize a local, listening node.
virtual EQ_API ~Client()
Destruct the client.
EQ_API bool disconnectServer(ServerPtr server)
Disconnect and close the connection to an Equalizer server.
virtual EQ_API void exitClient()
Exit the process cleanly on render clients.
EQ_API bool hasCommands()
A client represents a network node of the application in the cluster.
Definition: fabric/client.h:33
EQ_API bool connectServer(ServerPtr server)
Open and connect an Equalizer server to the local client.
virtual EQ_API void clientLoop()
Implements the processing loop for render clients.
The client represents a network node of the application in the cluster.
Definition: client.h:39
void interruptMainThread()
Experimental: interrupt main thread queue.