CatapultServer  v0.5.0.1 (Elephant)
ChildNamespaceObserver.cpp File Reference
Include dependency graph for ChildNamespaceObserver.cpp:

Namespaces

 catapult
 
 catapult::observers
 

Functions

 catapult::observers::DEFINE_OBSERVER (ChildNamespace, model::ChildNamespaceNotification, [](const auto &notification, const ObserverContext &context) { auto &cache=context.Cache.sub< cache::NamespaceCache >();if(NotifyMode::Rollback==context.Mode) { cache.remove(notification.NamespaceId);return;} auto namespaceIter=cache.find(notification.ParentId);const auto &parentEntry=namespaceIter.get();auto childPath=parentEntry.ns().path();childPath.push_back(notification.NamespaceId);cache.insert(state::Namespace(childPath));})