Equalizer
1.2.1
|
00001 00002 /* Copyright (c) 2005-2011, 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 CO_GLOBAL_H 00019 #define CO_GLOBAL_H 00020 00021 #include <co/api.h> 00022 #include <co/base/types.h> 00023 #include <string> 00024 00025 namespace co 00026 { 00027 // global defines 00028 00032 class Global 00033 { 00034 public: 00040 CO_API static void setProgramName( const std::string& programName ); 00041 00043 CO_API static const std::string& getProgramName(); 00044 00050 CO_API static void setWorkDir( const std::string& workDir ); 00051 00053 CO_API static const std::string& getWorkDir(); 00054 00060 CO_API static void setDefaultPort( const uint16_t port ); 00061 00063 CO_API static uint16_t getDefaultPort(); 00064 00074 CO_API static void setObjectBufferSize( const uint32_t size ); 00075 00077 CO_API static uint32_t getObjectBufferSize(); 00078 00091 CO_API static bool fromString( const std::string& data ); 00092 00094 CO_API static void toString( std::string& data ); 00095 00098 // Note: also update string array initialization in global.cpp 00100 enum IAttribute 00101 { 00102 IATTR_INSTANCE_CACHE_SIZE, 00103 00104 IATTR_NODE_SEND_QUEUE_SIZE, 00105 IATTR_NODE_SEND_QUEUE_AGE, 00106 IATTR_RSP_ACK_TIMEOUT, 00107 IATTR_RSP_ERROR_DOWNSCALE, 00108 IATTR_RSP_ERROR_UPSCALE, 00109 IATTR_RSP_ERROR_MAXSCALE, 00110 IATTR_RSP_MIN_SENDRATE_SHIFT, 00111 IATTR_RSP_NUM_BUFFERS, 00112 IATTR_RSP_ACK_FREQUENCY, 00113 IATTR_UDP_MTU, 00114 IATTR_UDP_BUFFER_SIZE, 00115 IATTR_QUEUE_MIN_SIZE, 00116 IATTR_QUEUE_REFILL, 00117 IATTR_RDMA_RING_BUFFER_SIZE_MB, 00118 IATTR_RDMA_RESOLVE_TIMEOUT_MS, 00119 IATTR_ALL 00120 }; 00121 00123 CO_API static void setIAttribute( const IAttribute attr, 00124 const int32_t value ); 00125 00127 CO_API static int32_t getIAttribute( const IAttribute attr ); 00128 00130 CO_API static uint32_t getTimeout(); 00132 00134 CO_API static uint32_t getKeepaliveTimeout(); 00136 }; 00137 } 00138 00139 #endif // CO_GLOBAL_H