-
Notifications
You must be signed in to change notification settings - Fork 83
Description
Hello,
I have history with C and relatively new to C++ and your API is a pattern I have not seen before. I have the test app working fine with the call like:
int ret = influxdb_cpp::builder() .meas("imu") .tag("track", "Home Testing") .field("ax", ax) .field("ay", ay) .field("az", az) .field("gx", gx) .field("gy", gy) .field("gz", gz) .field("yaw", yaw) .field("pitch", pitch) .field("roll", roll) .field("temperature", temperature) .field("pressure", pressure) .field("altitude", altitude) .timestamp( std::chrono::duration_cast<std::chrono::nanoseconds>(clock.now().time_since_epoch()).count() ) .post_http(si, &resp);
but I have a thread pool that handle a queue I have created. The queue contain a generic payload for more than 1 type of measures. The fields and tags are passed in as maps in the format { tag name, tag value}
So therefore I need to iterate over the map and call .field or .tag APIs.
I can't seem to figure out a calling mechanism to support this where I create the builder and then add details to it iterating over my map(s) and then calling the post_http.
Thought I would post this here for some help. In the mean time I will dig deeper to see if I can understand the way your API works.
Thanks, Jeff