From d5ebe14d73f05fbf07e15abaadf03862005c4954 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 27 May 2010 03:42:23 +0200 Subject: [PATCH] add (protected) calls to the AdviceSystem --- src/lib/advice.hpp | 20 +++++++++++++------ src/lib/advice/advice.cpp | 42 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/src/lib/advice.hpp b/src/lib/advice.hpp index c1fef9eab..33cc3392e 100644 --- a/src/lib/advice.hpp +++ b/src/lib/advice.hpp @@ -116,6 +116,14 @@ namespace advice { pattern_ = binding.buildMatcher(); } + void publishProvision(); + void discardSolutions (); + void publishBindingChange(); + void publishRequestBindingChange(); + + void registrateRequest(); + void deregistrateRequest(); + public: explicit PointOfAdvice (Binding const& binding) @@ -204,20 +212,20 @@ namespace advice { void setAdvice (AD const& pieceOfAdvice) { theAdvice_ = pieceOfAdvice; - UNIMPLEMENTED ("change advice provision registration"); + publishProvision (); ///////////////////////////TODO how to propagate without specific typing? } void retractAdvice() { theAdvice_ = this->handleMissingSolution(); - UNIMPLEMENTED ("notify index of retracted advice"); + discardSolutions (); } void defineBinding (Literal topic) { setBindingPattern (Binding(topic).addTypeGuard()); - UNIMPLEMENTED ("propagate binding change to index"); + publishBindingChange(); } }; @@ -246,12 +254,12 @@ namespace advice { Request (Literal bindingSpec =0) : PointOfAdvice (Binding(bindingSpec).addTypeGuard()) { - UNIMPLEMENTED ("registration with the index"); + registrateRequest(); } ~Request() { - UNIMPLEMENTED ("detach from index"); + deregistrateRequest(); } @@ -270,7 +278,7 @@ namespace advice { defineBinding (Literal topic) { setBindingPattern (Binding(topic).addTypeGuard()); - UNIMPLEMENTED ("propagate binding change to index"); + publishRequestBindingChange(); } }; diff --git a/src/lib/advice/advice.cpp b/src/lib/advice/advice.cpp index dfb9dc48c..1ed7889fb 100644 --- a/src/lib/advice/advice.cpp +++ b/src/lib/advice/advice.cpp @@ -32,6 +32,48 @@ namespace advice { /* ohlolololohaha */ + void + PointOfAdvice::publishProvision() + { + UNIMPLEMENTED ("change advice provision registration"); + } + + + void + PointOfAdvice::discardSolutions () + { + UNIMPLEMENTED ("notify index of retracted advice"); + } + + + void + PointOfAdvice::publishBindingChange () + { + UNIMPLEMENTED ("propagate binding change to index"); + } + + + void + PointOfAdvice::publishRequestBindingChange() + { + UNIMPLEMENTED ("propagate binding change to index"); + } + + + void + PointOfAdvice::registrateRequest() + { + UNIMPLEMENTED ("registrate request with the index"); + } + + + void + PointOfAdvice::deregistrateRequest() + { + UNIMPLEMENTED ("detach request from index"); + } + +