FOSSredder 0.5.0
Loading...
Searching...
No Matches
IStatementRepository.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <memory>
9#include <optional>
10#include <string>
11#include <vector>
12
13namespace core::domain {
14class Statement;
15}
16
18
20public:
24 virtual ~IStatementRepository() = default;
25
30 virtual void addStatement(const std::shared_ptr<core::domain::Statement>& statement) = 0;
31
36 virtual std::vector<std::shared_ptr<core::domain::Statement>> getStatements() const = 0;
37
43 virtual std::optional<std::shared_ptr<core::domain::Statement>> getStatementById(const std::string& id) const = 0;
44
49 virtual void removeStatement(const std::string& id) = 0;
50
55 virtual void updateStatement(const std::shared_ptr<core::domain::Statement>& statement) = 0;
56
61 virtual void upsertStatement(const std::shared_ptr<core::domain::Statement>& statement) = 0;
62
66 virtual void clearStatements() = 0;
67};
68
69} // namespace core::ports::repositories
virtual void removeStatement(const std::string &id)=0
Remove a statement by identifier.
virtual void clearStatements()=0
Remove all statements.
virtual void addStatement(const std::shared_ptr< core::domain::Statement > &statement)=0
Add a new statement.
virtual std::optional< std::shared_ptr< core::domain::Statement > > getStatementById(const std::string &id) const =0
Retrieve a statement by identifier.
virtual ~IStatementRepository()=default
Destroy the statement repository interface.
virtual void upsertStatement(const std::shared_ptr< core::domain::Statement > &statement)=0
Insert or update a statement.
virtual std::vector< std::shared_ptr< core::domain::Statement > > getStatements() const =0
Retrieve all statements.
virtual void updateStatement(const std::shared_ptr< core::domain::Statement > &statement)=0
Update an existing statement.