Kanzi Connect  3.9.9
Kanzi Connect C++ API
kanzi::connect::ContentProviderCollection Class Reference

A content provider type, that hosts other Content Providers. More...

#include <content_provider_collection.hpp>

Inheritance diagram for kanzi::connect::ContentProviderCollection:
kanzi::connect::ContentProvider kanzi::connect::ContentProvider::Observer

Public Types

typedef vector< ContentProviderSharedPtrContentProviderContainer
 Container for content providers. Used to store child providers. More...
 

Public Member Functions

void addContentProvider (ContentProviderSharedPtr provider, bool invalidate=true)
 Adds content provider to collection. More...
 
ContentProviderContainer::const_iterator beginProviders () const
 Allows to iterate all contained providers. More...
 
 ContentProviderCollection (WorkQueueInterface *workQueue, AbstractServiceSharedPtr owningService)
 Constructor. More...
 
ContentProviderContainer::const_iterator endProviders () const
 Allows to iterate all contained providers. More...
 
virtual size_t getSubProviderCount () override
 
virtual ContentProviderDescriptionSharedPtr getSubProviderDescription (size_t index) override
 
virtual void query (ContentQueryArgumentsSharedPtr args, ContentQuerySharedPtr contentQuery) override
 
void removeContentProvider (ContentProviderSharedPtr provider, bool invalidate=true)
 Removes content provider from this collection. More...
 
virtual ~ContentProviderCollection ()
 
- Public Member Functions inherited from kanzi::connect::ContentProvider
void addObserver (Observer *observer)
 Adds new observer for this instance. More...
 
void addSubscription (ContentSubscriptionSharedPtr subscription)
 Adds new subscription to this instance. More...
 
 ContentProvider (WorkQueueInterface *workQueue, AbstractServiceSharedPtr owningService)
 Constructor. More...
 
 ContentProvider (WorkQueueInterface *workQueue)
 Constructor. More...
 
vector< ContentSubscriptionSharedPtrgetAllSubscriptions () const
 Retrieves all subscriptions for this provider. More...
 
AbstractServiceSharedPtr getOwningService ()
 Retrieves the service this content provider is bound to. More...
 
AbstractSessionSharedPtr getOwningSession () const
 Retrieve the session that owns this content provider. More...
 
const string & getSchema () const
 Retrieve the Schema. More...
 
ContentSubscriptionSharedPtr getSubscription (shared_ptr< ContentServiceConcept::Session > session) const
 Retrieves content subscription for given session. More...
 
const string & getUri () const
 Retrieve the URI. More...
 
bool hasSchema () const
 Determines whether this particular content provider has schema defined. More...
 
virtual void initialize ()
 Called by the Content Service. Initializes this instance. More...
 
void invalidate (const string &uri, int reason, int beginRow=0, int endRow=-1)
 Invalidates the content and causes subscribed clients to refresh their data completely. More...
 
void invalidateEx (const string &uri, int reason, int beginRow=0, int endRow=-1)
 Invalidates the content and causes subscribed clients to refresh their data completely. More...
 
void notifyChangedEx (const string &uri=string())
 Informs that specific URI is changed. More...
 
void releaseAllSubscriptions ()
 Releases all subscriptions from this instance. More...
 
void removeObserver (Observer *observer)
 Removes observer from this instance. More...
 
void removeSubscription (const ContentSubscription &subscription)
 Removes subscription from this instance. More...
 
void setOwningService (AbstractServiceSharedPtr service)
 Sets the owning service. More...
 
void setOwningSession (AbstractSessionSharedPtr session)
 Store the owning session. More...
 
void setSchema (const string &schema)
 Save the Schema (xml). More...
 
void setUri (const string &uri)
 Save the URI. More...
 
virtual void uninitialize ()
 Called by the Content Service. Un-initializes this instance. More...
 
virtual void work ()
 Called by the Content Service. Allows this instance to perform work such as push data from external threads to content system or procedurally generate data. More...
 
virtual ~ContentProvider ()
 Destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from kanzi::connect::ContentProvider
void notifyChanged (const string &uri=string(), bool processAsync=false)
 Allows derived classes to notify that there are changes in content. More...
 
void notifyWork ()
 Allows derived classes to notify that there is work to be done. More...
 

Detailed Description

A content provider type, that hosts other Content Providers.

Makes it possible to attach / detach content providers in to content database. Whenever this class receives a query, it automatically propagates it to all contained Content Providers and merges their results as one.

Member Typedef Documentation

◆ ContentProviderContainer

Container for content providers. Used to store child providers.

Constructor & Destructor Documentation

◆ ContentProviderCollection()

kanzi::connect::ContentProviderCollection::ContentProviderCollection ( WorkQueueInterface workQueue,
AbstractServiceSharedPtr  owningService 
)

Constructor.

◆ ~ContentProviderCollection()

virtual kanzi::connect::ContentProviderCollection::~ContentProviderCollection ( )
virtual

Member Function Documentation

◆ addContentProvider()

void kanzi::connect::ContentProviderCollection::addContentProvider ( ContentProviderSharedPtr  provider,
bool  invalidate = true 
)

Adds content provider to collection.

Parameters
providerContent provider to add.
invalidateIf true, invalidates the whole collection. If false, does nothing.

◆ beginProviders()

ContentProviderContainer::const_iterator kanzi::connect::ContentProviderCollection::beginProviders ( ) const

Allows to iterate all contained providers.

Returns
The beginning of the container.

◆ endProviders()

ContentProviderContainer::const_iterator kanzi::connect::ContentProviderCollection::endProviders ( ) const

Allows to iterate all contained providers.

Returns
The end of the container.

◆ getSubProviderCount()

virtual size_t kanzi::connect::ContentProviderCollection::getSubProviderCount ( )
overridevirtual

◆ getSubProviderDescription()

virtual ContentProviderDescriptionSharedPtr kanzi::connect::ContentProviderCollection::getSubProviderDescription ( size_t  index)
overridevirtual

◆ query()

virtual void kanzi::connect::ContentProviderCollection::query ( ContentQueryArgumentsSharedPtr  args,
ContentQuerySharedPtr  contentQuery 
)
overridevirtual

◆ removeContentProvider()

void kanzi::connect::ContentProviderCollection::removeContentProvider ( ContentProviderSharedPtr  provider,
bool  invalidate = true 
)

Removes content provider from this collection.

Parameters
providerContent provider to remove.
invalidateIf true, invalidates the whole collection. If false, does nothing.

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