[svn] commit: r522 - in /branches/parkinglot/src/lib/cc/cpp: data_def.cc data_def.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Jan 26 20:16:56 UTC 2010
Author: jelte
Date: Tue Jan 26 20:16:56 2010
New Revision: 522
Log:
rest of doxygen for DataDefinition class
Modified:
branches/parkinglot/src/lib/cc/cpp/data_def.cc
branches/parkinglot/src/lib/cc/cpp/data_def.h
Modified: branches/parkinglot/src/lib/cc/cpp/data_def.cc
==============================================================================
--- branches/parkinglot/src/lib/cc/cpp/data_def.cc (original)
+++ branches/parkinglot/src/lib/cc/cpp/data_def.cc Tue Jan 26 20:16:56 2010
@@ -121,8 +121,8 @@
static void
check_data_specification(const ElementPtr& spec) {
check_leaf_item(spec, "module_name", Element::string, true);
- // not mandatory; module could just define commands and have
- // no config
+ // config_data is not mandatory; module could just define
+ // commands and have no config
if (spec->contains("config_data")) {
check_config_item_list(spec->get("config_data"));
}
@@ -140,7 +140,7 @@
throw DataDefinitionError("Data specification does not contain data_specification element");
} else {
check_data_specification(def->get("data_specification"));
- }
+ }
}
DataDefinition::DataDefinition(std::istream& in, const bool check)
Modified: branches/parkinglot/src/lib/cc/cpp/data_def.h
==============================================================================
--- branches/parkinglot/src/lib/cc/cpp/data_def.h (original)
+++ branches/parkinglot/src/lib/cc/cpp/data_def.h Tue Jan 26 20:16:56 2010
@@ -9,7 +9,7 @@
///
/// A standard DataDefinition exception that is thrown when a
- /// .spec file could not be parsed.
+ /// specification is not in the correct form.
///
/// TODO: use jinmei's exception class as a base and not c_str in
/// what() there
@@ -29,6 +29,9 @@
/// This class holds that specification, and provides a function to
/// validate a set of data, to see whether it conforms to the given
/// specification
+ ///
+ /// The form of the specification is described in doc/ (TODO)
+ ///
class DataDefinition {
public:
explicit DataDefinition() {};
@@ -37,12 +40,26 @@
/// \param e The Element containing the data specification
explicit DataDefinition(ElementPtr e) : definition(e) {};
// todo: make check default false, or leave out option completely and always check?
+ /// Creates a \c DataDefinition instance from the given .spec
+ /// file stream. If check is true, and the definition is not of
+ /// the correct form, a DataDefinitionError is thrown. If the
+ /// file could not be parsed, a ParseError is thrown.
+ /// \param in The std::istream containing the .spec file data
+ /// \param check If true, the data definition is checked to be
+ /// of the correct form
explicit DataDefinition(std::istream& in, const bool check = true)
throw(ParseError, DataDefinitionError);
+ /// Returns the base \c element of the data definition contained
+ /// by this instance
+ /// \return ElementPtr Shared pointer to the data definition
const ElementPtr getDefinition() { return definition; };
// returns true if the given element conforms to this data
// definition scheme
+ /// Validates the given data for this specification.
+ /// \param data The base \c Element of the data to check
+ /// \return true if the data conforms to the specification,
+ /// false otherwise.
bool validate(const ElementPtr data);
private:
More information about the bind10-changes
mailing list