Equalizer  1.11.0
Parallel Rendering Framework
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 bool initLocal( const int argc, char** argv ) override;
95 
97  EQ_API bool exitLocal() override;
98 
103  EQ_API bool hasCommands();
104 
106  EQ_API bool isRunning() const;
107 
109  EQ_API co::CommandQueue* getMainThreadQueue() override;
110 
112  void interruptMainThread();
113 
117  EQ_API void setName( const std::string& name );
118 
120  EQ_API const std::string& getName() const;
121 
126  EQ_API void addActiveLayout( const std::string& activeLayout );
127 
129  const Strings& getActiveLayouts() const;
130 
132  const std::string& getGPUFilter() const;
133 
135  float getModelUnit() const;
137 
138 protected:
140  EQ_API virtual ~Client();
141 
153  EQ_API virtual void clientLoop();
154 
156  EQ_API virtual void exitClient();
157 
158 private:
159  detail::Client* const _impl;
160 
162  EQ_API co::NodePtr createNode( const uint32_t type ) override;
163 
165  EQ_API void notifyDisconnect( co::NodePtr node ) override;
166 
167  bool _setupClient( const std::string& clientArgs );
168 
170  bool _cmdExit( co::ICommand& command );
171  bool _cmdInterrupt( co::ICommand& command );
172 };
173 }
174 
175 #endif // EQ_CLIENT_H
EQ_API void setName(const std::string &name)
Set the name of the configuration.
EQ_API bool exitLocal() override
De-initialize a local, listening node.
EQ_API Client()
Construct a new client.
EQ_API const std::string & getName() const
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: eq/types.h:213
virtual EQ_API ~Client()
Destruct the client.
EQ_API bool disconnectServer(ServerPtr server)
Disconnect and close the connection to an Equalizer server.
EQ_API bool isRunning() const
virtual EQ_API void exitClient()
Exit the process cleanly on render clients.
The Equalizer client library.
Definition: eq/agl/types.h:23
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.
EQ_API bool initLocal(const int argc, char **argv) override
Initialize a local, listening node.
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.
EQ_API co::CommandQueue * getMainThreadQueue() override