00001 #ifndef _BULK_DATA_NT_CONFIGURATION_H_ 00002 #define _BULK_DATA_NT_CONFIGURATION_H_ 00003 00004 /******************************************************************************* 00005 * ALMA - Atacama Large Millimiter Array 00006 * (c) European Southern Observatory, 2011 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 * 00022 * "@(#) $Id: bulkDataNTConfiguration.h,v 1.14 2011/09/28 16:42:18 bjeram Exp $" 00023 * 00024 * who when what 00025 * -------- --------- ---------------------------------------------- 00026 * rtobar 011-08-01 created 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 00040 // ... if needed 00041 class DDSConfiguration 00042 { 00043 friend class BulkDataNTDDS; 00044 friend class BulkDataNTDDSSubscriber; 00045 friend class BulkDataNTDDSPublisher; 00046 friend class BulkDataConfigurationParser; 00047 public: 00048 DDSConfiguration(); 00049 00053 static const char* const DEFAULT_LIBRARY; 00054 00058 static const char* const DEFAULT_SENDER_STREAM_PROFILE; 00059 00063 static const char* const DEFAULT_SENDER_FLOW_PROFILE; 00064 00068 static const char* const DEFAULT_RECEIVER_STREAM_PROFILE; 00069 00073 static const char* const DEFAULT_RECEIVER_FLOW_PROFILE; 00074 00075 protected: 00076 std::string libraryQos; 00077 std::string profileQos; 00078 // QoS that follow can be hardcoded, but is more flexible in this way. 00079 bool ignoreUserProfileQoS; //when true USER_QOS_PROFILES.xml in current folder would not be loaded 00080 bool ignoreEnvironmentProfileQoS; //when true NDDS_QOS_PROFILES will be ignored 00081 }; 00082 00083 00085 class StreamConfiguration : public DDSConfiguration 00086 { 00087 friend class BulkDataNTStream; 00088 friend class BulkDataConfigurationParser; 00089 public: 00090 StreamConfiguration(); 00091 00092 static const char* const DEFAULT_QoS_FILE; 00093 00094 protected: 00095 void fillUrlProfileQoS(const char* envVar, const char *dilim=""); 00096 00097 std::string urlProfileQoS; // here we specify where it should be looked for default values = DEFAULT_QoS_FILE 00098 std::string stringProfileQoS; // here we can specify RTI DDS QoS as a string 00099 // ... it is read just when we create stream, but it contains profiles for all flows 00100 unsigned int DDSLogVerbosity; // log level for RTI DDS, the type should be NDDS_Config_LogVerbosity 00101 }; 00102 00103 00104 /****************************************/ 00105 /* Sender-side configuration structures */ 00106 /****************************************/ 00107 00109 class SenderFlowConfiguration : public DDSConfiguration 00110 { 00111 public: 00112 SenderFlowConfiguration(); 00113 }; 00114 00117 class SenderStreamConfiguration : public StreamConfiguration 00118 { 00119 public: 00120 SenderStreamConfiguration(); 00121 00122 // std::map<const char *, BulkDataNTSenderFlowConfiguration> flows; 00123 }; 00124 00125 00126 /******************************************/ 00127 /* Receiver-side configuration structures */ 00128 /******************************************/ 00129 00133 enum ReceiverType { 00134 NORMAL = 0x1, 00135 IMPORTANT = 0x2, 00136 CRITICAL = 0x4 00137 }; 00138 00140 class ReceiverFlowConfiguration : public DDSConfiguration 00141 { 00142 public: 00143 ReceiverFlowConfiguration(); 00144 }; 00145 00148 class ReceiverStreamConfiguration : public StreamConfiguration 00149 { 00150 public: 00151 00152 ReceiverStreamConfiguration(); 00153 00154 protected: 00155 ReceiverType type; 00156 // std::map<const char *, BulkDataNTReceiverFlowConfiguration> flows; 00157 }; 00158 00159 }; 00160 00161 #endif