server/global.h

00001 
00002 /* Copyright (c) 2006-2009, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #ifndef EQSERVER_GLOBAL_H
00019 #define EQSERVER_GLOBAL_H
00020 
00021 #include "compound.h"                // nested enum
00022 #include "config.h"                  // nested enum
00023 #include "connectionDescription.h"   // nested enum
00024 #include "pipe.h"                    // nested enum
00025 
00026 //#include <eq/client/global.h>
00027 #include <eq/client/node.h>      // nested enum
00028 #include <eq/client/channel.h>   // nested enum
00029 #include <eq/client/window.h>    // nested enum
00030 
00031 namespace eq
00032 {
00033 namespace server
00034 {
00038     class EQSERVER_EXPORT Global
00039     {
00040     public:
00041         static Global* instance();
00042 
00044         static void clear();
00045 
00049         void setConnectionSAttribute( const ConnectionDescription::SAttribute 
00050                                       attr, const std::string& value )
00051             { _connectionSAttributes[attr] = value; }
00052         const std::string& getConnectionSAttribute(
00053             const ConnectionDescription::SAttribute attr ) const
00054             { return _connectionSAttributes[attr]; }
00055 
00056         void setConnectionCAttribute( const ConnectionDescription::CAttribute 
00057                                       attr, const char value )
00058             { _connectionCAttributes[attr] = value; }
00059         char getConnectionCAttribute(
00060             const ConnectionDescription::CAttribute attr ) const
00061             { return _connectionCAttributes[attr]; }
00062 
00063         void setConnectionIAttribute( const ConnectionDescription::IAttribute 
00064                                       attr, const int32_t value)
00065             { _connectionIAttributes[attr] = value; }
00066         int32_t getConnectionIAttribute( 
00067             const ConnectionDescription::IAttribute attr ) const
00068             { return _connectionIAttributes[attr]; }
00069             
00073         void setConfigFAttribute( const Config::FAttribute attr,
00074                                     const float value )
00075             { _configFAttributes[attr] = value; }
00076         float getConfigFAttribute( const Config::FAttribute attr ) const
00077             { return _configFAttributes[attr]; }
00078 
00082         void setNodeIAttribute( const eq::Node::IAttribute attr,
00083                                     const int32_t value )
00084             { _nodeIAttributes[attr] = value; }
00085         int32_t getNodeIAttribute( const eq::Node::IAttribute attr ) const
00086             { return _nodeIAttributes[attr]; }
00087 
00091         void setPipeIAttribute( const Pipe::IAttribute attr,
00092                                   const int32_t value )
00093             { _pipeIAttributes[attr] = value; }
00094         int32_t getPipeIAttribute( const Pipe::IAttribute attr ) const
00095             { return _pipeIAttributes[attr]; }
00096 
00100         void setWindowIAttribute( const eq::Window::IAttribute attr,
00101                                   const int32_t value )
00102             { _windowIAttributes[attr] = value; }
00103         int32_t getWindowIAttribute( const eq::Window::IAttribute attr ) const
00104             { return _windowIAttributes[attr]; }
00105 
00109         void setChannelIAttribute( const eq::Channel::IAttribute attr,
00110                                   const int32_t value )
00111             { _channelIAttributes[attr] = value; }
00112         int32_t getChannelIAttribute( const eq::Channel::IAttribute attr ) const
00113             { return _channelIAttributes[attr]; }
00114 
00118         void setCompoundIAttribute( const Compound::IAttribute attr,
00119                                     const int32_t value )
00120             { _compoundIAttributes[attr] = value; }
00121         int32_t getCompoundIAttribute( const Compound::IAttribute attr ) const
00122             { return _compoundIAttributes[attr]; }
00123 
00124     private:
00125         Global();
00126         
00127         std::string _connectionSAttributes[ConnectionDescription::SATTR_ALL];
00128         char        _connectionCAttributes[ConnectionDescription::CATTR_ALL];
00129         int32_t     _connectionIAttributes[ConnectionDescription::IATTR_ALL];
00130         
00131         float       _configFAttributes[Config::FATTR_ALL];
00132 
00133         int32_t     _nodeIAttributes[eq::Node::IATTR_ALL];
00134 
00135         int32_t     _pipeIAttributes[Pipe::IATTR_ALL];
00136 
00137         int32_t     _windowIAttributes[eq::Window::IATTR_ALL];
00138 
00139         int32_t     _channelIAttributes[eq::Channel::IATTR_ALL];
00140         
00141         int32_t     _compoundIAttributes[Compound::IATTR_ALL];
00142 
00143         union // placeholder for binary-compatible changes
00144         {
00145             char dummy[64];
00146         };
00147 
00148         void _setupDefaults();
00149         void _readEnvironment();
00150 
00151         friend EQSERVER_EXPORT std::ostream& operator << ( std::ostream&,
00152                                                            const Global* );
00153     };
00154 
00155     EQSERVER_EXPORT std::ostream& operator << ( std::ostream&, const Global* );
00156 }
00157 }
00158 #endif // EQSERVER_GLOBAL_H
Generated on Mon Aug 10 18:58:39 2009 for Equalizer 0.9 by  doxygen 1.5.8