Line data Source code
1 :
2 : /* Copyright (c) 2010-2013, Stefan Eilemann <eile@eyescale.ch>
3 : *
4 : * This library is free software; you can redistribute it and/or modify it under
5 : * the terms of the GNU Lesser General Public License version 2.1 as published
6 : * by the Free Software Foundation.
7 : *
8 : * This library is distributed in the hope that it will be useful, but WITHOUT
9 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11 : * details.
12 : *
13 : * You should have received a copy of the GNU Lesser General Public License
14 : * along with this library; if not, write to the Free Software Foundation, Inc.,
15 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 : */
17 :
18 : #ifndef EQADMIN_CLIENT_H
19 : #define EQADMIN_CLIENT_H
20 :
21 : #include <co/commandQueue.h> // member
22 : #include <eq/admin/api.h>
23 : #include <eq/admin/types.h>
24 : #include <eq/fabric/client.h> // base class
25 :
26 : namespace eq
27 : {
28 : namespace admin
29 : {
30 : class Server;
31 :
32 : /**
33 : * The client represents the admin tool as a co::Node to the cluster.
34 : *
35 : * The methods initLocal() and exitLocal() should be used to set up and exit the
36 : * listening node instance for each application process.
37 : */
38 : class Client : public fabric::Client
39 : {
40 : public:
41 : /** Construct a new client. @version 1.0 */
42 : EQADMIN_API Client();
43 :
44 : /** Destruct the client. @version 1.0 */
45 : EQADMIN_API virtual ~Client();
46 :
47 : /**
48 : * Open and connect an Equalizer server to the local client.
49 : *
50 : * The client has to be in the listening state, see initLocal().
51 : *
52 : * @param server the server.
53 : * @return true if the server was connected, false if not.
54 : * @version 1.0
55 : */
56 : EQADMIN_API bool connectServer(ServerPtr server);
57 :
58 : /**
59 : * Disconnect and close the connection to an Equalizer server.
60 : *
61 : * @param server the server.
62 : * @return true if the server was disconnected, false if not.
63 : * @version 1.0
64 : */
65 : EQADMIN_API bool disconnectServer(ServerPtr server);
66 :
67 : /** @return the command queue to the main node thread. @internal */
68 0 : virtual co::CommandQueue* getMainThreadQueue() { return &_mainThreadQueue; }
69 : private:
70 : /** The command->node command queue. */
71 : co::CommandQueue _mainThreadQueue;
72 :
73 : struct Private;
74 : Private* _private; // placeholder for binary-compatible changes
75 :
76 : /** @sa co::LocalNode::createNode */
77 : EQADMIN_API virtual co::NodePtr createNode(const uint32_t type);
78 : };
79 : }
80 : }
81 :
82 : #endif // EQADMIN_CLIENT_H
|