helics  2.8.1
Public Member Functions | Friends | List of all members
helics::Endpoint Class Reference

#include <Endpoints.hpp>

Public Member Functions

 Endpoint ()=default
 
 Endpoint (MessageFederate *mfed, const std::string &name, interface_handle id, void *data)
 
 Endpoint (MessageFederate *mFed, const std::string &name, const std::string &type=std::string())
 
template<class FedPtr >
 Endpoint (FedPtr &mFed, const std::string &name, const std::string &type=std::string())
 
 Endpoint (interface_visibility locality, MessageFederate *mFed, const std::string &name, const std::string &type=std::string())
 
template<class FedPtr >
 Endpoint (interface_visibility locality, FedPtr &mFed, const std::string &name, const std::string &type=std::string())
 
bool isValid () const
 
bool operator== (const Endpoint &ept) const
 
bool operator!= (const Endpoint &ept) const
 
bool operator< (const Endpoint &ept) const
 
void send (const std::string &dest, const char *data, size_t data_size) const
 
void subscribe (const std::string &key)
 
void send (const std::string &dest, const char *data, size_t data_size, Time sendTime) const
 
void send (const char *data, size_t data_size, Time sendTime) const
 
void send (const std::string &dest, const data_view &data) const
 
void send (const std::string &dest, const data_view &data, Time sendTime) const
 
void send (const char *data, size_t data_size) const
 
void send (const data_view &data) const
 
void send (const data_view &data, Time sendTime) const
 
void send (std::unique_ptr< Message > mess) const
 
void send (const Message &mess) const
 
auto getMessage () const
 
bool hasMessage () const
 
auto pendingMessages () const
 
void setCallback (const std::function< void(const Endpoint &, Time)> &callback)
 
void addSourceFilter (const std::string &filterName)
 
void addDestinationFilter (const std::string &filterName)
 
void setDefaultDestination (std::string target)
 
const std::string & getDefaultDestination () const
 
const std::string & getName () const
 
const std::string & getKey () const
 
const std::string & getType () const
 
interface_handle getHandle () const
 ‍** get the number of filters applied to the endpoint*‍/ More...
 
 operator interface_handle () const
 
const std::string & getInfo () const
 
void setInfo (const std::string &info)
 
void setOption (int32_t option, int32_t value=1)
 
int32_t getOption (int32_t option) const
 
void close ()
 

Friends

class MessageFederateManager
 

Detailed Description

class to manage an endpoint

Constructor & Destructor Documentation

◆ Endpoint() [1/3]

helics::Endpoint::Endpoint ( )
default

default constructor

◆ Endpoint() [2/3]

helics::Endpoint::Endpoint ( interface_visibility  locality,
MessageFederate mFed,
const std::string &  name,
const std::string &  type = std::string() 
)

constructor to build an endpoint object

Parameters
localityvisibility of the endpoint either global or local
mFedthe MessageFederate to use
namethe name of the endpoint
typea named type associated with the endpoint

◆ Endpoint() [3/3]

template<class FedPtr >
helics::Endpoint::Endpoint ( interface_visibility  locality,
FedPtr &  mFed,
const std::string &  name,
const std::string &  type = std::string() 
)
inline

constructor to build an endpoint object

Parameters
localityvisibility of the endpoint either global or local
mFedthe MessageFederate to use
namethe name of the endpoint
typea named type associated with the endpoint

Member Function Documentation

◆ addDestinationFilter()

void helics::Endpoint::addDestinationFilter ( const std::string &  filterName)
inline

add a named filter to an endpoint for all message going to the endpoint

References fed.

◆ addSourceFilter()

void helics::Endpoint::addSourceFilter ( const std::string &  filterName)
inline

add a named filter to an endpoint for all message coming from the endpoint

References fed.

◆ close()

void helics::Endpoint::close ( )
inline

close the endpoint from receiving more messages

References fed.

◆ getDefaultDestination()

const std::string& helics::Endpoint::getDefaultDestination ( ) const
inline

get the target destination for the endpoint

◆ getHandle()

interface_handle helics::Endpoint::getHandle ( ) const
inline

‍** get the number of filters applied to the endpoint*‍/

get the actual endpoint id for the fed

◆ getInfo()

