AstraLog-HPC
Loading...
Searching...
No Matches
astralog Namespace Reference

Classes

class  AstraLogError
 Base class for every AstraLog-HPC error. More...
 
class  ClusterError
 An SSH, SCP, or SLURM operation against the cluster failed. More...
 
class  ConfigError
 A configuration file or required environment variable is missing or invalid. More...
 
class  IoError
 A file could not be opened, read, or written. More...
 
class  ParseError
 A JSON or YAML document could not be parsed. More...
 
class  RuleError
 A rule definition references an unknown type or is otherwise malformed. More...
 
class  ValidationError
 An incoming telemetry packet violates the expected schema. More...
 

Functions

size_t countSensors (const std::string &sensors_path)
 Counts the sensors declared in a sensors.yaml configuration file.
 
std::vector< std::string > loadSensorIds (const std::string &sensors_path)
 Reads the sensor IDs listed in a sensors.yaml configuration file.
 
std::ifstream openInputFile (const std::string &path, const std::string &what="file", std::ios::openmode mode=std::ios::in)
 Opens an input file stream or throws on failure.
 

Function Documentation

◆ countSensors()

size_t astralog::countSensors ( const std::string &  sensors_path)

Counts the sensors declared in a sensors.yaml configuration file.

Parameters
sensors_pathPath to the sensors.yaml file.
Returns
The number of sensor entries found.
Exceptions
astralog::IoErrorIf the file cannot be opened.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadSensorIds()

std::vector< std::string > astralog::loadSensorIds ( const std::string &  sensors_path)

Reads the sensor IDs listed in a sensors.yaml configuration file.

Parameters
sensors_pathPath to the sensors.yaml file.
Returns
A vector of sensor ID strings in document order.
Exceptions
astralog::IoErrorIf the file cannot be opened.
Here is the call graph for this function:

◆ openInputFile()

std::ifstream astralog::openInputFile ( const std::string &  path,
const std::string &  what = "file",
std::ios::openmode  mode = std::ios::in 
)
inline

Opens an input file stream or throws on failure.

Parameters
pathThe path of the file to open.
whatA short description of the file, used in the error message (e.g. "sensors file", "rules file").
modeThe open mode (defaults to text input).
Returns
An open std::ifstream positioned at the start of the file.
Exceptions
astralog::IoErrorIf the file cannot be opened.
Here is the caller graph for this function: