| helics 3.6.1

Functions
Publication functions

## Functions
HelicsBool | helicsPublicationIsValid (HelicsPublication pub)
void | helicsPublicationPublishBytes (HelicsPublication pub, const void *data, int inputDataLength, HelicsError *err)
void | helicsPublicationPublishString (HelicsPublication pub, const char *val, HelicsError *err)
void | helicsPublicationPublishInteger (HelicsPublication pub, int64_t val, HelicsError *err)
void | helicsPublicationPublishBoolean (HelicsPublication pub, HelicsBool val, HelicsError *err)
void | helicsPublicationPublishDouble (HelicsPublication pub, double val, HelicsError *err)
void | helicsPublicationPublishTime (HelicsPublication pub, HelicsTime val, HelicsError *err)
void | helicsPublicationPublishChar (HelicsPublication pub, char val, HelicsError *err)
void | helicsPublicationPublishComplex (HelicsPublication pub, double real, double imag, HelicsError *err)
void | helicsPublicationPublishVector (HelicsPublication pub, const double *vectorInput, int vectorLength, HelicsError *err)
void | helicsPublicationPublishComplexVector (HelicsPublication pub, const double *vectorInput, int vectorLength, HelicsError *err)
void | helicsPublicationPublishNamedPoint (HelicsPublication pub, const char *field, double val, HelicsError *err)
void | helicsPublicationPublishDataBuffer (HelicsPublication pub, HelicsDataBuffer buffer, HelicsError *err)
void | helicsPublicationAddTarget (HelicsPublication pub, const char *target, HelicsError *err)
HelicsBool | helicsInputIsValid (HelicsInput ipt)
void | helicsInputAddTarget (HelicsInput ipt, const char *target, HelicsError *err)

## Detailed Description

Functions for publishing data of various kinds. The data will get translated to the type specified when the publication was constructed automatically regardless of the function used to publish the data.

## Function Documentation

## ◆ helicsInputAddTarget()

void helicsInputAddTarget | ( | HelicsInput | ipt,
|  | const char * | target,
|  | HelicsError * | err
| ) |  |

Add a publication to the list of data that an input subscribes to.

Parameters

  | ipt | The named input to modify.
  | target | The name of a publication that an input should subscribe to.
  [in,out] | err | A pointer to an error object for catching errors.

Referenced by helicscpp::Input::addTarget().

## ◆ helicsInputIsValid()

HelicsBool helicsInputIsValid | ( | HelicsInput | ipt | ) |

Check if an input is valid.

Parameters

  ipt | The input to check.

Returns
  HELICS_TRUE if the Input object represents a valid input.

References HELICS_FALSE, and HELICS_TRUE.

Referenced by helicscpp::Input::isValid().

## ◆ helicsPublicationAddTarget()

void helicsPublicationAddTarget | ( | HelicsPublication | pub,
|  | const char * | target,
|  | HelicsError * | err
| ) |  |

Add a named input to the list of targets a publication publishes to.

Parameters

  | pub | The publication to add the target for.
  | target | The name of an input that the data should be sent to.
  [in,out] | err | A pointer to an error object for catching errors.

## ◆ helicsPublicationIsValid()

HelicsBool helicsPublicationIsValid | ( | HelicsPublication | pub | ) |

Check if a publication is valid.

Parameters

  pub | The publication to check.

Returns
  HELICS_TRUE if the publication is a valid publication.

References HELICS_FALSE, and HELICS_TRUE.

Referenced by helicscpp::Publication::isValid().

## ◆ helicsPublicationPublishBoolean()

void helicsPublicationPublishBoolean | ( | HelicsPublication | pub,
|  | HelicsBool | val,
|  | HelicsError * | err
| ) |  |

Publish a Boolean Value.

Parameters

  | pub | The publication to publish for.
  | val | The boolean value to publish.
  [in,out] | err | A pointer to an error object for catching errors.

References HELICS_FALSE.

Referenced by helicscpp::Publication::publish().

## ◆ helicsPublicationPublishBytes()

void helicsPublicationPublishBytes | ( | HelicsPublication | pub,
|  | const void * | data,
|  | int | inputDataLength,
|  | HelicsError * | err
| ) |  |

Publish raw data from a char * and length.

Parameters

  | pub | The publication to publish for.
  | data | A pointer to the raw data.
  | inputDataLength | The size in bytes of the data to publish.
  [in,out] | err | A pointer to an error object for catching errors.

Referenced by helicscpp::Publication::publish().

## ◆ helicsPublicationPublishChar()

