Kaspersky Neuromorphic Platform  1.0.0
API Reference
Loading...
Searching...
No Matches
index_converter.h
Go to the documentation of this file.
1
21#pragma once
22
23#include <knp/core/impexp.h>
26#include <knp/core/uid.h>
27
28#include <spdlog/spdlog.h>
29
30#include <functional>
31#include <istream>
32#include <memory>
33#include <string>
34#include <type_traits>
35#include <utility>
36#include <vector>
37
38
43{
48class KNP_DECLSPEC IndexConverter
49{
50public:
56 explicit IndexConverter(std::unique_ptr<std::istream> &&stream, char delim = ',')
57 : stream_(std::move(stream)), delim_(delim)
58 {
59 }
60
66 core::messaging::SpikeData operator()(core::Step step = 0) const;
67
68public:
73 [[nodiscard]] std::istream &get_stream() { return *stream_; }
74
75private:
79 std::unique_ptr<std::istream> stream_;
83 const char delim_ = ',';
84};
85
86} // namespace knp::framework::io::input
The IndexConverter class is a definition of a converter that converts lines of integers into spiked n...
std::istream & get_stream()
Get input stream.
core::messaging::SpikeData operator()(core::Step step=0) const
Call a function that converts data from the input stream into spike messages with spiked neuron index...
IndexConverter(std::unique_ptr< std::istream > &&stream, char delim=',')
Create converter with a delimiter.
Message endpoint interface.
Input channel namespace.
Spike message class.
UID class and routines.