55 int*
next () { --resNr_;
return &resNr_; }
104 if (solutions_.exhausted())
107 cursor.
point_at (solutions_.next());
124 return Goal::GENERIC == qID.kind
125 and ( wantResultType<int> (qID)
126 or wantResultType<string>(qID));
129 template<
typename TY>
133 return qID.type == getResultTypeID<TY>();
137 template<
typename TY>
142 REQUIRE (qID.kind == Goal::GENERIC
143 and qID.type == getResultTypeID<TY>());
148 operator string()
const {
return "Test-DummyQueryResolver"; }
155 Goal::QueryID case2(Goal::GENERIC, getResultTypeID<string>());
157 installResolutionCase(case1, &resolutionFunction<int> );
158 installResolutionCase(case2, &resolutionFunction<string> );
202 template<
typename ITER>
206 cout <<
"Query-Results: " << showSizeof(ii) << endl;
Access point to singletons and other kinds of dependencies designated by type.
Single Solution, possibly part of a result set.
Query ABC: unspecific goal for resolution or retrieval.
QueryID const & getQID() const
Interface: a facility for resolving (some kind of) queries A concrete subclass has the ability to cre...
Generic interface to express a query for specifically typed result elements exposing some capabilitie...
iterator resolveBy(QueryResolver const &resolver) const
ABC representing the result set of an individual query resolution.
static void explore(ITER ii)
a (dummy) concrete query resolution facility.
DummyTypedSolutionProducer()
static Resolution * resolutionFunction(Goal const &goal)
bool wantResultType(QID qID) const
bool canHandleQuery(QID qID) const
Singleton services and Dependency Injection.
string showSizeof(size_t siz, string name)
for printing sizeof().
Goal::QueryID const & QID
lib::Depend< DummyTypedSolutionProducer > testResolver
QueryResolver & buildTestQueryResolver()
an sequence of "solutions" to be "found"
Lumiera public interface.
Goal::QueryID const & QID
Test runner and basic definitions for tests.
framework and to resolve logical queries.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
a concrete "resolution" of the query is a set of "solutions", which can be explored by iteration.
DummySolutions< TY > solutions_
Result prepareResolution()
void nextResult(Result &pos)
A collection of frequently used helper functions to support unit testing.