Skip to content

Commit 160f336

Browse files
author
sajith
committed
Improved
1 parent 221288a commit 160f336

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ set(CMAKE_CXX_STANDARD 20)
1818
#add_executable(ocp OCP/ocp_using_runtime_concet.cpp)
1919
#add_executable(lsp LSP/lsp_classic_example.cpp)
2020
#add_executable(lsp LSP/lsp_better_example.cpp)
21-
add_executable(lspcovarient LSP/lsp_covariance_example.cpp)
21+
#add_executable(lspcovarient LSP/lsp_covariance_example.cpp)
22+
add_executable(lspqueryset LSP/lsp_query_set.cpp)

LSP/lsp_query_set.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//
2+
// Created by sajith on 4/17/21.
3+
//
4+
5+
#include <iostream>
6+
#include <vector>
7+
8+
9+
template<typename Model>
10+
class ORMQueryset
11+
{
12+
public:
13+
virtual ~ORMQueryset() = default;
14+
virtual ORMQueryset &filterObjects(std::string, std::string) const = 0;
15+
virtual ORMQueryset &orderObjects(std::string, std::string) const = 0;
16+
virtual std::vector<Model> getObjects() const = 0;
17+
virtual unsigned updateObjects() = 0;
18+
virtual unsigned deleteObjects() = 0;
19+
};
20+
21+
22+
template<typename Model>
23+
class Database1ORMQueryset : public ORMQueryset<Model>
24+
{
25+
public:
26+
ORMQueryset<Model> &filterObjects(std::string, std::string) const override;
27+
28+
ORMQueryset<Model> &orderObjects(std::string, std::string) const override;
29+
30+
std::vector<Model> getObjects() const override;
31+
32+
unsigned updateObjects() override;
33+
34+
unsigned deleteObjects() override;
35+
};
36+
37+
38+

0 commit comments

Comments
 (0)