Collage  1.7.0
High-performance C++ library for developing object-oriented distributed applications.
global.h
1 
2 /* Copyright (c) 2005-2016, Stefan Eilemann <eile@equalizergraphics.com>
3  *
4  * This file is part of Collage <https://github.com/Eyescale/Collage>
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 CO_GLOBAL_H
21 #define CO_GLOBAL_H
22 
23 #include <co/api.h>
24 #include <co/types.h>
25 #include <string>
26 
27 namespace co
28 {
30 class Global
31 {
32 public:
34  CO_API static void setDefaultPort(const uint16_t port);
35 
37  CO_API static uint16_t getDefaultPort();
38 
49  CO_API static void setObjectBufferSize(const uint32_t size);
50 
55  CO_API static uint32_t getObjectBufferSize();
56 
69  CO_API static bool fromString(const std::string& data);
70 
72  CO_API static std::string toString();
73 
76  // Note: also update string array initialization in global.cpp
79  {
80  IATTR_INSTANCE_CACHE_SIZE,
81 
82  IATTR_NODE_SEND_QUEUE_SIZE,
83  IATTR_NODE_SEND_QUEUE_AGE,
84  IATTR_RSP_ACK_TIMEOUT,
85  IATTR_RSP_ERROR_DOWNSCALE,
86  IATTR_RSP_ERROR_UPSCALE,
87  IATTR_RSP_ERROR_MAXSCALE,
88  IATTR_RSP_MIN_SENDRATE_SHIFT,
89  IATTR_RSP_NUM_BUFFERS,
90  IATTR_RSP_ACK_FREQUENCY,
91  IATTR_UDP_MTU,
92  IATTR_UDP_BUFFER_SIZE,
93  IATTR_TILE_QUEUE_MIN_SIZE,
94  IATTR_TILE_QUEUE_REFILL,
95  IATTR_RDMA_RING_BUFFER_SIZE_MB,
96  IATTR_RDMA_SEND_QUEUE_DEPTH,
97  IATTR_RDMA_RESOLVE_TIMEOUT_MS,
98  IATTR_ROBUSTNESS,
99  IATTR_TIMEOUT_DEFAULT,
100  IATTR_OBJECT_COMPRESSION,
101  IATTR_CMD_QUEUE_LIMIT,
102  IATTR_ALL
103  };
104 
106  CO_API static void setIAttribute(const IAttribute attr,
107  const int32_t value);
108 
110  CO_API static int32_t getIAttribute(const IAttribute attr);
111 
113  CO_API static uint32_t getTimeout();
115 
117  CO_API static uint32_t getKeepaliveTimeout();
118 
120  CO_API static size_t getCommandQueueLimit();
122 };
123 }
124 
125 #endif // CO_GLOBAL_H
Defines export visibility macros for library Collage.
IAttribute
Global integer attributes.
Definition: global.h:78
static CO_API uint16_t getDefaultPort()
Global parameter handling for the Collage library.
Definition: global.h:30
static CO_API uint32_t getObjectBufferSize()
Object-oriented network library.
Definition: barrier.h:27
static CO_API void setObjectBufferSize(const uint32_t size)
Set the minimum buffer size for Object serialization.
static CO_API void setDefaultPort(const uint16_t port)
Set the default listening port.