Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  22 Oct 2022, Lars Martin, Suggestion, read_only odbxx? 
    Reply  24 Oct 2022, Stefan Ritt, Suggestion, read_only odbxx? 
       Reply  26 Oct 2022, Lars Martin, Suggestion, read_only odbxx? 
          Reply  29 Oct 2022, Stefan Ritt, Suggestion, read_only odbxx? 
Message ID: 2443     Entry time: 24 Oct 2022     In reply to: 2441     Reply to this: 2444
Author: Stefan Ritt 
Topic: Suggestion 
Subject: read_only odbxx? 
> I really like the concept of the odbxx interface.
> I think it would be a nice feature if one could have a read_only connection, e.g. by declaring a "const midas::odb".
> Just for fun I tried if this already works, but the compiler doesn't allow const midas::odb for e.g. the [] operator. I'm guessing this would be non-trivial to implement, but I like the idea of certain Midas clients being able to read the odb without risking corruption.

Having a "const midas::odb" probably does not work (at least I would not know how to implement that).

But I could make an internal flag analog to the auto refresh flags. So you would have

    o.set_write_protect(true);

to turn on write protection. Would that work for you?

Best,
Stefan
ELOG V3.1.4-2e1708b5