void helicsPublicationPublishChar | ( | HelicsPublication | pub,
|  | char | val,
|  | HelicsError * | err
| ) |  |

Publish a single character.

Parameters

  | pub | The publication to publish for.
  | val | The numerical value to publish.
  [in,out] | err | A pointer to an error object for catching errors.

## ◆ helicsPublicationPublishComplex()

void helicsPublicationPublishComplex | ( | HelicsPublication | pub,
|  | double | real,
|  | double | imag,
|  | HelicsError * | err
| ) |  |

Publish a complex value (or pair of values).

Parameters

  | pub | The publication to publish for.
  | real | The real part of a complex number to publish.
  | imag | The imaginary part of a complex number to publish.
  [in,out] | err | A pointer to an error object for catching errors.

Referenced by helicscpp::Publication::publish().

## ◆ helicsPublicationPublishComplexVector()

void helicsPublicationPublishComplexVector | ( | HelicsPublication | pub,
|  | const double * | vectorInput,
|  | int | vectorLength,
|  | HelicsError * | err
| ) |  |

Publish a vector of complex doubles.

Parameters

  | pub | The publication to publish for.
  | vectorInput | A pointer to an array of complex double data (alternating real and imaginary values).
  | vectorLength | The number of values to publish; vectorInput must contain 2xvectorLength values.
  [in,out] | err | A pointer to an error object for catching errors.

Referenced by helicscpp::Publication::publish(), and helicscpp::Publication::publishComplex().

## ◆ helicsPublicationPublishDataBuffer()

void helicsPublicationPublishDataBuffer | ( | HelicsPublication | pub,
|  | HelicsDataBuffer | buffer,
|  | HelicsError * | err
| ) |  |

Publish the contents of a helicsDataBuffer.

Parameters

  | pub | The publication to publish for.
  | buffer | a HelicsDataBuffer object containing the data to publish
  [in,out] | err | A pointer to an error object for catching errors.

References helics::valueExtract().

Referenced by helicscpp::Publication::publish().

## ◆ helicsPublicationPublishDouble()

void helicsPublicationPublishDouble | ( | HelicsPublication | pub,
|  | double | val,
|  | HelicsError * | err
| ) |  |

Publish a double floating point value.

Parameters

  | pub | The publication to publish for.
  | val | The numerical value to publish.
  [in,out] | err | A pointer to an error object for catching errors.

Referenced by helicscpp::Publication::publish().

## ◆ helicsPublicationPublishInteger()

void helicsPublicationPublishInteger | ( | HelicsPublication | pub,
|  | int64_t | val,
|  | HelicsError * | err
| ) |  |

Publish an integer value.

Parameters

  | pub | The publication to publish for.
  | val | The numerical value to publish.
  [in,out] | err | A pointer to an error object for catching errors.

Referenced by helicscpp::Publication::publish().

## ◆ helicsPublicationPublishNamedPoint()

void helicsPublicationPublishNamedPoint | ( | HelicsPublication | pub,
|  | const char * | field,
|  | double | val,
|  | HelicsError * | err
| ) |  |

Publish a named point.

Parameters

  | pub | The publication to publish for.
  | field | A null terminated string for the field name of the namedPoint to publish.
  | val | A double for the value to publish.
  [in,out] | err | A pointer to an error object for catching errors.

Referenced by helicscpp::Publication::publish().

## ◆ helicsPublicationPublishString()

void helicsPublicationPublishString | ( | HelicsPublication | pub,
|  | const char * | val,
|  | HelicsError * | err
| ) |  |

Publish a string.

Parameters

  | pub | The publication to publish for.
  | val | The null terminated string to publish.
  [in,out] | err | A pointer to an error object for catching errors.

Referenced by helicscpp::Publication::publish().

## ◆ helicsPublicationPublishTime()

void helicsPublicationPublishTime | ( | HelicsPublication | pub,
|  | HelicsTime | val,
|  | HelicsError * | err
| ) |  |

Publish a time value.

Parameters

  | pub | The publication to publish for.
  | val | The numerical value to publish.
  [in,out] | err | A pointer to an error object for catching errors.

## ◆ helicsPublicationPublishVector()

void helicsPublicationPublishVector | ( | HelicsPublication | pub,
|  | const double * | vectorInput,
|  | int | vectorLength,
|  | HelicsError * | err
| ) |  |

Publish a vector of doubles.

Parameters

  | pub | The publication to publish for.
  | vectorInput | A pointer to an array of double data.
  | vectorLength | The number of points to publish.
  [in,out] | err | A pointer to an error object for catching errors.

Referenced by helicscpp::Publication::publish().