Equalizer  1.10.1
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 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 co::CommandQueue* getMainThreadQueue() override;
107 
109  void interruptMainThread();
110 
114  EQ_API void setName( const std::string& name );
115 
117  EQ_API const std::string& getName() const;
118 
123  EQ_API void addActiveLayout( const std::string& activeLayout );
124 
126  const Strings& getActiveLayouts() const;
127 
129  const std::string& getGPUFilter() const;
130 
132  float getModelUnit() const;
134 
135 protected:
137  EQ_API virtual ~Client();
138 
149  EQ_API virtual void clientLoop();
150 
152  EQ_API virtual void exitClient();
153 
154 private:
155  detail::Client* const _impl;
156 
158  EQ_API co::NodePtr createNode( const uint32_t type ) override;
159 
161  EQ_API void notifyDisconnect( co::NodePtr node ) override;
162 
163  bool _setupClient( const std::string& clientArgs );
164 
166  bool _cmdExit( co::ICommand& command );
167  bool _cmdInterrupt( co::ICommand& command );
168 };
169 }
170 
171 #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:210
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.
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