2011-10-01 18:45:20 +00:00
|
|
|
/*!
|
|
|
|
* \file in_memory_configuration.h
|
2011-12-28 21:36:45 +00:00
|
|
|
* \brief A ConfigurationInterface for testing purposes.
|
2011-10-01 18:45:20 +00:00
|
|
|
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
|
|
|
|
*
|
|
|
|
* This implementation accepts configuration parameters upon instantiation and
|
|
|
|
* it is intended to be used in unit testing.
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
|
|
|
* GNSS-SDR is a software defined Global Navigation
|
|
|
|
* Satellite Systems receiver
|
|
|
|
*
|
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2011-10-01 18:45:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_IN_MEMORY_CONFIGURATION_H
|
|
|
|
#define GNSS_SDR_IN_MEMORY_CONFIGURATION_H
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2018-02-26 02:15:53 +00:00
|
|
|
#include "configuration_interface.h"
|
2020-06-23 07:47:58 +00:00
|
|
|
#include "string_converter.h"
|
2018-12-02 04:29:11 +00:00
|
|
|
#include <cstdint>
|
2011-10-01 18:45:20 +00:00
|
|
|
#include <map>
|
2014-04-03 21:59:14 +00:00
|
|
|
#include <memory>
|
2011-10-01 18:45:20 +00:00
|
|
|
#include <string>
|
2018-02-26 02:15:53 +00:00
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup Core
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup Core_Receiver
|
|
|
|
* \{ */
|
|
|
|
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2011-12-28 03:05:37 +00:00
|
|
|
/*!
|
2011-10-01 18:45:20 +00:00
|
|
|
* \brief This class is an implementation of the interface ConfigurationInterface.
|
|
|
|
*
|
|
|
|
* This implementation accepts configuration parameters upon instantiation and
|
|
|
|
* it is intended to be used in unit testing.
|
|
|
|
*/
|
|
|
|
class InMemoryConfiguration : public ConfigurationInterface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
InMemoryConfiguration();
|
2020-02-26 21:40:00 +00:00
|
|
|
~InMemoryConfiguration();
|
2020-06-23 09:05:31 +00:00
|
|
|
std::string property(std::string property_name, std::string default_value) const override;
|
|
|
|
bool property(std::string property_name, bool default_value) const override;
|
|
|
|
int64_t property(std::string property_name, int64_t default_value) const override;
|
|
|
|
uint64_t property(std::string property_name, uint64_t default_value) const override;
|
|
|
|
int32_t property(std::string property_name, int32_t default_value) const override;
|
|
|
|
uint32_t property(std::string property_name, uint32_t default_value) const override;
|
|
|
|
int16_t property(std::string property_name, int16_t default_value) const override;
|
|
|
|
uint16_t property(std::string property_name, uint16_t default_value) const override;
|
|
|
|
float property(std::string property_name, float default_value) const override;
|
|
|
|
double property(std::string property_name, double default_value) const override;
|
|
|
|
void set_property(std::string property_name, std::string value) override;
|
2019-06-29 20:04:03 +00:00
|
|
|
void supersede_property(const std::string& property_name, const std::string& value);
|
2020-06-23 09:05:31 +00:00
|
|
|
bool is_present(const std::string& property_name) const;
|
2018-03-03 01:03:39 +00:00
|
|
|
|
2011-10-01 18:45:20 +00:00
|
|
|
private:
|
|
|
|
std::map<std::string, std::string> properties_;
|
2014-04-03 21:59:14 +00:00
|
|
|
std::unique_ptr<StringConverter> converter_;
|
2011-10-01 18:45:20 +00:00
|
|
|
};
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
|
|
|
|
/** \} */
|
|
|
|
/** \} */
|
2020-02-08 09:10:46 +00:00
|
|
|
#endif // GNSS_SDR_IN_MEMORY_CONFIGURATION_H
|