advice-basics: stubbed and fixed to pass compiler
This commit is contained in:
parent
83b5c8c2c2
commit
7dcdff3287
4 changed files with 11 additions and 17 deletions
|
|
@ -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<AD> AdviceProvision;
|
||||
typedef const Provision<AD> 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:
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ namespace test {
|
|||
return entry.pattern_;
|
||||
}
|
||||
|
||||
friend TestPOA*
|
||||
getSolution (TestPOA& entry)
|
||||
friend const TestPOA*
|
||||
getSolution (TestPOA const& entry)
|
||||
{
|
||||
return entry.solution_;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue