helics  3.5.2
Public Member Functions | Public Attributes | List of all members
helics::FederateInfo Class Reference

#include <FederateInfo.hpp>

+ Inheritance diagram for helics::FederateInfo:

Public Member Functions

 FederateInfo ()
 
 FederateInfo (CoreType cType)
 
 FederateInfo (const std::string &args)
 
 FederateInfo (int argc, char *argv[])
 
 FederateInfo (std::vector< std::string > &args)
 
std::vector< std::string > loadInfoFromArgs (const std::string &args)
 
std::vector< std::string > loadInfoFromArgs (int argc, char *argv[])
 
void loadInfoFromArgs (std::vector< std::string > &args)
 
void loadInfoFromArgsIgnoreOutput (const std::string &args)
 
void loadInfoFromArgsIgnoreOutput (int argc, char *argv[])
 
void loadInfoFromToml (const std::string &toml, bool runArgParser=true)
 
void loadInfoFromJson (const std::string &json, bool runArgParser=true)
 
Time checkTimeProperty (int propId, Time defVal) const
 
bool checkFlagProperty (int propId, bool defVal) const
 
int checkIntProperty (int propId, int defVal) const
 
void injectParser (CLI::App *app)
 
- Public Member Functions inherited from helics::CoreFederateInfo
void setProperty (int propId, double propVal)
 
void setProperty (int propId, int propVal)
 
void setProperty (int propId, Time propVal)
 
void setFlagOption (int flagId, bool propVal=true)
 

Public Attributes

int uniqueKey {0}
 location for keying the info for application purposes
 
char separator {'/'}
 separator for global name of localFederates
 
bool autobroker
 specify that the core should generate a broker if not found otherwise More...
 
bool debugging {false}
 
bool observer {false}
 
CoreType coreType {CoreType::DEFAULT}
 the type of the core
 
int brokerPort {-1}
 broker port information
 
bool forceNewCore {false}
 indicator that the federate should not use an existing core
 
bool useJsonSerialization {false}
 
bool encrypted {false}
 
std::string profilerFileName
 
std::string encryptionConfig
 encryption configuration string or file
 
std::string defName
 a default name to use for a federate
 
std::string coreName
 the name of the core
 
std::string coreInitString
 an initialization string for the core API object
 
std::string brokerInitString
 an initialization string for the broker if auto generated
 
std::string broker
 connection information for the broker
 
std::string key
 key for the broker
 
std::string localport
 
std::string configString
 storage for config file name or string
 
bool fileInUse {false}
 
- Public Attributes inherited from helics::CoreFederateInfo
std::vector< std::pair< int, Time > > timeProps
 container for the timeProperties
 
std::vector< std::pair< int, int > > intProps
 container for the integer properties
 
std::vector< std::pair< int, bool > > flagProps
 container for the binary flag options
 

Detailed Description

data class defining federate properties and information

Constructor & Destructor Documentation

◆ FederateInfo() [1/5]

helics::FederateInfo::FederateInfo ( )

default constructor

References loadInfoFromArgsIgnoreOutput().

◆ FederateInfo() [2/5]

helics::FederateInfo::FederateInfo ( CoreType  cType)
explicit

construct from a type

Parameters
cTypethe type of core to use for the federate

References coreType, and loadInfoFromArgsIgnoreOutput().

◆ FederateInfo() [3/5]

helics::FederateInfo::FederateInfo ( const std::string &  args)
explicit

load a federateInfo object from command line arguments in a string

calls /ref loadInfoFromArgs in the constructor

Parameters
argsa string containing the command line arguments

References loadInfoFromArgsIgnoreOutput().

◆ FederateInfo() [4/5]

helics::FederateInfo::FederateInfo ( int  argc,
char *  argv[] 
)

load a federateInfo object from command line arguments

calls /ref loadInfoFromArgs in the constructor

Parameters
argcthe number of arguments
argvan array of char * pointers to the arguments

References loadInfoFromArgsIgnoreOutput().

◆ FederateInfo() [5/5]

