helics  3.4.0
Public Member Functions | Protected Attributes | List of all members
helicscpp::Core Class Reference

Public Member Functions

 Core (const std::string &type, const std::string &name, const std::string &initString)
 Core (const std::string &type, const std::string &name, int argc, char **argv)
 Core (HelicsCore cr) HELICS_NOTHROW
 ~Core ()
 operator HelicsCore ()
HelicsCore baseObject () const
bool isConnected () const
 Core (const Core &cr)
Coreoperator= (const Core &cr)
void setReadyToInit ()
void disconnect ()
bool waitForDisconnect (int msToWait=-1)
const char * getIdentifier () const
const char * getAddress () const
Filter registerFilter (HelicsFilterTypes type, const std::string &name=std::string())
CloningFilter registerCloningFilter (const std::string &deliveryEndpoint)
void setGlobal (const std::string &valueName, const std::string &value)
void addAlias (const std::string &interfaceName, const std::string &alias)
void globalError (int errorCode, const std::string &errorString)
void sendCommand (const std::string &target, const std::string &command)
std::string query (const std::string &target, const std::string &queryStr, HelicsSequencingModes mode=HELICS_SEQUENCING_MODE_FAST) const

Protected Attributes

HelicsCore core
 reference to the underlying core object

Constructor & Destructor Documentation

◆ Core() [1/5]

helicscpp::Core::Core ( )

Default constructor

◆ Core() [2/5]

helicscpp::Core::Core ( const std::string &  type,
const std::string &  name,
const std::string &  initString 

construct with type, core name and initialization string

References core, and helicsCreateCore().

◆ Core() [3/5]

helicscpp::Core::Core ( const std::string &  type,
const std::string &  name,
int  argc,
char **  argv 

construct with type, core name and command line arguments

References core, and helicsCreateCoreFromArgs().

◆ Core() [4/5]

helicscpp::Core::Core ( HelicsCore  cr)

construct a core from a core pointer

◆ ~Core()

helicscpp::Core::~Core ( )


References core, and helicsCoreFree().

◆ Core() [5/5]

helicscpp::Core::Core ( const Core cr)

copy constructor

References core, and helicsCoreClone().

Member Function Documentation

◆ addAlias()

void helicscpp::Core::addAlias ( const std::string &  interfaceName,
const std::string &  alias 

add a global alias for an interface

interfaceNamethe given name of the interface
aliasthe new name by which the interface can be referenced

References core, and helicsCoreAddAlias().

◆ baseObject()

HelicsCore helicscpp::Core::baseObject ( ) const

explicitly get the base HelicsCore object

References core.

◆ disconnect()

void helicscpp::Core::disconnect ( )

disconnect the core from its broker

References core, and helicsCoreDisconnect().

◆ getAddress()

const char* helicscpp::Core::getAddress ( ) const

get the connection network or connection address for the core

References core, and helicsCoreGetAddress().

◆ getIdentifier()

const char* helicscpp::Core::getIdentifier ( ) const

get an identifier string for the core

References core, and helicsCoreGetIdentifier().

◆ isConnected()

bool helicscpp::Core::isConnected ( ) const

check if the core is connected to the broker

References core, HELICS_FALSE, and helicsCoreIsConnected().

◆ operator HelicsCore()

helicscpp::Core::operator HelicsCore ( )

implicit operator so the object can be used with the c api functions natively

References core.

◆ operator=()

Core& helicscpp::Core::operator= ( const Core cr)

copy assignment

References core, and helicsCoreClone().

◆ query()

std::string helicscpp::Core::query ( const std::string &  target,
const std::string &  queryStr,
HelicsSequencingModes  mode = HELICS_SEQUENCING_MODE_FAST 
) const

make a query of the core

this call is blocking until the value is returned which may take some time depending on the size of the federation and the specific string being queried

targetthe target of the query can be "federation", "federate", "broker", "core", or a specific name of a federate, core, or broker
queryStra string with the query, see other documentation for specific properties to query, can be defined by the federate
modethe ordering mode to use for the query (fast-priority channels, ordered for normal channels ordered with all other messages)
a string with the value requested. this is either going to be a vector of strings value or a JSON string stored in the first element of the vector. The string "#invalid" is returned if the query was not valid

References core, HELICS_SEQUENCING_MODE_FAST, helicsCreateQuery(), helicsQueryCoreExecute(), helicsQueryFree(), and helicsQuerySetOrdering().

◆ registerCloningFilter()

CloningFilter helicscpp::Core::registerCloningFilter ( const std::string &  deliveryEndpoint)

create a cloning Filter on the specified federate

cloning filters copy a message and send it to multiple locations source and destination can be added through other functions

deliveryEndpointthe specified endpoint to deliver the message
a HelicsFilter object

References core, and helicsCoreRegisterCloningFilter().

◆ registerFilter()

Filter helicscpp::Core::registerFilter ( HelicsFilterTypes  type,
const std::string &  name = std::string() 

create a destination Filter on the specified federate

filters can be created through a federate or a core , linking through a federate allows a few extra features of name matching to function on the federate interface but otherwise equivalent behavior

typethe type of filter to create
namethe name of the filter (can be NULL)
a HelicsFilter object

References core, and helicsCoreRegisterFilter().

◆ sendCommand()

void helicscpp::Core::sendCommand ( const std::string &  target,
const std::string &  command 

send an asynchronous command to another object

targetthe name of the target of the command
commandthe command message to send

References core, and helicsCoreSendCommand().

◆ setGlobal()

void helicscpp::Core::setGlobal ( const std::string &  valueName,
const std::string &  value 

set a global federation value

valueNamethe name of the global value to set
valueactual value of the global variable

References core, and helicsCoreSetGlobal().

◆ setReadyToInit()

void helicscpp::Core::setReadyToInit ( )

set the core to ready to enter init

this function only needs to be called for cores that don't have any federates but may have filters for cores with federates it won't do anything

References core, and helicsCoreSetReadyToInit().

◆ waitForDisconnect()

bool helicscpp::Core::waitForDisconnect ( int  msToWait = -1)

waits in the current thread until the broker is disconnected

msToWaitthe timeout to wait for disconnect (-1) implies no timeout
true if the disconnect was successful false if it timed out

References core, HELICS_FALSE, and helicsCoreWaitForDisconnect().

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