BIND 10 trac978, updated. 85b06e8c212c9733cc77e71d8a72c72161dc34f2 [trac978] Pass the loader to creator
BIND 10 source code commits
bind10-changes at lists.isc.org
Sun Jun 19 15:48:32 UTC 2011
The branch, trac978 has been updated
via 85b06e8c212c9733cc77e71d8a72c72161dc34f2 (commit)
from 70af8c7c72300e1afe1974de22c117ff5566487d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 85b06e8c212c9733cc77e71d8a72c72161dc34f2
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Sun Jun 19 17:45:14 2011 +0200
[trac978] Pass the loader to creator
-----------------------------------------------------------------------
Summary of changes:
src/lib/acl/loader.h | 8 ++++++--
src/lib/acl/tests/loader_test.cc | 16 ++++++++++------
2 files changed, 16 insertions(+), 8 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/acl/loader.h b/src/lib/acl/loader.h
index 95de9e5..11e7ebc 100644
--- a/src/lib/acl/loader.h
+++ b/src/lib/acl/loader.h
@@ -190,9 +190,12 @@ public:
* parameters might look like, they are not checked in any way.
* Therefore it's up to the creator (or the check being created)
* to validate the data and throw if it is bad.
+ * \param Current loader calling this creator. This can be used
+ * to load subexpressions in case of compound check.
*/
virtual boost::shared_ptr<Check<Context> > create(
- const std::string& name, data::ConstElementPtr definition) = 0;
+ const std::string& name, data::ConstElementPtr definition,
+ const Loader<Context, Action>& loader) = 0;
/**
* \brief Is list or-abbreviation allowed?
*
@@ -369,7 +372,8 @@ private:
checkDesc->second);
}
// Create the check and return it
- return (creatorIt->second->create(name, checkDesc->second));
+ return (creatorIt->second->create(name, checkDesc->second,
+ *this));
}
default:
isc_throw_1(LoaderError,
diff --git a/src/lib/acl/tests/loader_test.cc b/src/lib/acl/tests/loader_test.cc
index 0d97817..92d40a8 100644
--- a/src/lib/acl/tests/loader_test.cc
+++ b/src/lib/acl/tests/loader_test.cc
@@ -89,8 +89,8 @@ public:
vector<string> names() const {
return (names_);
}
- shared_ptr<Check<Log> > create(const string& name,
- ConstElementPtr data)
+ shared_ptr<Check<Log> > create(const string& name, ConstElementPtr data,
+ const Loader<Log>&)
{
bool found(false);
for (vector<string>::const_iterator i(names_.begin());
@@ -123,7 +123,9 @@ public:
result.push_back("throw");
return (result);
}
- shared_ptr<Check<Log> > create(const string&, ConstElementPtr) {
+ shared_ptr<Check<Log> > create(const string&, ConstElementPtr,
+ const Loader<Log>&)
+ {
throw TestCreatorError();
}
};
@@ -144,7 +146,9 @@ public:
result.push_back("throwcheck");
return (result);
}
- shared_ptr<Check<Log> > create(const string&, ConstElementPtr) {
+ shared_ptr<Check<Log> > create(const string&, ConstElementPtr,
+ const Loader<Log>&)
+ {
return (shared_ptr<Check<Log> >(new ThrowCheck()));
}
};
@@ -161,8 +165,8 @@ public:
* logging cell used, the second is result of the check. No error checking
* is done, if there's bug in the test, it will throw TypeError for us.
*/
- shared_ptr<Check<Log> > create(const string&,
- ConstElementPtr definition)
+ shared_ptr<Check<Log> > create(const string&, ConstElementPtr definition,
+ const Loader<Log>&)
{
vector<ConstElementPtr> list(definition->listValue());
int logpos(list[0]->intValue());
More information about the bind10-changes
mailing list