Falcon
Loading...
Searching...
No Matches
config.hpp
1// ---------------------------------------------------------------------
2// This file is part of falcon-core.
3//
4// Copyright (C) 2015, 2016, 2017 Neuro-Electronics Research Flanders
5//
6// Falcon-server is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10//
11// Falcon-server is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with falcon-core. If not, see <http://www.gnu.org/licenses/>.
18// ---------------------------------------------------------------------
19
20#pragma once
21
22#include <iostream>
23#include <memory>
24#include <vector>
25
26#include "datasource.hpp"
27#include "options/options.hpp"
28#include "utilities/configuration.hpp"
29
30class TestBenchConfiguration : public Configuration {
31 public:
32 TestBenchConfiguration() : Configuration() {
33 add_option("network/ip", ip_address, "Network IP address to stream data packets to.");
34 add_option("network/port", port, "Network port to stream data packets to.");
35 add_option("stream/rate", stream_rate, "Data stream rate in Hz");
36 add_option("stream/npackets", npackets,
37 "The total number of data packets to stream. "
38 "A value of 0 means continuous streaming.");
39 add_option("stream/autostart", autostart,
40 "The data source index that will be streamed immediately after "
41 "start-up.");
42 add_option("sources", sources, "A list of data source definitions.");
43 }
44
45 public:
46 options::String ip_address{"127.0.0.1"};
47 options::Int port{5000};
48 options::Measurement<double> stream_rate{1, "Hz", options::positive<double>(true)};
49 options::Value<uint64_t, false> npackets{0};
50 options::NullableInt autostart;
51 options::Value<YAML::Node, true> sources{YAML::Load("class: default")};
52};