const std::string& helics::Endpoint::getInfo ( ) const
inline

get the interface information field of the publication

References fed.

◆ getKey()

const std::string& helics::Endpoint::getKey ( ) const
inline

get the name of the endpoint

References fed.

◆ getMessage()

auto helics::Endpoint::getMessage ( ) const
inline

get an available message if there is no message the returned object is empty

References fed.

◆ getName()

const std::string& helics::Endpoint::getName ( ) const
inline

get the name of the endpoint

Referenced by helics::MessageFederateManager::registerKnownCommunicationPath().

◆ getOption()

int32_t helics::Endpoint::getOption ( int32_t  option) const
inline

get the current value of a flag for the handle

References fed.

◆ getType()

const std::string& helics::Endpoint::getType ( ) const
inline

get the specified type of the endpoint

References fed.

◆ hasMessage()

bool helics::Endpoint::hasMessage ( ) const
inline

check if there is a message available

References fed.

◆ isValid()

bool helics::Endpoint::isValid ( ) const
inline

check if the Endpoint links to a valid operation

◆ operator interface_handle()

helics::Endpoint::operator interface_handle ( ) const
inline

implicit conversion operator for extracting the handle

◆ pendingMessages()

auto helics::Endpoint::pendingMessages ( ) const
inline

check if there is a message available

References fed.

◆ send() [1/10]

void helics::Endpoint::send ( const char *  data,
size_t  data_size 
) const
inline

send a data block and length to the target destination

Parameters
datapointer to data location
data_sizethe length of the data

References data, and fed.

◆ send() [2/10]

void helics::Endpoint::send ( const char *  data,
size_t  data_size,
Time  sendTime 
) const
inline

send a data block and length

Parameters
datapointer to data location
data_sizethe length of the data
sendTimethe time to send the message

References data, and fed.

◆ send() [3/10]

void helics::Endpoint::send ( const data_view data) const
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

Parameters
datathe information to send

References data, and fed.

◆ send() [4/10]

void helics::Endpoint::send ( const data_view data,
Time  sendTime 
) const
inline

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

Parameters
dataa representation to send
sendTimethe time the message should be sent

References data, and fed.

◆ send() [5/10]

void helics::Endpoint::send ( const Message mess) const
inline

send a message object

this is to send a pre-built message

Parameters
messa reference to an actual message object

References send().

Referenced by send().

◆ send() [6/10]

void helics::Endpoint::send ( const std::string &  dest,
const char *  data,
size_t  data_size 
) const
inline

send a data block and length

Parameters
deststring name of the destination
datapointer to data location
data_sizethe length of the data

References data, and fed.

◆ send() [7/10]

void helics::Endpoint::send ( const std::string &  dest,
const char *  data,
size_t  data_size,
Time  sendTime 
) const
inline

send a data block and length

Parameters
deststring name of the destination
datapointer to data location
data_sizethe length of the data
sendTimethe time to send the message

References data, and fed.

◆ send() [8/10]

void helics::Endpoint::send ( const std::string &  dest,
const data_view data 
) const
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

Parameters
deststring name of the destination
datathe information to send

References data, and fed.

◆ send() [9/10]

void helics::Endpoint::send ( const std::string &  dest,
const data_view data,
Time  sendTime 
) const
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

Parameters
deststring name of the destination
datadata representation to send
sendTimethe time the message should be sent

References data, and fed.

◆ send() [10/10]

void helics::Endpoint::send ( std::unique_ptr< Message mess) const
inline

send a pointer to a message object

References fed.

◆ setCallback()

void helics::Endpoint::setCallback ( const std::function< void(const Endpoint &, Time)> &  callback)
inline

register a callback for an update notification

the callback is called in the just before the time request function returns

Parameters
callbacka 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

References fed.

◆ setDefaultDestination()

void helics::Endpoint::setDefaultDestination ( std::string  target)
inline

set a target destination for unspecified messages

◆ setInfo()

void helics::Endpoint::setInfo ( const std::string &  info)
inline

set the interface information field of the publication

References fed.

◆ subscribe()

void helics::Endpoint::subscribe ( const std::string &  key)
inline

subscribe the endpoint to a particular publication

References fed.


The documentation for this class was generated from the following files: