lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
lintel::SharedMemoryPropertyRepository Class Reference

#include <SharedMemoryPropertyRepository.h>

Inheritance diagram for lintel::SharedMemoryPropertyRepository:
lintel::SharedMemoryMapRepository< shm::String, PropertyDataDto, shm::String, PropertyDataDao > lintel::PropertyRepository lintel::SharedMemoryRepository lintel::JsonSerializable

Public Member Functions

 SharedMemoryPropertyRepository (const std::shared_ptr< SharedMemoryService > &sharedMemoryService, const std::shared_ptr< SharedMemorySegmentManager > &sharedMemorySegmentManager, const std::shared_ptr< Configuration > &configuration, std::shared_ptr< ProcessName > processName)
 
DataStorage getDataStorage () override
 
void save (const std::vector< std::shared_ptr< PropertyBase > > &properties) override
 
void save (std::shared_ptr< PropertyBase > property) override
 
std::vector< std::shared_ptr< PropertyBase > > awake () override
 
std::vector< std::shared_ptr< PropertyBase > > allOf (const std::string &processName, const std::string &className, const std::string &instanceName, const std::string &name) override
 
void onMigrate (int32_t currentActiveVersion) override
 
void deleteOf (const std::vector< std::shared_ptr< PropertyBase > > &properties) override
 
- Public Member Functions inherited from lintel::SharedMemoryMapRepository< shm::String, PropertyDataDto, shm::String, PropertyDataDao >
 SharedMemoryMapRepository (const std::shared_ptr< SharedMemoryService > &sharedMemoryService, const std::shared_ptr< SharedMemorySegment > &segment, int32_t codeVersion, std::string uuid, int32_t sizeOfData=sizeof(PropertyDataDto))
 
SharedMemoryType getType () const override
 
void serialize (rapidjson::Writer< rapidjson::StringBuffer > *writer) const override
 
bool deserialize (const rapidjson::Value &obj) override
 
- Public Member Functions inherited from lintel::SharedMemoryRepository
 SharedMemoryRepository (std::shared_ptr< SharedMemorySegment > sharedMemorySegment, std::size_t sizeOfData, std::string_view sharedMemoryRepository, int32_t codeVersion, std::string uuid)
 
const std::shared_ptr< SharedMemorySegment > & getSharedMemorySegment () const
 
std::size_t getSizeOfData () const
 
const std::string & getSharedMemoryRepository () const
 
int32_t getCodeVersion () const
 
const std::string & getUuid () const
 
std::string_view getTypeName () const
 
 ~SharedMemoryRepository () override=default
 
- Public Member Functions inherited from lintel::JsonSerializable
 JsonSerializable ()=default
 
virtual ~JsonSerializable ()=default
 
virtual std::string serialize () const
 
virtual void deserialize (const std::string &json)
 
- Public Member Functions inherited from lintel::PropertyRepository
 PropertyRepository (PropertyRepositoryType type, const std::shared_ptr< Configuration > &configuration)
 
virtual ~PropertyRepository ()=default
 
PropertyRepositoryType getType () const
 
bool isShadow () const
 
bool isEnabled () const
 
bool isMutable () const
 

Protected Member Functions

void onAcquireReadLock () const override
 
void onReleaseReadLock () const override
 
- Protected Member Functions inherited from lintel::SharedMemoryMapRepository< shm::String, PropertyDataDto, shm::String, PropertyDataDao >
Map & getMap () const
 

Additional Inherited Members

- Static Protected Member Functions inherited from lintel::SharedMemoryRepository
template<typename TYPE >
static constexpr bool isSerializable ()
 
- Protected Attributes inherited from lintel::SharedMemoryMapRepository< shm::String, PropertyDataDto, shm::String, PropertyDataDao >
std::shared_ptr< SharedMemoryService > m_sharedMemoryService
 

Detailed Description

Property repository backed by shared memory

Constructor & Destructor Documentation

◆ SharedMemoryPropertyRepository()

lintel::SharedMemoryPropertyRepository::SharedMemoryPropertyRepository ( const std::shared_ptr< SharedMemoryService > &  sharedMemoryService,
const std::shared_ptr< SharedMemorySegmentManager > &  sharedMemorySegmentManager,
const std::shared_ptr< Configuration > &  configuration,
std::shared_ptr< ProcessName >  processName 
)

Member Function Documentation

◆ allOf()

std::vector< std::shared_ptr< PropertyBase > > lintel::SharedMemoryPropertyRepository::allOf ( const std::string &  processName,
const std::string &  className,
const std::string &  instanceName,
const std::string &  name 
)
overridevirtual

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 from lintel::PropertyRepository.

◆ awake()

std::vector< std::shared_ptr< PropertyBase > > lintel::SharedMemoryPropertyRepository::awake ( )
overridevirtual

load all properties from repository and return result

Implements lintel::PropertyRepository.

◆ deleteOf()

void lintel::SharedMemoryPropertyRepository::deleteOf ( const std::vector< std::shared_ptr< PropertyBase > > &  properties)
overridevirtual

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 from lintel::PropertyRepository.

◆ getDataStorage()

DataStorage lintel::SharedMemoryPropertyRepository::getDataStorage ( )
overridevirtual
Returns
data storage info

Implements lintel::PropertyRepository.

◆ onAcquireReadLock()

void lintel::SharedMemoryPropertyRepository::onAcquireReadLock ( ) const
inlineoverrideprotectedvirtual

Acquire the shared read lock before serializing the underlying shared memory structure. No-op by default.

Reimplemented from lintel::SharedMemoryRepository.

◆ onMigrate()

void lintel::SharedMemoryPropertyRepository::onMigrate ( int32_t  currentActiveVersion)
overridevirtual

◆ onReleaseReadLock()

void lintel::SharedMemoryPropertyRepository::onReleaseReadLock ( ) const
inlineoverrideprotectedvirtual

Release the shared read lock after serialization. No-op by default.

Reimplemented from lintel::SharedMemoryRepository.

◆ save() [1/2]

void lintel::SharedMemoryPropertyRepository::save ( const std::vector< std::shared_ptr< PropertyBase > > &  properties)
overridevirtual

save properties to repository

Implements lintel::PropertyRepository.

◆ save() [2/2]

void lintel::SharedMemoryPropertyRepository::save ( std::shared_ptr< PropertyBase >  property)
overridevirtual

save property to repository

Implements lintel::PropertyRepository.


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