9 #include "SmallBuffer.hpp"
10 #include "helics/helics-config.h"
48 std::swap(
time, m2.time);
49 std::swap(
flags, m2.flags);
92 virtual std::unique_ptr<Message>
process(std::unique_ptr<Message> message) = 0;
94 virtual std::vector<std::unique_ptr<Message>>
processVector(std::unique_ptr<Message> message)
96 std::vector<std::unique_ptr<Message>> ret;
97 auto res =
process(std::move(message));
99 ret.push_back(std::move(res));
105 std::unique_ptr<Message>
operator()(std::unique_ptr<Message> message)
107 return process(std::move(message));
120 virtual std::unique_ptr<Message>
process(std::unique_ptr<Message> message)
override
147 Time minDelay{Time::epsilon()};
186 [[maybe_unused]] std::string_view errorString)
200 virtual std::pair<Time, IterationRequest>
212 template<
class sizeType,
class SizedDataType>
215 return ((testSize >= sizeType(0)) && (testSize <
static_cast<sizeType
>(vec.size())));
Definition: core-data.hpp:165
virtual std::pair< Time, IterationRequest > operate(iteration_time newTime)=0
virtual void finalize()
Definition: core-data.hpp:183
virtual IterationRequest initializeOperations()=0
virtual ~FederateOperator()=default
virtual void error_handler([[maybe_unused]] int error_code, [[maybe_unused]] std::string_view errorString)
Definition: core-data.hpp:185
Definition: core-data.hpp:85
std::unique_ptr< Message > operator()(std::unique_ptr< Message > message)
Definition: core-data.hpp:105
virtual std::vector< std::unique_ptr< Message > > processVector(std::unique_ptr< Message > message)
Definition: core-data.hpp:94
virtual bool isMessageGenerating() const
Definition: core-data.hpp:111
virtual std::unique_ptr< Message > process(std::unique_ptr< Message > message)=0
virtual ~FilterOperator()=default
Definition: core-data.hpp:29
Time time
the event time the message is sent
Definition: core-data.hpp:31
std::int32_t counter
indexing counter not used directly by helics
Definition: core-data.hpp:40
void swap(Message &m2) noexcept
Definition: core-data.hpp:46
std::string_view to_string() const
Definition: core-data.hpp:64
void * backReference
back referencing pointer not used by helics
Definition: core-data.hpp:41
std::string original_source
the original source of the message
Definition: core-data.hpp:38
std::uint16_t messageValidation
extra field for user object usage, not used by HELICS
Definition: core-data.hpp:33
std::string dest
the destination of the message
Definition: core-data.hpp:36
SmallBuffer data
the data packet for the message
Definition: core-data.hpp:35
std::uint16_t flags
message flags
Definition: core-data.hpp:32
void clear()
Definition: core-data.hpp:66
bool isValid() const noexcept
Definition: core-data.hpp:59
std::int32_t messageID
the messageID for a message
Definition: core-data.hpp:34
std::string original_dest
the original destination of a message
Definition: core-data.hpp:39
std::string source
the most recent source of the message
Definition: core-data.hpp:37
Definition: core-data.hpp:192
virtual IterationRequest initializeOperations() override
Definition: core-data.hpp:195
Definition: core-data.hpp:116
NullFilterOperator()=default
virtual std::unique_ptr< Message > process(std::unique_ptr< Message > message) override
Definition: core-data.hpp:120
Definition: core-data.hpp:152
virtual std::unique_ptr< Message > convertToMessage(const SmallBuffer &) override
Definition: core-data.hpp:159
virtual SmallBuffer convertToValue(std::unique_ptr< Message >) override
Definition: core-data.hpp:156
NullTranslatorOperator()=default
Definition: SmallBuffer.hpp:25
void swap(SmallBuffer &sb2) noexcept
Definition: SmallBuffer.hpp:338
std::string_view to_string() const
Definition: SmallBuffer.hpp:238
bool empty() const
Definition: SmallBuffer.hpp:329
Definition: core-data.hpp:131
virtual std::unique_ptr< Message > convertToMessage(const SmallBuffer &value)=0
virtual Time computeNewMessageTime(Time valueTime)
Definition: core-data.hpp:144
virtual SmallBuffer convertToValue(std::unique_ptr< Message > message)=0
virtual Time computeNewValueTime(Time messageTime)
Definition: core-data.hpp:146
virtual ~TranslatorOperator()=default
TranslatorOperator()=default
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
bool isValidIndex(sizeType testSize, const SizedDataType &vec)
Definition: core-data.hpp:213
constexpr Time timeZero
Definition: helicsTime.hpp:31
IterationRequest
Definition: CoreTypes.hpp:102
@ NO_ITERATIONS
indicator that the iterations have completed
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27
Definition: helicsTime.hpp:43