38 lines
1.3 KiB
C++
38 lines
1.3 KiB
C++
#ifndef MATADOR_FOREIGN_ATTRIBUTES_HPP
|
|
#define MATADOR_FOREIGN_ATTRIBUTES_HPP
|
|
|
|
#include "matador/utils/fetch_type.hpp"
|
|
#include "matador/utils/cascade_type.hpp"
|
|
|
|
// ReSharper disable CppNonExplicitConvertingConstructor
|
|
namespace matador::utils {
|
|
|
|
class foreign_attributes
|
|
{
|
|
public:
|
|
foreign_attributes() = default;
|
|
foreign_attributes(cascade_type cascade); // NOLINT(*-explicit-constructor)
|
|
foreign_attributes(fetch_type fetch); // NOLINT(*-explicit-constructor)
|
|
foreign_attributes(cascade_type cascade, fetch_type fetch);
|
|
foreign_attributes(const utils::foreign_attributes &x) = default;
|
|
foreign_attributes& operator=(const utils::foreign_attributes &x) = default;
|
|
foreign_attributes(foreign_attributes &&x) = default;
|
|
foreign_attributes& operator=(foreign_attributes &&x) = default;
|
|
~foreign_attributes() = default;
|
|
|
|
[[nodiscard]] cascade_type cascade() const;
|
|
[[nodiscard]] fetch_type fetch() const;
|
|
|
|
private:
|
|
cascade_type cascade_{cascade_type::NONE};
|
|
fetch_type fetch_{fetch_type::LAZY};
|
|
};
|
|
|
|
const foreign_attributes CascadeNoneFetchLazy {};
|
|
const foreign_attributes CascadeAllFetchLazy {cascade_type::ALL, fetch_type::LAZY};
|
|
const foreign_attributes CascadeAllFetchEager {cascade_type::ALL, fetch_type::EAGER};
|
|
|
|
}
|
|
|
|
#endif //MATADOR_FOREIGN_ATTRIBUTES_HPP
|