helics
3.5.2
|
#include <Endpoints.hpp>
Public Member Functions | |
Endpoint ()=default | |
Endpoint (MessageFederate *mFed, std::string_view name, InterfaceHandle hid) | |
Endpoint (MessageFederate *mFed, std::string_view name, std::string_view type=std::string_view{}) | |
template<class FedPtr > | |
Endpoint (FedPtr &mFed, std::string_view name, std::string_view type=std::string_view{}) | |
Endpoint (InterfaceVisibility locality, MessageFederate *mFed, std::string_view name, std::string_view type=std::string_view{}) | |
template<class FedPtr > | |
Endpoint (InterfaceVisibility locality, FedPtr &mFed, std::string_view name, std::string_view type=std::string_view{}) | |
const std::string & | getType () const |
void | send (const char *data, size_t data_size) const |
void | subscribe (std::string_view key) |
void | sendTo (const char *data, size_t data_size, std::string_view dest) const |
void | sendAt (const char *data, size_t data_size, Time sendTime) const |
void | sendTo (const data_view &data, std::string_view dest) const |
void | sendToAt (const data_view &data, std::string_view dest, Time sendTime) const |
void | sendToAt (const char *data, size_t data_size, std::string_view dest, Time sendTime) const |
void | send (const void *data, size_t data_size) const |
void | send (const data_view &data) const |
void | sendAt (const data_view &data, Time sendTime) const |
void | send (std::unique_ptr< Message > mess) const |
void | send (const Message &mess) const |
std::unique_ptr< Message > | getMessage () const |
bool | hasMessage () const |
std::uint64_t | pendingMessageCount () const |
void | setCallback (const std::function< void(const Endpoint &, Time)> &callback) |
void | addSourceFilter (std::string_view filterName) |
void | addDestinationFilter (std::string_view filterName) |
void | setDefaultDestination (std::string_view target) |
void | addSourceEndpoint (std::string_view endpointName) |
void | addDestinationEndpoint (std::string_view endpointName) |
const std::string & | getDefaultDestination () const |
virtual const std::string & | getDisplayName () const override |
Public Member Functions inherited from helics::Interface | |
Interface (Federate *federate, InterfaceHandle hid, std::string_view actName) | |
Interface (Core *core, InterfaceHandle hid, std::string_view actName) | |
InterfaceHandle | getHandle () const |
operator InterfaceHandle () const | |
bool | isValid () const |
bool | operator< (const Interface &inp) const |
bool | operator> (const Interface &inp) const |
bool | operator== (const Interface &inp) const |
bool | operator!= (const Interface &inp) const |
const std::string & | getLocalName () const |
const std::string & | getName () const |
const std::string & | getTarget () const |
void | addSourceTarget (std::string_view newTarget, InterfaceType hint=InterfaceType::UNKNOWN) |
void | addDestinationTarget (std::string_view newTarget, InterfaceType hint=InterfaceType::UNKNOWN) |
void | removeTarget (std::string_view targetToRemove) |
void | addAlias (std::string_view alias) |
const std::string & | getInfo () const |
void | setInfo (std::string_view info) |
void | setTag (std::string_view tag, std::string_view value) |
const std::string & | getTag (std::string_view tag) const |
virtual void | setOption (int32_t option, int32_t value=1) |
virtual int32_t | getOption (int32_t option) const |
const std::string & | getInjectionType () const |
const std::string & | getExtractionType () const |
const std::string & | getInjectionUnits () const |
const std::string & | getExtractionUnits () const |
const std::string & | getSourceTargets () const |
const std::string & | getDestinationTargets () const |
std::size_t | getSourceTargetCount () const |
std::size_t | getDestinationTargetCount () const |
void | close () |
void | disconnectFromCore () |
Friends | |
class | MessageFederateManager |
Additional Inherited Members | |
Protected Attributes inherited from helics::Interface | |
Core * | mCore {nullptr} |
pointer to the core object | |
InterfaceHandle | handle {} |
the id as generated by the Federate | |
std::string | mName |
the name or key of the interface | |
class to manage an endpoint
|
default |
default constructor
helics::Endpoint::Endpoint | ( | InterfaceVisibility | locality, |
MessageFederate * | mFed, | ||
std::string_view | name, | ||
std::string_view | type = std::string_view{} |
||
) |
constructor to build an endpoint object
locality | visibility of the endpoint either global or local |
mFed | the MessageFederate to use |
name | the name of the endpoint |
type | a named type associated with the endpoint |
References helics::MessageFederate::registerEndpoint(), and helics::MessageFederate::registerGlobalEndpoint().
|
inline |
constructor to build an endpoint object
locality | visibility of the endpoint either global or local |
mFed | the MessageFederate to use |
name | the name of the endpoint |
type | a named type associated with the endpoint |
void helics::Endpoint::addDestinationFilter | ( | std::string_view | filterName | ) |
add a named filter to an endpoint for all message going to the endpoint
add a named filter to an endpoint for all messages going to the endpoint
void helics::Endpoint::addSourceFilter | ( | std::string_view | filterName | ) |
add a named filter to an endpoint for all message coming from the endpoint
add a named filter to an endpoint for all messages coming from the endpoint
const std::string & helics::Endpoint::getDefaultDestination | ( | ) | const |
get the target destination for the endpoint TODO(PT):: make this work
|
inlineoverridevirtual |
get the display name for an input
the name is the given local name or if empty the name of the target
Implements helics::Interface.
std::unique_ptr< Message > helics::Endpoint::getMessage | ( | ) | const |
get an available message if there is no message the returned object is empty
bool helics::Endpoint::hasMessage | ( | ) | const |
check if there is a message available
std::uint64_t helics::Endpoint::pendingMessageCount | ( | ) | const |
Get the number of available messages
check if there is a message available
void helics::Endpoint::send | ( | const char * | data, |
size_t | data_size | ||
) | const |
send a data block and length to the endpoint targets
data | pointer to data location |
data_size | the length of the data |
|
inline |
send a data_view to the target destination
a data view can convert from many different formats so this function should be catching many of the common use cases
data | the information to send |
References helics::data_view::data(), send(), and helics::data_view::size().
Referenced by send().
|
inline |
void helics::Endpoint::send | ( | const void * | data, |
size_t | data_size | ||
) | const |
send a data block and length to the target destination
data | pointer to data location |
data_size | the length of the data |
void helics::Endpoint::send | ( | std::unique_ptr< Message > | mess | ) | const |
send a pointer to a message object
void helics::Endpoint::sendAt | ( | const char * | data, |
size_t | data_size, | ||
Time | sendTime | ||
) | const |
send a data block and length
sendTime | the time to send the message |
data | pointer to data location |
data_size | the length of the data |
send a data_view to the specified target destination
a data view can convert from many different formats so this function should be catching many of the common use cases
data | a representation to send |
sendTime | the time the message should be sent |
References helics::data_view::data(), and helics::data_view::size().
void helics::Endpoint::sendTo | ( | const char * | data, |
size_t | data_size, | ||
std::string_view | dest | ||
) | const |
send a data block and length
dest | string name of the destination |
data | pointer to data location |
data_size | the length of the data |
|
inline |
send a data_view
a data view can convert from many different formats so this function should be catching many of the common use cases
dest | string name of the destination |
data | the information to send |
References helics::data_view::data(), and helics::data_view::size().
void helics::Endpoint::sendToAt | ( | const char * | data, |
size_t | data_size, | ||
std::string_view | dest, | ||
Time | sendTime | ||
) | const |
send a data block and length to a destination at a particular time
data | pointer to data location |
data_size | the length of the data |
dest | string name of the destination |
sendTime | the time to send the message |
|
inline |
send a data_view
a data view can convert from many different formats so this function should be catching many of the common use cases
data | data representation to send |
dest | string name of the destination |
sendTime | the time the message should be sent |
References helics::data_view::data(), and helics::data_view::size().
register a callback for an update notification
the callback is called in the just before the time request function returns
callback | a function with signature void(endpoint_id_t, Time) time is the time the value was updated This callback is a notification callback and doesn't return the value |
void helics::Endpoint::setDefaultDestination | ( | std::string_view | target | ) |
set a target destination for unspecified messages
void helics::Endpoint::subscribe | ( | std::string_view | key | ) |
subscribe the endpoint to a particular publication
References helics::PUBLICATION.