added observer to repository and updated tests
This commit is contained in:
@@ -33,14 +33,14 @@ public:
|
||||
explicit schema(sql::connection_pool &pool);
|
||||
schema(sql::connection_pool &pool, const std::string &name);
|
||||
|
||||
template<typename Type>
|
||||
[[nodiscard]] utils::result<void, utils::error> attach(const std::string &name, const std::string &parent = "") {
|
||||
return repo_.attach<Type>(name, parent);
|
||||
template<typename Type, template <typename> class ObserverType>
|
||||
[[nodiscard]] utils::result<void, utils::error> attach(const std::string &name, const std::string &parent = "", std::initializer_list<ObserverType<Type>*> observer = {}) {
|
||||
return repo_.attach<Type>(name, parent, observer);
|
||||
}
|
||||
|
||||
template<typename Type, typename SuperType>
|
||||
[[nodiscard]] utils::result<void, utils::error> attach(const std::string &name) {
|
||||
return repo_.attach<Type, SuperType>(name);
|
||||
template<typename Type, typename SuperType, template <typename> class ObserverType>
|
||||
[[nodiscard]] utils::result<void, utils::error> attach(const std::string &name, std::initializer_list<ObserverType<Type>*> observer = {}) {
|
||||
return repo_.attach<Type, SuperType>(name, observer);
|
||||
}
|
||||
|
||||
[[nodiscard]] utils::result<void, utils::error> create() const;
|
||||
|
||||
Reference in New Issue
Block a user