iceoryx_doc  1.0.1
roudi_config_file_provider.hpp
1 // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
2 // Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 // SPDX-License-Identifier: Apache-2.0
17 #ifndef IOX_POSH_ROUDI_ROUDI_CONFIG_FILE_PROVIDER_HPP
18 #define IOX_POSH_ROUDI_ROUDI_CONFIG_FILE_PROVIDER_HPP
19 
20 #include "iceoryx_posh/iceoryx_posh_config.hpp"
21 #include "iceoryx_posh/iceoryx_posh_types.hpp"
22 #include "iceoryx_utils/cxx/expected.hpp"
23 #include "iceoryx_utils/cxx/string.hpp"
24 
25 namespace iox
26 {
27 namespace roudi
28 {
39 {
40  INVALID_STATE,
41  NO_GENERAL_SECTION,
42  INVALID_CONFIG_FILE_VERSION,
43  NO_SEGMENTS,
44  MAX_NUMBER_OF_SEGMENTS_EXCEEDED,
45  SEGMENT_WITHOUT_MEMPOOL,
46  MAX_NUMBER_OF_MEMPOOLS_PER_SEGMENT_EXCEEDED,
47  MEMPOOL_WITHOUT_CHUNK_SIZE,
48  MEMPOOL_WITHOUT_CHUNK_COUNT,
49  EXCEPTION_IN_PARSER
50 };
51 
52 constexpr const char* ROUDI_CONFIG_FILE_PARSE_ERROR_STRINGS[] = {"INVALID_STATE",
53  "NO_GENERAL_SECTION",
54  "INVALID_CONFIG_FILE_VERSION",
55  "NO_SEGMENTS",
56  "MAX_NUMBER_OF_SEGMENTS_EXCEEDED",
57  "SEGMENT_WITHOUT_MEMPOOL",
58  "MAX_NUMBER_OF_MEMPOOLS_PER_SEGMENT_EXCEEDED",
59  "MEMPOOL_WITHOUT_CHUNK_SIZE",
60  "MEMPOOL_WITHOUT_CHUNK_COUNT",
61  "EXCEPTION_IN_PARSER"};
62 
65 {
66  public:
70  virtual cxx::expected<RouDiConfig_t, RouDiConfigFileParseError> parse() = 0;
71 
72  protected:
73  ConfigFilePathString_t m_customConfigFilePath;
74 };
75 
76 } // namespace roudi
77 } // namespace iox
78 
79 #endif // IOX_POSH_ROUDI_ROUDI_CONFIG_FILE_PROVIDER_HPP
Base class for a config file provider.
Definition: roudi_config_file_provider.hpp:65
virtual cxx::expected< RouDiConfig_t, RouDiConfigFileParseError > parse()=0
interface to parse a config file which needs to be implemented for a custom parser
RouDiConfigFileParseError
This are the errors which can occur when a config file is parsed NO_GENERAL_SECTION - the section for...
Definition: roudi_config_file_provider.hpp:39
Definition: service_description.hpp:29