OpenDDS  Snapshot(2023/04/28-20:55)
ConfigUtils.h
Go to the documentation of this file.
1 /*
2  * Distributed under the OpenDDS License.
3  * See: http://www.opendds.org/license.html
4  */
5 
6 #ifndef OPENDDS_DCPS_CONFIGUTILS_H
7 #define OPENDDS_DCPS_CONFIGUTILS_H
8 
9 #include "dcps_export.h"
10 #include "PoolAllocator.h"
11 #include "SafetyProfileStreams.h"
12 
13 #include <ace/Configuration.h>
14 
16 
17 namespace OpenDDS {
18 namespace DCPS {
19 
20  /// Helper types and functions for config file parsing
21  typedef OPENDDS_MAP(OPENDDS_STRING, OPENDDS_STRING) ValueMap;
22  typedef std::pair<OPENDDS_STRING, ACE_Configuration_Section_Key> SubsectionPair;
23  typedef OPENDDS_LIST(SubsectionPair) KeyList;
24 
25  /// Function that pulls all the values from the
26  /// specified ACE Configuration Section and places them in a
27  /// value map based on the field name. Returns the number of
28  /// values found in the section (and added to the value map).
29  ///
30  /// cf ACE_Configuration_Heap object being processed
31  /// key ACE_Configuration_Section_Key object that specifies
32  /// the section of the .ini file to process
33  /// values Map of field names to values (both OPENDDS_STRING)
34  /// that this function will add to.
35  ///
38  ValueMap& values );
39 
40  /// Function that processes the specified ACE Configuration Section
41  /// for subsections. If multiple levels of subsections are found,
42  /// a non-zero value is returned to indicate the error.
43  /// All valid subsection will be placed into the supplied
44  /// KeyList (std::pair<> of the subsection number and
45  /// ACE_Configuration_Section_Key). A return value of zero indicates
46  /// error-free success.
47  ///
48  ///
49  /// cf ACE_Configuration_Heap object being processed
50  /// key ACE_Configuration_Section_Key object that
51  /// specifies the section of the .ini file to process
52  /// subsections List of subsections found (list contains a
53  /// std::pair<> of the subsection number and
54  /// ACE_Configuration_Section_Key).
55  ///
58  KeyList& subsections );
59 
60 } // namespace DCPS
61 } // namespace OpenDDS
62 
64 
65 #endif /* CONFIGUTILS_H */
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
sequence< octet > key
#define OPENDDS_STRING
std::pair< OPENDDS_STRING, ACE_Configuration_Section_Key > SubsectionPair
Definition: ConfigUtils.h:22
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
int processSections(ACE_Configuration_Heap &cf, const ACE_Configuration_Section_Key &key, KeyList &subsections)
Definition: ConfigUtils.cpp:41
int pullValues(ACE_Configuration_Heap &cf, const ACE_Configuration_Section_Key &key, ValueMap &values)
Definition: ConfigUtils.cpp:17
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
typedef OPENDDS_MAP(OPENDDS_STRING, OPENDDS_STRING) ValueMap
Helper types and functions for config file parsing.
typedef OPENDDS_LIST(SubsectionPair) KeyList