Line data Source code
1 :
2 : /* Copyright (c) 2005-2013, Stefan Eilemann <eile@equalizergraphics.com>
3 : * 2010, Cedric Stalder <cedric.stalder@gmail.com>
4 : * 2012, Daniel Nachbaur <danielnachbaur@gmail.com>
5 : *
6 : * This library is free software; you can redistribute it and/or modify it under
7 : * the terms of the GNU Lesser General Public License version 2.1 as published
8 : * by the Free Software Foundation.
9 : *
10 : * This library is distributed in the hope that it will be useful, but WITHOUT
11 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 : * details.
14 : *
15 : * You should have received a copy of the GNU Lesser General Public License
16 : * along with this library; if not, write to the Free Software Foundation, Inc.,
17 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 : */
19 :
20 : #ifndef EQ_GLOBAL_H
21 : #define EQ_GLOBAL_H
22 :
23 : #include <eq/client/api.h>
24 : #include <eq/client/init.h> // friend
25 : #include <eq/client/types.h>
26 :
27 : #include <eq/fabric/global.h> // base class
28 : #include <eq/fabric/iAttribute.h> // enum definition
29 :
30 : namespace eq
31 : {
32 : /** Global parameter handling for the Equalizer client library. */
33 : class Global : public fabric::Global
34 : {
35 : public:
36 : /** Set the name of the program. @version 1.5.2 */
37 : EQ_API static void setProgramName( const std::string& programName );
38 :
39 : /** @return the program name. @version 1.5.2 */
40 : EQ_API static const std::string& getProgramName();
41 :
42 : /** Set the working directory of the program. @version 1.5.2 */
43 : EQ_API static void setWorkDir( const std::string& workDir );
44 :
45 : /** @return the working directory of the program. @version 1.5.2 */
46 : EQ_API static const std::string& getWorkDir();
47 :
48 : /** @return the node factory. @version 1.0 */
49 138 : static NodeFactory* getNodeFactory() { return _nodeFactory; }
50 :
51 : /**
52 : * Set the config file for the app-local server.
53 : *
54 : * When started without specifying an explicit server connection,
55 : * Equalizer will create an server instance in an application thread
56 : * using this config file.
57 : *
58 : * @param configFile the default configFile.
59 : * @version 1.0
60 : */
61 : EQ_API static void setConfigFile( const std::string& configFile );
62 :
63 : /** @return the config file for the app-local server. @version 1.0 */
64 : EQ_API static const std::string& getConfigFile();
65 :
66 : /**
67 : * Global lock for all non-thread-safe Carbon API calls.
68 : * Note: this is a nop on non-AGL builds. Do not use unless you know the
69 : * side effects, i.e., ask on the eq-dev mailing list.
70 : * @version 1.0
71 : */
72 : static void enterCarbon();
73 :
74 : /** Global unlock for non-thread-safe Carbon API calls. @version 1.0 */
75 : static void leaveCarbon();
76 :
77 : private:
78 : EQ_API friend bool _init( const int argc, char** argv,
79 : NodeFactory* nodeFactory );
80 : EQ_API friend bool exit();
81 :
82 : static NodeFactory* _nodeFactory;
83 : static std::string _configFile;
84 : };
85 : }
86 :
87 : #endif // EQ_GLOBAL_H
|