benchmark_util.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright (C) 2010 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. // $Id$
  15. #ifndef __BENCHMARK_UTIL_H
  16. #define __BENCHMARK_UTIL_H 1
  17. #include <istream>
  18. #include <vector>
  19. #include <exceptions/exceptions.h>
  20. namespace isc {
  21. namespace dns {
  22. class RRClass;
  23. }
  24. namespace bench {
  25. class BenchMarkError : public Exception {
  26. public:
  27. BenchMarkError(const char* file, size_t line, const char* what) :
  28. isc::Exception(file, line, what) {}
  29. };
  30. typedef std::vector<std::vector<unsigned char> > BenchQueries;
  31. /// Describe exception guarantee. This function only offers the basic
  32. /// exception guarantee.
  33. void loadQueryData(const char* input_file, BenchQueries& queries,
  34. const isc::dns::RRClass& qclass, const bool strict = false);
  35. void loadQueryData(std::istream& input, BenchQueries& queries,
  36. const isc::dns::RRClass& qclass, const bool strict = false);
  37. }
  38. }
  39. #endif // __BENCHMARK_UTIL_H
  40. // Local Variables:
  41. // mode: c++
  42. // End: