Boost logo

Boost Users :

Subject: [Boost-users] Multiple instance of options
From: Ulf Samuelsson (boost-user_at_[hidden])
Date: 2013-09-18 12:28:07


Need to parse an "ini" file which configures one or more sensors.

The sensors can be of the same type and are identified by
"name", "type" and an "id"

Some configuration items are for all sensors
Other configuration tiems are only for some sensors.

[sensor]
     SensorName="Outdoor Temp"
     SensorType=1 # Temp Sensor
     SensorID=1000
     SerialNumber="12344"
     Active=1
     Device="/dev/ttyUSB01"

[sensor]
     SensorName="Indoor Temp"
     SensorType=1 # Temp Sensor
     SensorID=1001
     SerialNumber="12345"
     Active=1
     Device="/dev/USB02"

[sensor]
     SensorName="Light"
     SensorType=2 # Light Sensor
     SensorID=1002
     SerialNumber="12349"
     Active=1
     Device="/dev/ttyUSB02"
     MaxLumen="500"

Is having multiple identical section names possible with boost program
options?

It is of course possible to do

[sensor_1]
...
[sensor_2]
...
[sensor_3]
...

but that is not so nice looking,
and you get a hard limit on the number
of sensors you can attach.

Ideas?

BR
Ulf Samuelsson


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net