most efficient way to keep in sync with configuration data ?

Stephan Bergmann sbergman at redhat.com
Thu Aug 30 04:47:17 PDT 2012


On 08/30/2012 01:09 PM, Caolán McNamara wrote:
> What's the most efficient way to repeatedly get an up-to-date
> configuration value ?
>
> Just do
> sal_Int32 nFoo = officecfg::Office::Writer::Foo::get();
> every time you need Foo, or request Foo once and register some listener
> of some kind on Foo modifications ?

Which is more efficient overall depends on whether there will be more 
instances where your code wants to obtain the value or more instances of 
other code modifying it.  I would go with the simple approach of reading 
the value afresh whenever needed.

Stephan


More information about the LibreOffice mailing list