Go to the documentation of this file.00001 #ifndef _BULK_DATA_NT_CONFIGURATION_H_
00002 #define _BULK_DATA_NT_CONFIGURATION_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __cplusplus
00030 #error This is a C++ include file and cannot be used from plain C
00031 #endif
00032
00033 #include <map>
00034 #include <string>
00035
00036 namespace AcsBulkdata
00037 {
00038
00044 bool isBulkDataNTEnabled();
00045
00047
00048 class DDSConfiguration
00049 {
00050 friend class BulkDataNTDDS;
00051 friend class BulkDataNTStream;
00052 friend class BulkDataNTDDSSubscriber;
00053 friend class BulkDataNTDDSPublisher;
00054 friend class BulkDataConfigurationParser;
00055 public:
00056 DDSConfiguration();
00057
00062 std::string getQosLibrary() const { return libraryQos; }
00063
00070 void setQosLibrary(std::string libraryQos) { this->libraryQos = libraryQos; }
00071
00076 std::string getQosProfile() const { return profileQos; }
00077
00084 void setQosProfile(std::string profileQos) { this->profileQos = profileQos; }
00085
00089 static const char* const DEFAULT_LIBRARY;
00093 static const char* const DEFAULT_SENDER_STREAM_PROFILE;
00097 static const char* const DEFAULT_SENDER_FLOW_PROFILE;
00101 static const char* const DEFAULT_RECEIVER_STREAM_PROFILE;
00105 static const char* const DEFAULT_RECEIVER_FLOW_PROFILE;
00109 static const char* const DEFAULT_API_CREATE_PROFILE;
00113 static short debugLevel;
00114
00115 std::string getStringProfileQoS() {
00116 return stringProfileQoS;
00117 }
00118
00119 protected:
00123 static void setDebugLevelFromEnvVar();
00127 static void setDDSLogVerbosity();
00128 std::string libraryQos;
00130 std::string profileQos;
00132
00137 void setStringProfileQoS(char* cfg, const char* defaultProfile);
00144 void setStringProfileQoS(char* profileName, char* cfg,
00145 const char* defaultProfile);
00146 std::string stringProfileQoS;
00148
00149 static bool ignoreUserProfileQoS;
00150 static bool ignoreEnvironmentProfileQoS;
00151 static unsigned int DDSLogVerbosity;
00152 static const char* const DEFAULT_QoS_FILE;
00153 static std::string urlProfileQoS;
00154
00156 void fillUrlProfileQoS(const char*suffix=NULL);
00158 bool findProfileQoS(const char* path, const char*suffix=NULL);
00159 };
00160
00161
00163 class StreamConfiguration : public DDSConfiguration
00164 {
00165 friend class BulkDataNTStream;
00166 friend class BulkDataConfigurationParser;
00167 public:
00168 StreamConfiguration();
00169
00170 bool isParticipantPerStream() const { return participantPerStream; }
00171 void setParticipantPerStream(bool participantPerStream) { this->participantPerStream = participantPerStream; }
00172
00173 static bool DEFAULT_PARTICIPANT_PER_STREAM;
00174 protected:
00175 bool participantPerStream;
00176 };
00177
00178
00179
00180
00181
00182
00184 class SenderFlowConfiguration : public DDSConfiguration
00185 {
00186 public:
00187 SenderFlowConfiguration();
00188
00193 void setDDSSenderFlowQoS(char *cfg);
00194
00200 void setDDSSenderFlowQoS(char *profileName, char* cfg);
00201
00202
00203 double getACKsTimeout() const;
00204 double getSendFrameTimeout() const;
00205 void setACKsTimeout(double acKsTimeout);
00206 void setSendFrameTimeout(double frameTimeout);
00207 double getThrottling() const;
00208 void setThrottling(double throttling);
00209
00210 static double DEFAULT_SENDFRAME_TIMEOUT;
00211 static double DEFAULT_ACKs_TIMEOUT;
00212
00213 static double DEFAULT_THROTTLING;
00214 protected:
00215 double sendFrameTimeout;
00216 double ACKsTimeout;
00217 double throttling;
00218 };
00219
00222 class SenderStreamConfiguration : public StreamConfiguration
00223 {
00224 public:
00225 SenderStreamConfiguration();
00226
00231 void setDDSSenderStreamQoS(char *cfg);
00232
00238 void setDDSSenderStreamQoS(char *profileName, char* cfg);
00239
00240
00241
00242 };
00243
00244
00245
00246
00247
00248
00252 enum ReceiverType {
00253 NORMAL = 0x1,
00254 IMPORTANT = 0x2,
00255 CRITICAL = 0x4
00256 };
00257
00259 class ReceiverFlowConfiguration : public DDSConfiguration
00260 {
00261 public:
00262 ReceiverFlowConfiguration();
00263
00268 void setDDSReceiverFlowQoS(char *cfg);
00269
00275 void setDDSReceiverFlowQoS(char *profileName, char* cfg);
00276
00277 double getCbReceiveProcessTimeout() const;
00278 void setCbReceiveProcessTimeout(double cbReceiveProcessTimeout);
00279
00280 double getCbReceiveAvgProcessTimeout() const;
00281 void setCbReceiveAvgProcessTimeout(double cbReceiveAvgProcessTimeout);
00282
00283 bool isEnableMulticast() const;
00284 void setEnableMulticast(bool enableMulticast);
00285
00286 std::string getMulticastAddress() const;
00287 void setMulticastAddress(std::string multicastAddress);
00288
00289 unsigned short getUnicastPort() const;
00290 void setUnicastPort(unsigned short);
00291
00293 static const char* const DEFAULT_MULTICAST_ADDRESS;
00294
00296 static double DEFAULT_CBRECEIVE_PROCESS_TIMEOUT;
00297
00299 static double DEFAULT_CBRECEIVE_AVG_PROCESS_TIMEOUT;
00300
00301 static bool DEFAULT_ENABLE_MULTICAST;
00302
00303 static unsigned short DEFAULT_UNICAST_PORT;
00304
00305 protected:
00306 double cbReceiveProcessTimeout;
00307 double cbReceiveAvgProcessTimeout;
00308 bool enableMulticast;
00309 std::string multicastAddress;
00310 unsigned short unicastPort;
00311 };
00312
00315 class ReceiverStreamConfiguration : public StreamConfiguration
00316 {
00317 public:
00318
00319 ReceiverStreamConfiguration();
00320
00325 void setDDSReceiverStreamQoS(char *cfg);
00326
00332 void setDDSReceiverStreamQoS(char *profileName, char* cfg);
00333
00334 bool isUseIncrementUnicastPort() const { return useIncrementUnicastPort; }
00335 void setUseIncrementUnicastPort(bool usePort) { this->useIncrementUnicastPort = usePort;}
00336
00337 unsigned short getBaseUnicastPort() const { return baseUnicastPort; }
00338 void setBaseUnicastPort(unsigned short port) { this->baseUnicastPort = port; }
00339
00340 static bool DEFAULT_USE_INCREMENT_UNICAST_PORT;
00341
00342 static unsigned short DEFAULT_BASE_UNICAST_PORT;
00343 protected:
00344 ReceiverType type;
00347 unsigned short baseUnicastPort;
00348 bool useIncrementUnicastPort;
00349 };
00350
00351 };
00352
00353 #endif