Kaspersky Neuromorphic Platform  1.0.0
API Reference
Loading...
Searching...
No Matches
spike_message.h
Go to the documentation of this file.
1
22#pragma once
23
24#include <iostream>
25#include <vector>
26
27#include "message_header.h"
28
29
34{
35
39using SpikeIndex = uint32_t;
40
41
45using SpikeData = std::vector<SpikeIndex>;
46
47
52{
56 MessageHeader header_;
57
62
66};
67
68
75bool operator==(const SpikeMessage &sm1, const SpikeMessage &sm2);
76
77
84std::ostream &operator<<(std::ostream &stream, const core::messaging::SpikeData &spikes);
85
92std::ostream &operator<<(std::ostream &stream, const SpikeMessage &msg);
93
100std::istream &operator>>(std::istream &stream, SpikeMessage &msg);
101
102} // namespace knp::core::messaging
Message header class.
Messaging namespace.
Definition message_bus.h:33
std::istream & operator>>(std::istream &stream, MessageHeader &header)
Get message header from an input stream.
std::vector< SpikeIndex > SpikeData
List of spike indexes.
bool operator==(const SpikeMessage &sm1, const SpikeMessage &sm2)
Check if two spike messages are the same.
uint32_t SpikeIndex
Spike index type in the form of a 32-bit unsigned integer.
std::ostream & operator<<(std::ostream &stream, const MessageHeader &header)
Send message header to an output stream.
Structure of the spike message.
MessageHeader header_
Message header.
SpikeData neuron_indexes_
Indexes of the recently spiked neurons.