Initialize the default calendar cache with a timeout.

Synopsis

Declared in <bdlt_defaultcalendarcache.h>

static
int
initialize(
    CalendarLoader* loader,
    bsls::TimeInterval const& timeout,
    bslma::Allocator* allocator);

Description

Initialize the default CalendarCache object managed by this class to use the specified loader to obtain calendars, to have the specified timeout, and to use the specified allocator to supply memory. If the default cache is already in the initialized state, this method has no effect. Return 0 on success, and a non‐zero value otherwise. The behavior is undefined unless loader and allocator remain valid until a subsequent call to destroy, and bsls::TimeInterval() <= timeout <= bsls::TimeInterval(INT_MAX, 0). Note that a timeout value of 0 indicates that a calendar will be loaded into the default cache by each (successful) call to CalendarCache::getCalendar on the cache returned by instance.

Return Value

0 on success, and a non‐zero value otherwise

Parameters

Name

Description

loader

calendar loader used to obtain calendars

timeout

interval after which cached calendars expire

allocator

allocator used to supply memory

Created with MrDocs