![]() |
helics
2.8.1
|
#include <Publications.hpp>
Public Member Functions | |
Publication (ValueFederate *valueFed, interface_handle id, const std::string &key, const std::string &type, const std::string &units) | |
Publication (ValueFederate *valueFed, const std::string &key, const std::string &type, const std::string &units=std::string()) | |
template<class FedPtr > | |
Publication (FedPtr valueFed, const std::string &key, const std::string &type=std::string(), const std::string &units=std::string()) | |
Publication (interface_visibility locality, ValueFederate *valueFed, const std::string &key, const std::string &type, const std::string &units=std::string()) | |
template<class FedPtr > | |
Publication (interface_visibility locality, FedPtr &valueFed, const std::string &key, const std::string &type, const std::string &units=std::string()) | |
Publication (ValueFederate *valueFed, const std::string &key, data_type type, const std::string &units=std::string()) | |
template<class FedPtr > | |
Publication (FedPtr &valueFed, const std::string &key, data_type type, const std::string &units=std::string()) | |
Publication (interface_visibility locality, ValueFederate *valueFed, const std::string &key, data_type type, const std::string &units=std::string()) | |
template<class FedPtr > | |
Publication (interface_visibility locality, FedPtr &valueFed, const std::string &key, data_type type, const std::string &units=std::string()) | |
interface_handle | getHandle () const |
operator interface_handle () const | |
bool | isValid () const |
bool | operator== (const Publication &pub) const |
bool | operator!= (const Publication &pub) const |
bool | operator< (const Publication &pub) const |
const std::string & | getKey () const |
const std::string & | getName () const |
const std::string & | getType () const |
const std::string & | getUnits () 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 | addTarget (const std::string &target) |
void | removeTarget (const std::string &targetToRemove) |
void | close () |
void | publish (double val) |
void | publish (const char *val) |
void | publish (const std::string &val) |
void | publish (const std::vector< double > &val) |
void | publish (const std::vector< std::complex< double >> &val) |
void | publish (const double *vals, int size) |
void | publish (std::complex< double > val) |
void | publish (const defV &val) |
void | publish (bool val) |
void | publish (Time val) |
void | publish (char val) |
void | publish (const NamedPoint &np) |
void | publish (const std::string &name, double val) |
void | publish (const char *name, double val) |
void | publish (double val, const std::string &units) |
void | publish (double val, const units::precise_unit &units) |
template<class X > | |
std::enable_if_t<(std::is_integral< X >::value &&!std::is_same< remove_cv_ref< X >, char >::value), void > | publish (X val) |
template<class X > | |
std::enable_if_t<((typeCategory< X >::value==nonConvertibleType) &&(!std::is_convertible< X, std::string >::value) &&(!std::is_same< X, defV >::value) &&(!std::is_convertible< X, Time >::value)), void > | publish (const X &val) |
void | setMinimumChange (double deltaV) noexcept |
void | enableChangeDetection (bool enabled=true) noexcept |
Protected Attributes | |
ValueFederate * | fed {nullptr} |
the federate construct to interact with | |
interface_handle | handle |
the internal id of the publication | |
data_type | pubType {data_type::helics_any} |
the type of publication | |
bool | changeDetectionEnabled {false} |
the change detection is enabled | |
bool | disableAssign {false} |
disable assignment for the object | |
Friends | |
class | ValueFederateManager |
define a publication object in the C++98 interface
helics::Publication::Publication | ( | ValueFederate * | valueFed, |
interface_handle | id, | ||
const std::string & | key, | ||
const std::string & | type, | ||
const std::string & | units | ||
) |
constructor for a publication used by the valueFederateManager
valueFed | a pointer the link valueFederate |
id | the interface_handle from the core |
key | the identifier for the publication |
type | the type of the publication |
units | an optional string defining the units |
References helics::getTypeFromString(), and pubType.
helics::Publication::Publication | ( | ValueFederate * | valueFed, |
const std::string & | key, | ||
const std::string & | type, | ||
const std::string & | units = std::string() |
||
) |
constructor for a publication
valueFed | a pointer the link valueFederate |
key | the identifier for the publication |
type | the type of the publication |
units | an optional string defining the units |
References helics::ValueFederate::getPublication(), and helics::ValueFederate::registerPublication().
|
inline |
base constructor for a publication
valueFed | a pointer of some kind to a value federate (any dereferenceable type with * and -> operator that results in a valueFederate object |
key | the identifier for the publication |
type | the type of the publication |
units | an optional string defining the units |
helics::Publication::Publication | ( | interface_visibility | locality, |
ValueFederate * | valueFed, | ||
const std::string & | key, | ||
const std::string & | type, | ||
const std::string & | units = std::string() |
||
) |
base constructor for a publication
locality | either GLOBAL or LOCAL, LOCAL prepends the federate name to create a global identifier |
valueFed | a pointer to a value federate |
key | the identifier for the publication |
type | the type of the publication |
units | an optional string defining the units |
|
inline |
base constructor for a publication
locality | either GLOBAL or LOCAL, LOCAL prepends the federate name to create a global identifier |
valueFed | a pointer of some kind to a value federate (any dereferenceable type with * and -> operator that results in a valueFederate object |
key | the identifier for the publication |
type | the type of the publication |
units | an optional string defining the units |
|
inline |
constructor to build a publication object
valueFed | the ValueFederate to use |
key | the identifier for the publication |
type | the defined type of the publication |
units | the units associated with a Federate |
|
inline |
constructor to build a publication object
valueFed | the ValueFederate to use |
key | the identifier for the publication |
type | the defined type of the publication |
units | the units associated with a Federate |
|
inline |
constructor to build a publication object
locality | set to global for a global publication or local for a local one |
valueFed | the ValueFederate to use |
key | the identifier for the publication |
type | the defined type of the publication |
units | the units associated with a Federate |
|
inline |
constructor to build a publication object
locality | set to global for a global publication or local for a local one |
valueFed | the ValueFederate to use |
key | the identifier for the publication |
type | the defined type of the publication |
units | the units associated with a Federate |
|
inline |
add a target to the publication
References fed.
|
inline |
close a input during an active simulation
it is not necessary to call this function unless you are continuing the simulation after the close
References fed.
|
inlinenoexcept |
if set to false, the change detection mechanisms are not enabled if set to true the values will be published if there is sufficient change as specified in the call to setMinimumChange
|
inline |
get the publication id that can be used to make the function calls from a Value Federate
|
inline |
get the interface information field of the publication
References fed.
|
inline |
get the key for the publication
References fed.
|
inline |
get the key for the publication
|
inline |
get the current value of a flag for the handle
References fed.
|
inline |
get the type for the publication
References fed.
|
inline |
get the units of the publication
|
inline |
check if the Publication links to a valid operation
Referenced by helics::ValueFederateManager::addAlias().
|
inline |
implicit conversion operator for extracting the handle
|
inline |
publish anything not previously covered
void helics::Publication::publish | ( | double | val | ) |
send a value for publication
val | the value to publish |
References helics::changeDetected(), changeDetectionEnabled, fed, helics::ValueFederate::publishRaw(), pubType, and helics::typeConvert().
Referenced by publish(), helics::PublicationT< X >::publish(), and helics::ValueFederate::publish().
void helics::Publication::publish | ( | double | val, |
const std::string & | units | ||
) |
secondary publish function to allow unit conversion before publication
val | the value to publish |
units | the units association with the publication |
References publish().
|
inline |
publish integral values
|
inline |
remove a named input from sending data
References fed.
|
inline |
set the interface information field of the publication
References fed.
|
inlinenoexcept |
set the level by which a value must have changed to actually publish the value
|
inline |
set an option on the publication
option | the option to set |
value | the value to set the option |
References fed.