diff --git a/src/lib/advice.hpp b/src/lib/advice.hpp index df284ef0d..a5f03d6ce 100644 --- a/src/lib/advice.hpp +++ b/src/lib/advice.hpp @@ -141,8 +141,8 @@ namespace advice { return entry.pattern_; } - friend PointOfAdvice* - getSolution (PointOfAdvice& entry) + friend const PointOfAdvice* + getSolution (PointOfAdvice const& entry) { return entry.resolution_; } @@ -171,7 +171,7 @@ namespace advice { /* == policy definitions == */ ////TODO: extract into policy classes - AD const& handleMissingSolution() const { return AD(); } + AD const& handleMissingSolution() const { return AD(); } /////////////////////TODO either return value or build a registry of defaults void deregistrate() { /* NOP */ } @@ -226,12 +226,12 @@ namespace advice { class Request : public PointOfAdvice { - typedef Provision AdviceProvision; + typedef const Provision AdviceProvision; /* == policy definitions == */ ////TODO: extract into policy classes - AD const& handleMissingSolution() const { return AD(); } + AD const& handleMissingSolution() const { return AD(); } /////////////////////TODO either return value or build a registry of defaults public: diff --git a/src/lib/advice/index.hpp b/src/lib/advice/index.hpp index f4a96dd57..1a1fe273f 100644 --- a/src/lib/advice/index.hpp +++ b/src/lib/advice/index.hpp @@ -551,7 +551,7 @@ namespace advice { { verify_Entry (e,hash); POA& request = *(e.second); - POA* solution (getSolution (request)); + const POA* solution (getSolution (request)); if (solution && hasProvision(*solution)) { POA* currentSolution = provisionEntries_[hash].find_latest_solution (request); diff --git a/tests/lib/advice/advice-basics-test.cpp b/tests/lib/advice/advice-basics-test.cpp index 7ed8e3b7b..8b1484dd8 100644 --- a/tests/lib/advice/advice-basics-test.cpp +++ b/tests/lib/advice/advice-basics-test.cpp @@ -148,7 +148,6 @@ namespace test { void simpleExchange() { -#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #605 TheAdvised client; // implicitly opens an request-for-advice CHECK (client.got (0)); // no advice yet --> getting the default int() @@ -159,7 +158,6 @@ namespace test { server.publish (rr); // now an match is detected, creating an advice channel CHECK (client.got (rr)); // ..so the client can pick up the provided advice value -#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #605 } @@ -167,7 +165,6 @@ namespace test { void createCollaboration() { -#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #605 TheAdvised client1 ("topic1()"); TheAdvisor server2 ("topic2()"); @@ -190,7 +187,6 @@ namespace test { server1.rebind ("topic1()"); CHECK (client1.got(r1)); CHECK (client2.got(r2)); -#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #605 } @@ -206,7 +202,6 @@ namespace test { void overwriting_and_retracting() { -#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #605 TheAdvised client1 ("topic1"); TheAdvised client2 ("topic2"); CHECK (client1.got(0)); @@ -258,15 +253,15 @@ namespace test { CHECK (client1.got(r1)); CHECK (client2.got(r1)); - yetAnotherserver.rebind("topic1"); + yetAnotherServer.rebind("topic1"); CHECK (client1.got(r1)); CHECK (client2.got(0)); - yetAnotherserver.clear(); + yetAnotherServer.clear(); CHECK (client1.got(0)); CHECK (client2.got(0)); - yetAnotherserver.rebind("topic2"); + yetAnotherServer.rebind("topic2"); CHECK (client1.got(0)); CHECK (client2.got(0)); @@ -285,7 +280,6 @@ namespace test { client2.rebind("nonExistingTopic"); CHECK (client1.got(r1)); CHECK (client2.got(0)); -#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #605 } }; diff --git a/tests/lib/advice/advice-index-test.cpp b/tests/lib/advice/advice-index-test.cpp index 4b4b25766..d1100ac32 100644 --- a/tests/lib/advice/advice-index-test.cpp +++ b/tests/lib/advice/advice-index-test.cpp @@ -76,8 +76,8 @@ namespace test { return entry.pattern_; } - friend TestPOA* - getSolution (TestPOA& entry) + friend const TestPOA* + getSolution (TestPOA const& entry) { return entry.solution_; }