GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
in_memory_configuration.h
Go to the documentation of this file.
1 /*!
2  * \file in_memory_configuration.h
3  * \brief A ConfigurationInterface for testing purposes.
4  * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
5  *
6  * This implementation accepts configuration parameters upon instantiation and
7  * it is intended to be used in unit testing.
8  *
9  * -----------------------------------------------------------------------------
10  *
11  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
12  *
13  * GNSS-SDR is a software defined Global Navigation
14  * Satellite Systems receiver
15  *
16  * This file is part of GNSS-SDR.
17  *
18  * SPDX-License-Identifier: GPL-3.0-or-later
19  *
20  * -----------------------------------------------------------------------------
21  */
22 
23 
24 #ifndef GNSS_SDR_IN_MEMORY_CONFIGURATION_H
25 #define GNSS_SDR_IN_MEMORY_CONFIGURATION_H
26 
28 #include "string_converter.h"
29 #include <cstdint>
30 #include <map>
31 #include <memory>
32 #include <string>
33 
34 
35 /*!
36  * \brief This class is an implementation of the interface ConfigurationInterface.
37  *
38  * This implementation accepts configuration parameters upon instantiation and
39  * it is intended to be used in unit testing.
40  */
42 {
43 public:
46  std::string property(std::string property_name, std::string default_value) const override;
47  bool property(std::string property_name, bool default_value) const override;
48  int64_t property(std::string property_name, int64_t default_value) const override;
49  uint64_t property(std::string property_name, uint64_t default_value) const override;
50  int32_t property(std::string property_name, int32_t default_value) const override;
51  uint32_t property(std::string property_name, uint32_t default_value) const override;
52  int16_t property(std::string property_name, int16_t default_value) const override;
53  uint16_t property(std::string property_name, uint16_t default_value) const override;
54  float property(std::string property_name, float default_value) const override;
55  double property(std::string property_name, double default_value) const override;
56  void set_property(std::string property_name, std::string value) override;
57  void supersede_property(const std::string& property_name, const std::string& value);
58  bool is_present(const std::string& property_name) const;
59 
60 private:
61  std::map<std::string, std::string> properties_;
62  std::unique_ptr<StringConverter> converter_;
63 };
64 
65 #endif // GNSS_SDR_IN_MEMORY_CONFIGURATION_H
This abstract class represents an interface to configuration parameters.
This class represents an interface to configuration parameters.
This class is an implementation of the interface ConfigurationInterface.
Interface of a class that interprets the contents of a string and converts it into different types...