API Documentation

Host

The Host API provides access to runtime information about the local machine. The API allows applications to monitor the system status, CPU utilization, and to ensure correct runtime configurations prior to recording data.

Usage #include <PolySyncHost.hpp>

Host

The Host class is used for retrieving stateful information about the current host machine.

Host::getInterfaceAddressString ( … )

This will get the interface address of the hardware network interface card. Possible values are valid IP addresses with the format “X.X.X.X.,” or the string “AUTO.”

Parameters
in/out type name description
in ps_node_ref ps_node_ref If input is not NULL, then it returns the interface address for a given node reference. If input is NULL (default), then the address string will represent the system environment.
Returns
  • std::string - The host interface address, as seen by the low-level configuration environment
Exceptions
  • DTCException - If PolySync call returns failure DTC
    • DTC_ENVERR - If failed to read the host’s environment
    • DTC_UNAVAILABLE - If failed to open/read the persistent storage file

Host::getCPUCount ( )

Deprecated: Use getCpuCount() instead.

Returns
  • ulong - The host’s cpu count.
Exceptions
  • DTCException - If PolySync call returns failure DTC

Host::getCpuCount ( ) const

This will get the number of CPUs on the host machine.

Returns
  • ulong - CPU count
Exceptions
  • DTCException - If PolySync call returns failure DTC

Host::getCPULoad ( … )

Deprecated: Use getCpuLoad() instead.

Parameters
in/out type name description
in ps_timestamp timeInterval Interval of time over which to measure CPU load average.
Returns
  • double - The host CPU load average over a given time interval
Exceptions
  • DTCException - If PolySync call returns failure DTC

Host::getCpuLoad ( … ) const

This will get the CPU load average over a given time interval.

Parameters
in/out type name description
in ps_timestamp timeInterval Interval of time over which to measure CPU load average.
Returns
  • double - CPU load average.
Exceptions
  • DTCException - If PolySync call returns failure DTC

Host::getManagerPID ( ) const

Deprecated: Use getManagerPid() instead.

This will get the process ID of the PolySync manager service, if it is active on the host.

Returns
Exceptions
  • DTCException - If PolySync call returns failure DTC
    • DTC_UNAVAILABLE - If file does not exist or PID is not valid
    • DTC_NOPERM - If user does not have permissions to signal the PID

Host::getManagerPid ( ) const

This will get the process ID of the PolySync manager service if it is active on the host.

Returns
Exceptions
  • DTCException - If PolySync call returns failure DTC
    • DTC_UNAVAILABLE - If file does not exist or PID is not valid
    • DTC_NOPERM - If user does not have permissions to signal the PID

Host::getPTPPID ( )

Deprecated: Use getPtpPid() instead.

This will get the process ID of the PolySync PTP service, if active on host.

Returns
Exceptions
  • DTCException - If PolySync call returns failure DTC
    • DTC_UNAVAILABLE - If file does not exist or PID is not valid
    • DTC_NOPERM - If user does not have permissions to signal the PID

Host::getPtpPid ( ) const

This will get the process ID of the PolySync PTP service, if active on host.

Returns
Exceptions
  • DTCException - If PolySync call returns failure DTC
    • DTC_UNAVAILABLE - If file does not exist or PID is not valid
    • DTC_NOPERM - If user does not have permissions to signal the PID