EventAnalysis  1.3.0
Public Member Functions | Private Attributes | List of all members
EA::EventDataStore Class Reference

#include <DataStore.h>

Inheritance diagram for EA::EventDataStore:
EA::DataStore EA::Info EA::ObjectMap

Public Member Functions

 EventDataStore (const std::string &name)
 
bool AddEventCache (observer_ptr< EventDataCache > cache)
 Adds a cache to the event data store. More...
 
template<class DataType >
observer_ptr< DataType > GetObject (const std::string &name)
 Provides a data object. More...
 
- Public Member Functions inherited from EA::DataStore
 DataStore (const std::string &name, ObjectCategory category)
 
template<class DataType >
void AddObject (const std::string &name, DataType &obj, const observer_ptr< ObjectProducer > &producer=nullptr)
 Adds an object to the map, storing also the producer. More...
 
template<class DataType >
void AddObject (const std::string &name, observer_ptr< DataType > obj, const observer_ptr< ObjectProducer > &producer=nullptr)
 Adds an object to the map, storing also the producer. More...
 
void AddObject (const std::string &name, const char *obj, const observer_ptr< ObjectProducer > &=nullptr)
 Adds a string literal to the map. More...
 
template<class DataType >
void AddObject (const std::string &name, std::shared_ptr< DataType > obj, const observer_ptr< ObjectProducer > &producer=nullptr)
 Adds an object to the map, storing also the producer. More...
 
template<class DataType >
void AddObject (const std::string &name, std::unique_ptr< DataType > obj, const observer_ptr< ObjectProducer > &=nullptr)
 Adds an object to the map. More...
 
void SetAlias (const std::string &objName, const std::string &objAlias)
 Set an alias for the given object. More...
 
template<class DataType >
observer_ptr< DataType > GetObject (const std::string &name)
 Provides a data object. More...
 
bool RemoveObject (const std::string &name, bool removeAliased=false)
 Removes an object or an alias from the map. More...
 
std::vector< std::string > GetObjects () const
 Returns the names of the objects in the store. More...
 
bool IsPresent (const std::string &nameOrAlias)
 Checks if an object is present in the map. More...
 
const std::vector< KnownObject > & GetKnownObjects ()
 Returns a list of all the objects that are known to the store. More...
 
std::vector< std::string > GetAliases (const std::string &name="") const
 Returns the aliases of the objects in the store. More...
 
bool Clean ()
 Removes all the objects and aliases from the store. More...
 
bool CleanAliases ()
 Removes all the aliases from the store. More...
 
bool IsAlias (const std::string &objName)
 Checks if an object name is actually an alias. More...
 
const std::string & GetNameOfAliasedObject (const std::string &aliasName)
 Gets the name of the object corresponding to an alias. More...
 
ObjectWrapper GetObjectWrapper (const std::string &objName)
 Provides a data object wrapper. More...
 
bool AddProvider (observer_ptr< DataProvider > provider)
 Adds a data provider in the data store. More...
 
const std::vector< observer_ptr< DataProvider > > GetAttachedProviders ()
 Gets all the providers attached to the data store. More...
 
void TrackRemovedObjects (bool track=true)
 Enables the tracking of removed objects. More...
 
bool IsTrackingRemovedObjects ()
 Checks whether the data store is tracking removed objects or not. More...
 
bool FreeRemoved (Memory::Status memStatus)
 Release the memory allocated for removed objects. More...
 
bool SetAlgoProducedObjects (const AlgoSequence &seq)
 Notify the data store about objects that are produced by the algorithms. More...
 
bool IsAlgoProducedObject (const std::string nameOrAlias)
 Checks if a given object is produced by an algorithm. More...
 
- Public Member Functions inherited from EA::Info
 Info (const std::string &name)
 Constructor. More...
 
virtual ~Info ()
 Destructor. More...
 
virtual const std::string GetType () const
 
virtual const std::string GetName () const
 The type (i.e. class) of the object. More...
 
virtual const std::string GetVersion () const
 The name of the object. More...
 

Private Attributes

observer_ptr< EventDataCache_eventCache
 

Additional Inherited Members

- Protected Member Functions inherited from EA::DataStore
template<class DataType >
ObjPtr< DataType > GetFromMap (const std::string &name)
 Retrieves an object from the internal ObjectMap. More...
 
RetrievalResult GetFromProvider (const std::string &name, ObjectWrapper &wrapper, std::string &actualName, observer_ptr< ObjectProducer > &provider)
 Retrieves an object from the registered providers. More...
 
template<class DataType >
ObjPtr< DataType > CastAndWrap (const std::string &name, const std::string &actualName, ObjectWrapper &&wrapper, observer_ptr< ObjectProducer > provider)
 Casts the wrapper to the template type, registers the object in the store and wraps it inside the return ObjPtr. More...
 
void AddKnownObjects (const ObjectProducer &producer)
 
- Protected Member Functions inherited from EA::Info
 Info (const std::shared_ptr< Representation > &impl)
 
std::shared_ptr< Representation > & GetRepresentation ()
 

Constructor & Destructor Documentation

◆ EventDataStore()

EA::EventDataStore::EventDataStore ( const std::string &  name)
inline

Member Function Documentation

◆ AddEventCache()

bool EA::EventDataStore::AddEventCache ( observer_ptr< EventDataCache cache)

Adds a cache to the event data store.

Data stores with a cache fetch for objects from the cache before trying with data providers. It is not possible to attach a cache to a store which already has a cache.

Parameters
cacheThe cache to attach to the data store.
Returns
true if the cache is correctly added, false if the store already had a cache.

◆ GetObject()

template<class DataType >
observer_ptr< DataType > EA::EventDataStore::GetObject ( const std::string &  name)

Provides a data object.

This method returns a pointer to the requested object. If the object is not present in the store, i.e. it has not been published yet or it has been removed, then it is first searched in the event cache, and if it's still ot found then the registered data providers will be queried for the object. If the object is not found, or if other errors occur, a #Retrieval::Exception is thrown, the exact class depending on the kind of error.

Parameters
namethe name of the requested object.
Returns
a pointer to the requested object.
See also
AddProvider
Retrieval::Exception

Member Data Documentation

◆ _eventCache

observer_ptr<EventDataCache> EA::EventDataStore::_eventCache
private

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