FOSSredder 0.5.0
Loading...
Searching...
No Matches
SqlitePropertyRepository.h
Go to the documentation of this file.
1
5
6#pragma once
7
10#include <memory>
11#include <string>
12
13class SqliteDb;
14
17public:
22 explicit SqlitePropertyRepository(const std::string& dbPath);
23
30 const std::string& dbPath,
31 std::shared_ptr<core::ports::diagnostics::IErrorReporter> errorReporter);
32
38 explicit SqlitePropertyRepository(std::shared_ptr<SqliteDb> db);
39
47 std::shared_ptr<SqliteDb> db,
48 std::shared_ptr<core::ports::diagnostics::IErrorReporter> errorReporter);
49
54
59 void
60 addProperty(const std::shared_ptr<core::domain::Property>& property) override;
61
66 std::vector<std::shared_ptr<core::domain::Property>>
67 getProperties() const override;
68
74 std::optional<std::shared_ptr<core::domain::Property>>
75 getPropertyById(const std::string& id) const override;
76
81 void removeProperty(const std::string& id) override;
82
87 void updateProperty(
88 const std::shared_ptr<core::domain::Property>& property) override;
89
94 void upsertProperty(
95 const std::shared_ptr<core::domain::Property>& property) override;
96
100 void clearProperties() override;
101
102private:
103 struct Impl;
104 std::unique_ptr<Impl> pimpl_;
105};
Declares the structured diagnostics reporting port.
Repository port for core::domain::Property persistence operations.
SqlitePropertyRepository(const std::string &dbPath)
Create a property repository for the database at the given path.
void upsertProperty(const std::shared_ptr< core::domain::Property > &property) override
Insert or update a property.
~SqlitePropertyRepository() override
Destroy the repository.
void clearProperties() override
Remove all properties.
void addProperty(const std::shared_ptr< core::domain::Property > &property) override
Insert a new property.
std::optional< std::shared_ptr< core::domain::Property > > getPropertyById(const std::string &id) const override
Retrieve a property by identifier.
void updateProperty(const std::shared_ptr< core::domain::Property > &property) override
Update an existing property.
void removeProperty(const std::string &id) override
Remove a property by identifier.
std::vector< std::shared_ptr< core::domain::Property > > getProperties() const override
Retrieve all properties.