BIND 10 trac2376, updated. 5a110df6b6634a161c391d37abcf12fddb26ae16 [2376] Documentation for the interface
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Nov 6 18:37:22 UTC 2012
The branch, trac2376 has been updated
via 5a110df6b6634a161c391d37abcf12fddb26ae16 (commit)
from b951d94c2d889e6d014ffd8bf54cc9231bfc4c0b (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 5a110df6b6634a161c391d37abcf12fddb26ae16
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Tue Nov 6 19:36:53 2012 +0100
[2376] Documentation for the interface
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/loader_context.h | 40 ++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/loader_context.h b/src/lib/datasrc/loader_context.h
index c31cad4..7b6981a 100644
--- a/src/lib/datasrc/loader_context.h
+++ b/src/lib/datasrc/loader_context.h
@@ -24,21 +24,61 @@ namespace datasrc {
class ZoneUpdater;
+/// \brief Implementation of the MasterLoaderContextBase to feed a ZoneUpdater
+///
+/// This is a concrete implementation of the MasterLoaderContextBase interface.
+/// It can be used to put the loaded data into a data source through a
+/// ZoneUpdater. The errors and warnings are simply logged.
+///
+/// It makes no real sense to copy such class, so it is noncopyable.
class LoaderContext : public isc::dns::MasterLoaderContextBase,
boost::noncopyable {
public:
+ /// \brief Constructor
+ ///
+ /// \param updater The zone updater to use. It should be a clean updater
+ /// (no changes done to it yet). It is up to the caller to commit or
+ /// rollback the updater after the loading is done.
LoaderContext(ZoneUpdater& updater);
+ /// \brief Adds a new rrset to the updater.
+ ///
+ /// This is implementation of the interface's method.
+ ///
+ /// \param rrset The rrset to add.
virtual void addRRset(const isc::dns::RRsetPtr& rrset);
+ /// \brief Return the problem-handling callbacks.
+ ///
+ /// This is implementation of the interface's method.
+ ///
+ /// \return Structure holding the callbacks that can be used to report
+ /// errors.
virtual isc::dns::LoaderCallbacks& getCallbacks() const {
return (callbacks_);
}
+ /// \brief Was the load successful?
+ ///
+ /// \return True if the load was successful so far - which means no
+ /// getCallbacks().error() was called yet. False otherwise.
+ bool ok() const {
+ return (ok_);
+ }
private:
+ /// \brief Internal handler of error.
void handleError(const std::string& source, size_t line, size_t byte,
const std::string& reason);
+ /// \brief Internal handle of warning.
void handleWarning(const std::string& source, size_t line, size_t byte,
const std::string& reason);
+ /// \brief The callbacks to be returned.
+ ///
+ /// They need to exist as a real variable. It also needs to be mutable,
+ /// since the getCallbacks() is const method and it returns a non-const
+ /// reference. It needs to be non-const, to be possible to call the
+ /// the actual callbacks (the operator() might be non-const).
mutable isc::dns::LoaderCallbacks callbacks_;
+ /// \brief The updater to be used.
ZoneUpdater& updater_;
+ /// \brief Was the load successful?
bool ok_;
};
More information about the bind10-changes
mailing list