Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  12 May 2020, Stefan Ritt, Info, New ODB++ API odbxx_test.cxx
    Reply  20 May 2020, Konstantin Olchanski, Info, New ODB++ API 
    Reply  20 May 2020, Stefan Ritt, Info, New ODB++ API odbxx_test.cxx
    Reply  20 May 2020, Pintaudi Giorgio, Info, New ODB++ API 
       Reply  20 May 2020, Konstantin Olchanski, Info, New ODB++ API 
Message ID: 1914     Entry time: 20 May 2020     In reply to: 1906
Author: Stefan Ritt 
Topic: Info 
Subject: New ODB++ API 
In meanwhile, there have been minor changes and improvements to the API:

Previously, we had:

>    midas::odb o;
>    o.connect("/Test/Settings", true);   // this creates /Test/Settings
>    o.set_auto_create(true);            // this turns on auto-creation
>    o["Int32 Key"] = 1;                 // create all these keys with different types
>    o["Double Key"] = 1.23;
>    o["String Key"] = "Hello";

Now, we only need:

      o.connect("/Test/Settings");
      o["Int32 Key"] = 1;                 // create all these keys with different types
      ...

no "true" needed any more. If the ODB tree does not exist, it gets created. Similarly, set_auto_create() can be dropped, it's on by default (thought this makes more sense). Also the iteration over subkeys has 
been changed slightly.

The full example attached has been updated accordingly. 

Best,
Stefan
Attachment 1: odbxx_test.cxx  4 kB  Uploaded 20 May 2020  | Show | Show all
ELOG V3.1.4-2e1708b5