1 | /*
|
---|
2 | * Copyright 2002,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * $Id: KeyRefPair.c,v 1.5 2004/09/08 13:56:22 peiyongz Exp $
|
---|
19 | */
|
---|
20 |
|
---|
21 |
|
---|
22 | // ---------------------------------------------------------------------------
|
---|
23 | // Include
|
---|
24 | // ---------------------------------------------------------------------------
|
---|
25 | #if defined(XERCES_TMPLSINC)
|
---|
26 | #include <xercesc/util/KeyRefPair.hpp>
|
---|
27 | #endif
|
---|
28 |
|
---|
29 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
30 |
|
---|
31 | // ---------------------------------------------------------------------------
|
---|
32 | // KeyRefPair: Constructors and Destructor
|
---|
33 | // ---------------------------------------------------------------------------
|
---|
34 | template <class TKey, class TValue> KeyRefPair<TKey,TValue>::KeyRefPair()
|
---|
35 | {
|
---|
36 | }
|
---|
37 |
|
---|
38 | template <class TKey, class TValue> KeyRefPair<TKey,TValue>::
|
---|
39 | KeyRefPair(TKey* key, TValue* value) :
|
---|
40 |
|
---|
41 | fKey(key)
|
---|
42 | , fValue(value)
|
---|
43 | {
|
---|
44 | }
|
---|
45 |
|
---|
46 | template <class TKey, class TValue> KeyRefPair<TKey,TValue>::
|
---|
47 | KeyRefPair(const KeyRefPair<TKey,TValue>* toCopy) :
|
---|
48 |
|
---|
49 | fKey(toCopy->fKey)
|
---|
50 | , fValue(toCopy->fValue)
|
---|
51 | {
|
---|
52 | }
|
---|
53 |
|
---|
54 | template <class TKey, class TValue> KeyRefPair<TKey,TValue>::
|
---|
55 | KeyRefPair(const KeyRefPair<TKey,TValue>& toCopy) :
|
---|
56 |
|
---|
57 | fKey(toCopy.fKey)
|
---|
58 | , fValue(toCopy.fValue)
|
---|
59 | {
|
---|
60 | }
|
---|
61 |
|
---|
62 |
|
---|
63 | template <class TKey, class TValue> KeyRefPair<TKey,TValue>::~KeyRefPair()
|
---|
64 | {
|
---|
65 | }
|
---|
66 |
|
---|
67 |
|
---|
68 | // ---------------------------------------------------------------------------
|
---|
69 | // KeyRefPair: Getters
|
---|
70 | // ---------------------------------------------------------------------------
|
---|
71 | template <class TKey, class TValue> const TKey*
|
---|
72 | KeyRefPair<TKey,TValue>::getKey() const
|
---|
73 | {
|
---|
74 | return fKey;
|
---|
75 |
|
---|
76 | }
|
---|
77 |
|
---|
78 | template <class TKey, class TValue> TKey* KeyRefPair<TKey,TValue>::getKey()
|
---|
79 | {
|
---|
80 | return fKey;
|
---|
81 | }
|
---|
82 |
|
---|
83 | template <class TKey, class TValue> const TValue*
|
---|
84 | KeyRefPair<TKey,TValue>::getValue() const
|
---|
85 | {
|
---|
86 | return fValue;
|
---|
87 | }
|
---|
88 |
|
---|
89 | template <class TKey, class TValue> TValue* KeyRefPair<TKey,TValue>::getValue()
|
---|
90 | {
|
---|
91 | return fValue;
|
---|
92 | }
|
---|
93 |
|
---|
94 |
|
---|
95 | // ---------------------------------------------------------------------------
|
---|
96 | // KeyRefPair: Setters
|
---|
97 | // ---------------------------------------------------------------------------
|
---|
98 | template <class TKey, class TValue> TKey*
|
---|
99 | KeyRefPair<TKey,TValue>::setKey(TKey* newKey)
|
---|
100 | {
|
---|
101 | fKey = newKey;
|
---|
102 | return fKey;
|
---|
103 | }
|
---|
104 |
|
---|
105 | template <class TKey, class TValue> TValue*
|
---|
106 | KeyRefPair<TKey,TValue>::setValue(TValue* newValue)
|
---|
107 | {
|
---|
108 | fValue = newValue;
|
---|
109 | return fValue;
|
---|
110 | }
|
---|
111 |
|
---|
112 | XERCES_CPP_NAMESPACE_END
|
---|