added observer to repository and updated tests
This commit is contained in:
@@ -24,6 +24,7 @@ add_library(matador-core STATIC
|
||||
../../include/matador/object/object_info.hpp
|
||||
../../include/matador/object/object_proxy.hpp
|
||||
../../include/matador/object/object_ptr.hpp
|
||||
../../include/matador/object/observer.hpp
|
||||
../../include/matador/object/primary_key_resolver.hpp
|
||||
../../include/matador/object/relation_completer.hpp
|
||||
../../include/matador/object/relation_endpoint.hpp
|
||||
@@ -83,6 +84,7 @@ add_library(matador-core STATIC
|
||||
object/internal/shadow_repository.cpp
|
||||
object/object.cpp
|
||||
object/object_generator.cpp
|
||||
object/observer.cpp
|
||||
object/relation_endpoint.cpp
|
||||
object/repository.cpp
|
||||
object/repository_node.cpp
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "matador/object/observer.hpp"
|
||||
|
||||
namespace matador::object {
|
||||
abstract_observer::abstract_observer(const std::type_index& ti)
|
||||
: type_index_(ti) {}
|
||||
|
||||
const std::type_index& abstract_observer::index() const {
|
||||
return type_index_;
|
||||
}
|
||||
} // namespace matador::object
|
||||
@@ -55,7 +55,11 @@ const repository& repository_node::schema() const {
|
||||
bool repository_node::has_children() const {
|
||||
return first_child_->next_sibling_ != last_child_;
|
||||
}
|
||||
void repository_node::on_attach() const {
|
||||
info_->on_attach();
|
||||
}
|
||||
|
||||
void repository_node::on_detach() const {}
|
||||
repository_node::node_ptr repository_node::next() const {
|
||||
// if we have a child, child is the next iterator to return
|
||||
// (if we don't iterate over the siblings)
|
||||
|
||||
Reference in New Issue
Block a user