zone_table_segment_local.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright (C) 2012 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 __ZONE_TABLE_SEGMENT_LOCAL_H__
  15. #define __ZONE_TABLE_SEGMENT_LOCAL_H__
  16. #include <datasrc/memory/zone_table_segment.h>
  17. #include <util/memory_segment_local.h>
  18. namespace isc {
  19. namespace datasrc {
  20. namespace memory {
  21. /// \brief Local implementation of ZoneTableSegment class
  22. ///
  23. /// This class specifies a concrete implementation for a
  24. /// MemorySegmentLocal based ZoneTableSegment. Please see the
  25. /// ZoneTableSegment class documentation for usage.
  26. class ZoneTableSegmentLocal : public ZoneTableSegment {
  27. // This is so that ZoneTableSegmentLocal can be instantiated from
  28. // ZoneTableSegment::create().
  29. friend class ZoneTableSegment;
  30. protected:
  31. /// \brief Protected constructor
  32. ///
  33. /// Instances are expected to be created by the factory method
  34. /// (\c ZoneTableSegment::create()), so this constructor is
  35. /// protected.
  36. ZoneTableSegmentLocal()
  37. {}
  38. public:
  39. /// \brief Destructor
  40. virtual ~ZoneTableSegmentLocal() {}
  41. /// \brief Return the ZoneTableHeader for the local zone table
  42. /// segment implementation.
  43. virtual ZoneTableHeader& getHeader();
  44. /// \brief const version of \c getHeader().
  45. virtual const ZoneTableHeader& getHeader() const;
  46. /// \brief Return the MemorySegment for the local zone table segment
  47. /// implementation (a MemorySegmentLocal instance).
  48. virtual isc::util::MemorySegment& getMemorySegment();
  49. private:
  50. ZoneTableHeader header_;
  51. isc::util::MemorySegmentLocal mem_sgmt_;
  52. };
  53. } // namespace memory
  54. } // namespace datasrc
  55. } // namespace isc
  56. #endif // __ZONE_TABLE_SEGMENT_LOCAL_H__