Equalizer  2.1.0
Parallel Rendering Framework
client.h
1 
2 /* Copyright (c) 2005-2017, Stefan Eilemann <eile@equalizergraphics.com>
3  * 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/fabric/client.h> // base class
25 #include <eq/types.h> // basic types
26 
27 namespace eq
28 {
29 namespace detail
30 {
31 class Client;
32 }
33 
42 class Client : public fabric::Client
43 {
44 public:
46  EQ_API Client();
47 
58  EQ_API bool connectServer(ServerPtr server);
59 
69  EQ_API bool disconnectServer(ServerPtr server);
70 
72  EQ_API static std::string getHelp();
73 
85  EQ_API bool initLocal(const int argc, char** argv) override;
86 
88  EQ_API bool exitLocal() override;
89 
94  EQ_API bool hasCommands();
95 
97  EQ_API bool isRunning() const;
98 
100  EQ_API co::CommandQueue* getMainThreadQueue() override;
101 
103  void interruptMainThread();
104 
108  EQ_API void setName(const std::string& name);
109 
111  EQ_API const std::string& getName() const;
112 
117  EQ_API void addActiveLayout(const std::string& activeLayout);
118 
120  const Strings& getActiveLayouts() const;
121 
123  const std::string& getGPUFilter() const;
124 
126  float getModelUnit() const;
128 
129 protected:
131  EQ_API virtual ~Client();
132 
144  EQ_API virtual void clientLoop();
145 
147  EQ_API virtual void exitClient();
148 
149 private:
150  detail::Client* const _impl;
151 
153  EQ_API co::NodePtr createNode(const uint32_t type) override;
154 
156  EQ_API void notifyDisconnect(co::NodePtr node) override;
157 
158  bool _setupClient(const std::string& clientArgs);
159 
161  bool _cmdExit(co::ICommand& command);
162  bool _cmdInterrupt(co::ICommand& command);
163 };
164 }
165 
166 #endif // EQ_CLIENT_H
lunchbox::RefPtr< Server > ServerPtr
A reference-counted pointer to an eq::Server.
Definition: eq/types.h:215
EQ_API std::string getHelp()
The Equalizer client library.
Definition: eq/agl/types.h:23
A client represents a network node of the application in the cluster.
Definition: fabric/client.h:36
The client represents a network node of the application in the cluster.
Definition: client.h:42