FOSSredder 0.5.0
Loading...
Searching...
No Matches
SqlitePropertyRepository Class Reference

#include <SqlitePropertyRepository.h>

Inheritance diagram for SqlitePropertyRepository:
Collaboration diagram for SqlitePropertyRepository:

Classes

struct  Impl

Public Member Functions

 SqlitePropertyRepository (const std::string &dbPath)
 Create a property repository for the database at the given path.
 SqlitePropertyRepository (const std::string &dbPath, std::shared_ptr< core::ports::diagnostics::IErrorReporter > errorReporter)
 Create a property repository for the database at the given path.
 SqlitePropertyRepository (std::shared_ptr< SqliteDb > db)
 Create a property repository using an existing database handle wrapper.
 SqlitePropertyRepository (std::shared_ptr< SqliteDb > db, std::shared_ptr< core::ports::diagnostics::IErrorReporter > errorReporter)
 Create a property repository using an existing database handle wrapper.
 ~SqlitePropertyRepository () override
 Destroy the repository.
void addProperty (const std::shared_ptr< core::domain::Property > &property) override
 Insert a new property.
std::vector< std::shared_ptr< core::domain::Property > > getProperties () const override
 Retrieve all properties.
std::optional< std::shared_ptr< core::domain::Property > > getPropertyById (const std::string &id) const override
 Retrieve a property by identifier.
void removeProperty (const std::string &id) override
 Remove a property by identifier.
void updateProperty (const std::shared_ptr< core::domain::Property > &property) override
 Update an existing property.
void upsertProperty (const std::shared_ptr< core::domain::Property > &property) override
 Insert or update a property.
void clearProperties () override
 Remove all properties.
Public Member Functions inherited from core::ports::repositories::IPropertyRepository
virtual ~IPropertyRepository ()=default
 Destroy the property repository interface.

Detailed Description

Definition at line 15 of file SqlitePropertyRepository.h.

Constructor & Destructor Documentation

◆ SqlitePropertyRepository() [1/4]

SqlitePropertyRepository::SqlitePropertyRepository ( const std::string & dbPath)
explicit

Create a property repository for the database at the given path.

Parameters
dbPathSQLite database path.

Definition at line 161 of file SqlitePropertyRepository.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SqlitePropertyRepository() [2/4]

SqlitePropertyRepository::SqlitePropertyRepository ( const std::string & dbPath,
std::shared_ptr< core::ports::diagnostics::IErrorReporter > errorReporter )

Create a property repository for the database at the given path.

Parameters
dbPathSQLite database path.
errorReporterError reporter used by the repository.

Definition at line 164 of file SqlitePropertyRepository.cpp.

Here is the call graph for this function:

◆ SqlitePropertyRepository() [3/4]

SqlitePropertyRepository::SqlitePropertyRepository ( std::shared_ptr< SqliteDb > db)
explicit

Create a property repository using an existing database handle wrapper.

Parameters
dbShared SQLite database wrapper.

Definition at line 170 of file SqlitePropertyRepository.cpp.

Here is the call graph for this function:

◆ SqlitePropertyRepository() [4/4]

SqlitePropertyRepository::SqlitePropertyRepository ( std::shared_ptr< SqliteDb > db,
std::shared_ptr< core::ports::diagnostics::IErrorReporter > errorReporter )

Create a property repository using an existing database handle wrapper.

Parameters
dbShared SQLite database wrapper.
errorReporterError reporter used by the repository.

Definition at line 173 of file SqlitePropertyRepository.cpp.

◆ ~SqlitePropertyRepository()

SqlitePropertyRepository::~SqlitePropertyRepository ( )
overridedefault

Destroy the repository.

Member Function Documentation

◆ addProperty()

void SqlitePropertyRepository::addProperty ( const std::shared_ptr< core::domain::Property > & property)
overridevirtual

Insert a new property.

Parameters
propertyProperty to add.

Implements core::ports::repositories::IPropertyRepository.

Definition at line 196 of file SqlitePropertyRepository.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearProperties()

void SqlitePropertyRepository::clearProperties ( )
overridevirtual

Remove all properties.

Implements core::ports::repositories::IPropertyRepository.

Definition at line 292 of file SqlitePropertyRepository.cpp.

◆ getProperties()

std::vector< std::shared_ptr< Property > > SqlitePropertyRepository::getProperties ( ) const
overridevirtual

Retrieve all properties.

Returns
All stored properties.

Implements core::ports::repositories::IPropertyRepository.

Definition at line 215 of file SqlitePropertyRepository.cpp.

Here is the call graph for this function:

◆ getPropertyById()

std::optional< std::shared_ptr< Property > > SqlitePropertyRepository::getPropertyById ( const std::string & id) const
overridevirtual

Retrieve a property by identifier.

Parameters
idProperty identifier.
Returns
Property with the requested identifier, if found.

Implements core::ports::repositories::IPropertyRepository.

Definition at line 233 of file SqlitePropertyRepository.cpp.

Here is the call graph for this function:

◆ removeProperty()

void SqlitePropertyRepository::removeProperty ( const std::string & id)
overridevirtual

Remove a property by identifier.

Parameters
idProperty identifier.

Implements core::ports::repositories::IPropertyRepository.

Definition at line 251 of file SqlitePropertyRepository.cpp.

Here is the call graph for this function:

◆ updateProperty()

void SqlitePropertyRepository::updateProperty ( const std::shared_ptr< core::domain::Property > & property)
overridevirtual

Update an existing property.

Parameters
propertyProperty to update.

Implements core::ports::repositories::IPropertyRepository.

Definition at line 262 of file SqlitePropertyRepository.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ upsertProperty()

void SqlitePropertyRepository::upsertProperty ( const std::shared_ptr< core::domain::Property > & property)
overridevirtual

Insert or update a property.

Parameters
propertyProperty to upsert.

Implements core::ports::repositories::IPropertyRepository.

Definition at line 283 of file SqlitePropertyRepository.cpp.

Here is the call graph for this function:

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