helics::FederateInfo::FederateInfo ( std::vector< std::string > &  args)
explicit

load a federateInfo object from arguments stored in a vector

calls /ref loadInfoFromArgs in the constructor

Parameters
[in,out]argsa vector of arguments to load. The unused arguments will be returned in the vector

References loadInfoFromArgs().

Member Function Documentation

◆ checkTimeProperty()

Time helics::FederateInfo::checkTimeProperty ( int  propId,
Time  defVal 
) const

check if a property has been set and return its value

References helics::CoreFederateInfo::timeProps.

◆ injectParser()

void helics::FederateInfo::injectParser ( CLI::App *  app)

inject the federateInfo parser into another CLI11 App

References helics::addJsonConfig().

Referenced by helics::apps::App::App().

◆ loadInfoFromArgs() [1/3]

std::vector< std::string > helics::FederateInfo::loadInfoFromArgs ( const std::string &  args)

load a federateInfo object from command line arguments outside the constructor

Parameters
argsa string containing the command line arguments
Returns
a vector of strings containing the unused arguments

Referenced by FederateInfo().

◆ loadInfoFromArgs() [2/3]

std::vector< std::string > helics::FederateInfo::loadInfoFromArgs ( int  argc,
char *  argv[] 
)

load a federateInfo object from command line arguments outside the constructor

Parameters
argcthe number of arguments
argvan array of char * pointers to the arguments
Returns
a vector of strings containing the unused arguments

◆ loadInfoFromArgs() [3/3]

void helics::FederateInfo::loadInfoFromArgs ( std::vector< std::string > &  args)

load a federateInfo object from command line arguments contained in a vector

Parameters
[in,out]argsa vector of arguments to load. The unused arguments will be returned in the vector

◆ loadInfoFromArgsIgnoreOutput() [1/2]

void helics::FederateInfo::loadInfoFromArgsIgnoreOutput ( const std::string &  args)

load a federateInfo object from command line arguments outside the constructor

Parameters
argsa string containing the command line arguments

Referenced by FederateInfo().

◆ loadInfoFromArgsIgnoreOutput() [2/2]

void helics::FederateInfo::loadInfoFromArgsIgnoreOutput ( int  argc,
char *  argv[] 
)

load a federateInfo object from command line arguments outside the constructor

Parameters
argcthe number of arguments
argvan array of char * pointers to the arguments

◆ loadInfoFromJson()

void helics::FederateInfo::loadInfoFromJson ( const std::string &  json,
bool  runArgParser = true 
)

load a federateInfo object from a JSON string either a file or JSON string

Parameters
jsona string containing the name of the JSON file or JSON contents

◆ loadInfoFromToml()

void helics::FederateInfo::loadInfoFromToml ( const std::string &  toml,
bool  runArgParser = true 
)

load a federateInfo object from a toml string either a file or toml string

Parameters
tomla string containing the name of the toml file or toml contents

References helics::CoreFederateInfo::setProperty().

Member Data Documentation

◆ autobroker

bool helics::FederateInfo::autobroker
Initial value:
{
false}

specify that the core should generate a broker if not found otherwise

Referenced by helics::generateFullCoreInitString().

◆ debugging

bool helics::FederateInfo::debugging {false}

specify that the core/federate should operate in a user debugging mode which will turn off some timeouts

Referenced by helics::generateFullCoreInitString().

◆ encrypted

bool helics::FederateInfo::encrypted {false}

specify that the core should use encryption

Referenced by helics::generateFullCoreInitString().

◆ localport

std::string helics::FederateInfo::localport

string for defining the local port to use usually a number but other strings are possible

Referenced by helics::generateFullCoreInitString().

◆ profilerFileName

std::string helics::FederateInfo::profilerFileName

specify that the federate and associated core should enable profiling to the specified file

Referenced by helics::generateFullCoreInitString().

◆ useJsonSerialization

bool helics::FederateInfo::useJsonSerialization {false}

indicate that the federate should use json serialization for all data transfers

Referenced by helics::generateFullCoreInitString().


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