LibreOffice Module framework (master) 1
Public Member Functions | Static Private Attributes | List of all members
framework::HandlerCache Class Referencefinal

#include <protocolhandlercache.hxx>

Collaboration diagram for framework::HandlerCache:
[legend]

Public Member Functions

 HandlerCache ()
 ctor of the cache of all registered protocol handler @descr It tries to open the right configuration package automatically and fill the internal structures. More...
 
 ~HandlerCache ()
 dtor of the cache @descr It frees all used memory. More...
 
bool search (const OUString &sURL, ProtocolHandler *pReturn) const
 dtor of the cache @descr It frees all used memory. More...
 
bool search (const css::util::URL &aURL, ProtocolHandler *pReturn) const
 search for a registered handler by using a URL struct @descr We combine necessary parts of this struct to a valid URL string and call our other search method ... It's a helper for outside code. More...
 
void takeOver (HandlerHash aHandler, PatternHash aPattern)
 

Static Private Attributes

static std::optional< HandlerHashs_pHandler
 list of all registered handler registered by her uno implementation names More...
 
static std::optional< PatternHashs_pPattern
 maps URL pattern to handler names More...
 
static HandlerCFGAccesss_pConfig = nullptr
 informs about config updates More...
 
static sal_Int32 m_nRefCount = 0
 ref count to construct/destruct internal member lists on demand by using singleton mechanism More...
 

Detailed Description

Definition at line 88 of file protocolhandlercache.hxx.

Constructor & Destructor Documentation

◆ HandlerCache()

framework::HandlerCache::HandlerCache ( )

ctor of the cache of all registered protocol handler @descr It tries to open the right configuration package automatically and fill the internal structures.

After that the cache can be used for read access on this data and perform some search operations on it.

Definition at line 83 of file protocolhandlercache.cxx.

References m_nRefCount, framework::PACKAGENAME_PROTOCOLHANDLER, framework::HandlerCFGAccess::read(), s_pConfig, s_pHandler, s_pPattern, and framework::HandlerCFGAccess::setCache().

◆ ~HandlerCache()

framework::HandlerCache::~HandlerCache ( )

dtor of the cache @descr It frees all used memory.

In further implementations (may if we support write access too) it's a good place to flush changes back to the configuration - but not needed yet.

Definition at line 104 of file protocolhandlercache.cxx.

References m_nRefCount, s_pConfig, s_pHandler, s_pPattern, and framework::HandlerCFGAccess::setCache().

Member Function Documentation

◆ search() [1/2]

bool framework::HandlerCache::search ( const css::util::URL &  aURL,
ProtocolHandler pReturn 
) const

search for a registered handler by using a URL struct @descr We combine necessary parts of this struct to a valid URL string and call our other search method ... It's a helper for outside code.

Definition at line 148 of file protocolhandlercache.cxx.

References aURL, and search().

◆ search() [2/2]

bool framework::HandlerCache::search ( const OUString &  sURL,
ProtocolHandler pReturn 
) const

dtor of the cache @descr It frees all used memory.

In further implementations (may if we support write access too) it's a good place to flush changes back to the configuration - but not needed yet.

Definition at line 126 of file protocolhandlercache.cxx.

References s_pPattern.

Referenced by framework::DispatchProvider::implts_searchProtocolHandler(), and search().

◆ takeOver()

void framework::HandlerCache::takeOver ( HandlerHash  aHandler,
PatternHash  aPattern 
)

Definition at line 153 of file protocolhandlercache.cxx.

References s_pHandler, and s_pPattern.

Referenced by framework::HandlerCFGAccess::Notify().

Member Data Documentation

◆ m_nRefCount

sal_Int32 framework::HandlerCache::m_nRefCount = 0
staticprivate

ref count to construct/destruct internal member lists on demand by using singleton mechanism

Definition at line 100 of file protocolhandlercache.hxx.

Referenced by HandlerCache(), and ~HandlerCache().

◆ s_pConfig

HandlerCFGAccess * framework::HandlerCache::s_pConfig = nullptr
staticprivate

informs about config updates

Definition at line 98 of file protocolhandlercache.hxx.

Referenced by HandlerCache(), and ~HandlerCache().

◆ s_pHandler

std::optional< HandlerHash > framework::HandlerCache::s_pHandler
staticprivate

list of all registered handler registered by her uno implementation names

initialize static member of class HandlerCache @descr We use a singleton pattern to implement this handler cache.

That means it use two static member list to hold all necessary information and a ref count mechanism to create/destroy it on demand.

Definition at line 94 of file protocolhandlercache.hxx.

Referenced by HandlerCache(), takeOver(), and ~HandlerCache().

◆ s_pPattern

std::optional< PatternHash > framework::HandlerCache::s_pPattern
staticprivate

maps URL pattern to handler names

Definition at line 96 of file protocolhandlercache.hxx.

Referenced by HandlerCache(), search(), takeOver(), and ~HandlerCache().


The documentation for this class was generated from the following files: