Equalizer  1.12.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 
92  EQ_API bool initLocal( const int argc, char** argv ) override;
93 
95  EQ_API bool exitLocal() override;
96 
101  EQ_API bool hasCommands();
102 
104  EQ_API bool isRunning() const;
105 
107  EQ_API co::CommandQueue* getMainThreadQueue() override;
108 
110  void interruptMainThread();
111 
115  EQ_API void setName( const std::string& name );
116 
118  EQ_API const std::string& getName() const;
119 
124  EQ_API void addActiveLayout( const std::string& activeLayout );
125 
127  const Strings& getActiveLayouts() const;
128 
130  const std::string& getGPUFilter() const;
131 
133  float getModelUnit() const;
135 
136 protected:
138  EQ_API virtual ~Client();
139 
151  EQ_API virtual void clientLoop();
152 
154  EQ_API virtual void exitClient();
155 
156 private:
157  detail::Client* const _impl;
158 
160  EQ_API co::NodePtr createNode( const uint32_t type ) override;
161 
163  EQ_API void notifyDisconnect( co::NodePtr node ) override;
164 
165  bool _setupClient( const std::string& clientArgs );
166 
168  bool _cmdExit( co::ICommand& command );
169  bool _cmdInterrupt( co::ICommand& command );
170 };
171 }
172 
173 #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