helics
3.5.2
|
#include <CoreApp.hpp>
Public Member Functions | |
CoreApp ()=default | |
CoreApp (std::vector< std::string > args) | |
CoreApp (CoreType ctype, std::vector< std::string > args) | |
CoreApp (CoreType ctype, std::string_view coreName, std::vector< std::string > args) | |
CoreApp (int argc, char *argv[]) | |
CoreApp (CoreType ctype, std::string_view coreName, int argc, char *argv[]) | |
CoreApp (CoreType ctype, int argc, char *argv[]) | |
CoreApp (std::string_view argString) | |
CoreApp (CoreType ctype, std::string_view argString) | |
CoreApp (CoreType ctype, std::string_view coreName, std::string_view argString) | |
CoreApp (std::shared_ptr< Core > cr) | |
bool | isConnected () const |
bool | connect () |
bool | isOpenToNewFederates () const |
void | forceTerminate () |
bool | waitForDisconnect (std::chrono::milliseconds waitTime=std::chrono::milliseconds(0)) |
void | linkEndpoints (std::string_view source, std::string_view target) |
void | dataLink (std::string_view source, std::string_view target) |
void | addSourceFilterToEndpoint (std::string_view filter, std::string_view endpoint) |
void | addDestinationFilterToEndpoint (std::string_view filter, std::string_view endpoint) |
void | addAlias (std::string_view interfaceName, std::string_view alias) |
void | makeConnections (const std::string &file) |
const std::string & | getIdentifier () const |
const std::string & | getAddress () const |
std::string | query (std::string_view target, std::string_view queryStr, HelicsSequencingModes mode=HELICS_SEQUENCING_MODE_FAST) |
void | setTag (std::string_view tag, std::string_view value="true") |
const std::string & | getTag (std::string_view tag) const |
void | setGlobal (std::string_view valueName, std::string_view value="true") |
void | sendCommand (std::string_view target, std::string_view commandStr, HelicsSequencingModes mode=HELICS_SEQUENCING_MODE_FAST) |
void | setLogFile (std::string_view logFile) |
void | setLoggingLevel (int loglevel) |
void | setReadyToInit () |
void | haltInit () |
CoreApp * | operator-> () |
const CoreApp * | operator-> () const |
std::shared_ptr< Core > | getCopyofCorePointer () const |
void | reset () |
void | globalError (int32_t errorCode, std::string_view errorString) |
class implementing a Core object. This object is meant to a be a very simple core executor with a similar interface to the other apps
|
default |
default constructor
|
explicit |
construct from command line arguments in a vector
args | the command line arguments to pass in a reverse vector |
References helics::DEFAULT.
helics::CoreApp::CoreApp | ( | CoreType | ctype, |
std::vector< std::string > | args | ||
) |
construct from command line arguments in a vector
ctype | the type of core to create |
args | the command line arguments to pass in a reverse vector |
helics::CoreApp::CoreApp | ( | CoreType | ctype, |
std::string_view | coreName, | ||
std::vector< std::string > | args | ||
) |
construct from command line arguments in a vector
ctype | the type of core to create |
coreName | the name of the core to use |
args | the command line arguments to pass in a reverse vector |
helics::CoreApp::CoreApp | ( | int | argc, |
char * | argv[] | ||
) |
construct from command line arguments
argc | the number of arguments |
argv | the strings in the input |
References helics::DEFAULT.
helics::CoreApp::CoreApp | ( | CoreType | ctype, |
std::string_view | coreName, | ||
int | argc, | ||
char * | argv[] | ||
) |
construct from command line arguments
ctype | the type of core to create |
coreName | the name of the core to use |
argc | the number of arguments |
argv | the strings in the input |
helics::CoreApp::CoreApp | ( | CoreType | ctype, |
int | argc, | ||
char * | argv[] | ||
) |
construct from command line arguments
ctype | the type of core to create |
argc | the number of arguments |
argv | the strings in the input |
|
explicit |
construct from command line arguments parsed as a single string
argString | a merged string with all the arguments |
References helics::CoreFactory::findCore().
helics::CoreApp::CoreApp | ( | CoreType | ctype, |
std::string_view | argString | ||
) |
construct from command line arguments parsed as a single string
ctype | the type of core to create |
argString | a merged string with all the arguments |
helics::CoreApp::CoreApp | ( | CoreType | ctype, |
std::string_view | coreName, | ||
std::string_view | argString | ||
) |
construct from command line arguments parsed as a single string
ctype | the type of core to create |
coreName | the name of the core to use or create |
argString | a merged string with all the arguments |
|
explicit |
create a CoreApp from a core pointer
void helics::CoreApp::addAlias | ( | std::string_view | interfaceName, |
std::string_view | alias | ||
) |
add an alias for an interface
void helics::CoreApp::addDestinationFilterToEndpoint | ( | std::string_view | filter, |
std::string_view | endpoint | ||
) |
add a destination Filter to an endpoint
void helics::CoreApp::addSourceFilterToEndpoint | ( | std::string_view | filter, |
std::string_view | endpoint | ||
) |
add a source Filter to an endpoint
bool helics::CoreApp::connect | ( | ) |
connect the Core to its broker
void helics::CoreApp::dataLink | ( | std::string_view | source, |
std::string_view | target | ||
) |
link a publication and input
void helics::CoreApp::forceTerminate | ( | ) |
forcibly disconnect the core
Referenced by helics::CoreKeeper::forceTerminate().
const std::string & helics::CoreApp::getAddress | ( | ) | const |
get the network address of the core
|
inline |
get a copy of the core pointer
Referenced by helics::make_cloning_filter(), and helics::make_filter().
const std::string & helics::CoreApp::getIdentifier | ( | ) | const |
get the identifier of the core
const std::string & helics::CoreApp::getTag | ( | std::string_view | tag | ) | const |
get the value of a specific tag (key-value pair) for a core
the tag is an arbitrary user defined string and value; the tags for a core are queryable
tag | the name of the tag to get the value for |
References helics::gLocalCoreId().
void helics::CoreApp::globalError | ( | int32_t | errorCode, |
std::string_view | errorString | ||
) |
generate a global error on a core
References helics::gLocalCoreId().
void helics::CoreApp::haltInit | ( | ) |
tell the core to pause init even if otherwise ready
References helics::gLocalCoreId(), and HELICS_FLAG_DELAY_INIT_ENTRY.
bool helics::CoreApp::isConnected | ( | ) | const |
check if the Core is running
Referenced by helics::CoreKeeper::isConnected(), and helics::CoreKeeper::~CoreKeeper().
bool helics::CoreApp::isOpenToNewFederates | ( | ) | const |
check if the broker is ready to accept new federates or cores
void helics::CoreApp::linkEndpoints | ( | std::string_view | source, |
std::string_view | target | ||
) |
link two endpoints together with source and destination
void helics::CoreApp::makeConnections | ( | const std::string & | file | ) |
make connections from a core using a file
std::string helics::CoreApp::query | ( | std::string_view | target, |
std::string_view | queryStr, | ||
HelicsSequencingModes | mode = HELICS_SEQUENCING_MODE_FAST |
||
) |
make a query at the core
target | the target of the query "federation", "parent", "core","broker" or a specific named object |
queryStr | the query to make |
mode | defaults to fast (asynchronous) meaning the query goes into priority channels, ordered (synchronous) means slower queries but has more ordering guarantees |
make a query at the core
References helics::generateJsonErrorResponse().
void helics::CoreApp::reset | ( | ) |
reset the app to default state
void helics::CoreApp::sendCommand | ( | std::string_view | target, |
std::string_view | commandStr, | ||
HelicsSequencingModes | mode = HELICS_SEQUENCING_MODE_FAST |
||
) |
send a command to a specific target
the format is somewhat unspecified; target is the name of an object, typically one of "federation", "broker", "core", or the name of a specific object/core/broker
target | the specific target of the command |
commandStr | the actual command |
mode | defaults to fast (asynchronous) meaning the command goes into priority channels, ordered (synchronous) means slower commands but has more ordering guarantees |
void helics::CoreApp::setGlobal | ( | std::string_view | valueName, |
std::string_view | value = "true" |
||
) |
set a federation global value
this overwrites any previous value for this name globals can be queried with a target of "global" or "global_value" and queryStr of the value to Query
valueName | the name of the global to set |
value | the value of the global |
void helics::CoreApp::setLogFile | ( | std::string_view | logFile | ) |
set the log file to use for the core
void helics::CoreApp::setLoggingLevel | ( | int | loglevel | ) |
set the minimum log level to use in the core
void helics::CoreApp::setReadyToInit | ( | ) |
tell the core that is ready to enter initialization mode
void helics::CoreApp::setTag | ( | std::string_view | tag, |
std::string_view | value = "true" |
||
) |
set a tag (key-value pair) for a core
the tag is an arbitrary user defined string and value; the tags for a core are queryable through a "tags" query or "tag/<tagname>"
tag | the name of the tag to set the value for |
value | the value for the given tag |
References helics::gLocalCoreId().
bool helics::CoreApp::waitForDisconnect | ( | std::chrono::milliseconds | waitTime = std::chrono::milliseconds(0) | ) |
wait for the core to normally disconnect for a certain amount of time
Referenced by helics::CoreKeeper::~CoreKeeper().