QueryImpl.h 877 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef NETWORK_DNS_QUERYIMPL_H
  2. #define NETWORK_DNS_QUERYIMPL_H
  3. #include "Data.h"
  4. #include "DataReader.h"
  5. #include "NameImpl.h"
  6. #include "Dns/QueryClass.h"
  7. #include "Dns/QueryType.h"
  8. namespace Network {
  9. namespace Dns {
  10. class QueryImpl
  11. {
  12. public:
  13. QueryImpl();
  14. bool GetUnicast() const;
  15. QueryType::type GetType() const;
  16. QueryClass::type GetClass() const;
  17. NameImpl GetName() const;
  18. void SetUnicast(bool unicast);
  19. void SetType(QueryType::type type);
  20. void SetClass(QueryClass::type class_);
  21. void SetName(const NameImpl& name);
  22. Data GetData() const;
  23. unsigned ReadFromData(DataReader reader, unsigned pos);
  24. friend std::ostream& operator<<(std::ostream & stream, const QueryImpl& query);
  25. private:
  26. bool m_unicast;
  27. NameImpl m_name;
  28. QueryType::type m_type;
  29. QueryClass::type m_class;
  30. };
  31. } // namespace Dns
  32. } // namespace Network
  33. #endif // NETWORK_DNS_QUERYIMPL_H