ORM C++
Loading...
Searching...
No Matches
model.hpp
1#pragma once
2
3#include "model/GetModelInfo.hpp"
4
5namespace orm
6{
15template <typename T>
16class Model
17{
18public:
24 static auto getModelInfo(bool force = false) -> model::ModelInfo&
25 {
26 if (not modelInfo.has_value() or force)
27 {
28 modelInfo = model::getModelInfo<T>();
29 }
30
31 return modelInfo.value();
32 }
33
34private:
35 inline static std::optional<model::ModelInfo> modelInfo = std::nullopt;
36};
37} // namespace orm
A template class representing a model in the ORM framework.
Definition model.hpp:17
static auto getModelInfo(bool force=false) -> model::ModelInfo &
Get the model info for the model.
Definition model.hpp:24