lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lintel::PropertyRepository Class Referenceabstract

#include <PropertyRepository.h>

Inheritance diagram for lintel::PropertyRepository:
lintel::DatabasePropertyRepository lintel::FilePropertyRepository lintel::SharedMemoryPropertyRepository

Public Member Functions

 PropertyRepository (PropertyRepositoryType type, const std::shared_ptr< Configuration > &configuration)
 
virtual ~PropertyRepository ()=default
 
PropertyRepositoryType getType () const
 
bool isShadow () const
 
bool isEnabled () const
 
virtual DataStorage getDataStorage ()=0
 
bool isMutable () const
 
virtual void save (const std::vector< std::shared_ptr< PropertyBase > > &properties)=0
 
virtual void save (std::shared_ptr< PropertyBase > property)=0
 
virtual void deleteOf (const std::vector< std::shared_ptr< PropertyBase > > &properties)
 
virtual std::vector< std::shared_ptr< PropertyBase > > awake ()=0
 
virtual std::vector< std::shared_ptr< PropertyBase > > allOf (const std::string &processName=".*", const std::string &className=".*", const std::string &instanceName=".*", const std::string &name=".*")
 

Detailed Description

Abstract base class for property repositories

Constructor & Destructor Documentation

◆ PropertyRepository()

lintel::PropertyRepository::PropertyRepository ( PropertyRepositoryType  type,
const std::shared_ptr< Configuration > &  configuration 
)
inline
Parameters
typerepository type
configurationconfiguration source

◆ ~PropertyRepository()

virtual lintel::PropertyRepository::~PropertyRepository ( )
virtualdefault

Member Function Documentation

◆ allOf()

virtual std::vector< std::shared_ptr< PropertyBase > > lintel::PropertyRepository::allOf ( const std::string &  processName = ".*",
const std::string &  className = ".*",
const std::string &  instanceName = ".*",
const std::string &  name = ".*" 
)
inlinevirtual

Query properties with optional filters

Returns an empty vector by default: an implementation without query support reports "no overrides", which PropertyService reads as "keep the configured default". The default is only reached for FilePropertyRepository, whose values come from the XML configuration and are never queried at runtime.

Parameters
processNameregex for process name
classNameregex for class name
instanceNameregex for instance name
nameregex for property name

Reimplemented in lintel::SharedMemoryPropertyRepository, and lintel::DatabasePropertyRepository.

◆ awake()

virtual std::vector< std::shared_ptr< PropertyBase > > lintel::PropertyRepository::awake ( )
pure virtual

load all properties from repository and return result

Implemented in lintel::DatabasePropertyRepository, lintel::FilePropertyRepository, and lintel::SharedMemoryPropertyRepository.

◆ deleteOf()

virtual void lintel::PropertyRepository::deleteOf ( const std::vector< std::shared_ptr< PropertyBase > > &  properties)
inlinevirtual

deletes properties in the mentioned repository

No-op by default: a read-only repository has nothing to delete from. PropertyService only reaches this method behind an isMutable() check, so the default is unreachable for FilePropertyRepository, which PropertyRepositoryComponent::parse rejects with a ConfigurationException when mutable="true" is configured.

Reimplemented in lintel::DatabasePropertyRepository, and lintel::SharedMemoryPropertyRepository.

◆ getDataStorage()

virtual DataStorage lintel::PropertyRepository::getDataStorage ( )
pure virtual

◆ getType()

PropertyRepositoryType lintel::PropertyRepository::getType ( ) const
inline

returns priority of repository

◆ isEnabled()

bool lintel::PropertyRepository::isEnabled ( ) const
inline
Returns
true if this repository is enabled in configuration

◆ isMutable()

bool lintel::PropertyRepository::isMutable ( ) const
inline

returns if save operations are supported or not

◆ isShadow()

bool lintel::PropertyRepository::isShadow ( ) const
inline
Returns
true if this is a shadow repository

◆ save() [1/2]

virtual void lintel::PropertyRepository::save ( const std::vector< std::shared_ptr< PropertyBase > > &  properties)
pure virtual

◆ save() [2/2]

virtual void lintel::PropertyRepository::save ( std::shared_ptr< PropertyBase >  property)
pure virtual

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