XVector
xvec_config.hpp File Reference

C++ configuration management API for the XVECTOR library. More...

#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <utility>
Include dependency graph for xvec_config.hpp:

Go to the source code of this file.

Classes

class  xvec::host::ConfigManager
 Thread-safe singleton for centralized configuration management. More...
 

Namespaces

 xvec
 
 xvec::host
 

Detailed Description

C++ configuration management API for the XVECTOR library.

This header provides a C++ API for centralized configuration management. Configuration values are loaded from multiple sources with the following priority order (highest to lowest):

  1. Environment variables
  2. Default values

Supported environment variables:

  • PXL_DEVICE_ID: Device ID (uint32)
  • PXL_NUM_SUB: Number of subs (uint32)
  • PXL_TASK_COUNT: Task count (uint32)
  • XVECTOR_LOG_HOST: Host log level (0=NONE, 1=ERROR, 2=WARN, 3=INFO, 4=DEBUG, 5=TRACE; also accepts level names and true/false)
  • XVECTOR_LOG_DEVICE: Device log level (0=NONE, 1=ERROR, 2=WARN, 3=INFO, 4=DEBUG, 5=TRACE; also accepts level names and true/false)

The former NUMSUB and TASKCOUNT environment names are no longer read. Numeric settings require a complete unsigned decimal value within uint32 range. Defaults apply only when unset. Empty or malformed numeric/log values cause instance() to throw std::invalid_argument before device discovery. Contexts always use the embedded production kernel. Configuration contains no kernel path or file discovery settings.

Example usage:

uint32_t deviceId = config.getDeviceId();
static ConfigManager & instance()
Get the singleton instance.
C++ configuration management API for the XVECTOR library.

Definition in file xvec_config.hpp.