data_source.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. #ifndef __DATA_SOURCE_H
  15. #define __DATA_SOURCE_H
  16. #include <stdint.h>
  17. #include <vector>
  18. #include <boost/shared_ptr.hpp>
  19. #include <exceptions/exceptions.h>
  20. #include <dns/name.h>
  21. #include <dns/rrclass.h>
  22. #include <cc/data.h>
  23. namespace isc {
  24. namespace dns {
  25. class Name;
  26. class RRType;
  27. class RRset;
  28. class RRsetList;
  29. }
  30. namespace datasrc {
  31. /// This exception represents Backend-independent errors relating to
  32. /// data source operations.
  33. class DataSourceError : public Exception {
  34. public:
  35. DataSourceError(const char* file, size_t line, const char* what) :
  36. isc::Exception(file, line, what) {}
  37. };
  38. /// \brief No such serial number when obtaining difference iterator
  39. ///
  40. /// Thrown if either the zone/start serial number or zone/end serial number
  41. /// combination does not exist in the differences table. (Note that this
  42. /// includes the case where the differences table contains no records related
  43. /// to that zone.)
  44. class NoSuchSerial : public DataSourceError {
  45. public:
  46. NoSuchSerial(const char* file, size_t line, const char* what) :
  47. DataSourceError(file, line, what) {}
  48. };
  49. }
  50. }
  51. #endif
  52. // Local Variables:
  53. // mode: c++
  54. // End: