1:
2:
3: /**********************
4: * *
5: * COMPILER INCLUDES *
6: * *
7: **********************/
8:
9:
10: #include <cassert>
11:
12:
13: /*********************
14: * *
15: * PROJECT INCLUDES *
16: * *
17: *********************/
18:
19:
20: #include "dnsutil.h"
21: #include "question.h"
22:
23:
24: /**************************
25: * *
26: * QUESTION CONSTRUCTORS *
27: * *
28: **************************/
29:
30:
31: Question::Question(const char *i_strName, RRType i_ty, RRClass i_cl) {
32: m_llpName = new LabelList(i_strName);
33: m_ty = i_ty;
34: m_cl = i_cl;
35: }
36:
37:
38: Question::Question(LabelListPtr &i_llpr, RRType i_ty, RRClass i_cl) {
39: m_llpName = i_llpr;
40: i_llpr = NULL;
41: m_ty = i_ty;
42: m_cl = i_cl;
43: }
44:
45:
46: Question::Question(const Question &ci_qnr, LabelListConstPtr ci_llpCName) {
47: m_llpName = new LabelList(*ci_llpCName);
48: m_ty = ci_qnr.m_ty;
49: m_cl = ci_qnr.m_cl;
50: }
51:
52:
53: Question::Question(const Question &ci_qnr) {
54: m_llpName = new LabelList(*ci_qnr.m_llpName);
55: m_ty = ci_qnr.m_ty;
56: m_cl = ci_qnr.m_cl;
57: }
58:
59:
60: /************************
61: * *
62: * QUESTION DESTRUCTOR *
63: * *
64: ************************/
65:
66:
67: Question::~Question() {
68: SoftDelete(m_llpName);
69: }
70:
71:
72: /*****************
73: * *
74: * OPERATORS << *
75: * *
76: *****************/
77:
78:
79: ostream& operator<<(ostream& io_smr, QuestionConstPtr ci_qnp) {
80: io_smr << ci_qnp->GetName() << " "
81: << GetClassName((RRClass)ci_qnp->GetClass()) << " "
82: << GetTypeName((RRType)ci_qnp->GetType());
83: return io_smr;
84: }
85:
86:
87: ostream& operator<<(ostream& io_smr, const Question &ci_qnr) {
88: io_smr << &ci_qnr;
89: return io_smr;
90: }
91:
92:
93: