You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.9 KiB

  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /*
  18. * $Id: KeyValuePair.c 471747 2006-11-06 14:31:56Z amassari $
  19. */
  20. // ---------------------------------------------------------------------------
  21. // Include
  22. // ---------------------------------------------------------------------------
  23. #if defined(XERCES_TMPLSINC)
  24. #include <xercesc/util/KeyValuePair.hpp>
  25. #endif
  26. XERCES_CPP_NAMESPACE_BEGIN
  27. // ---------------------------------------------------------------------------
  28. // KeyValuePair: Constructors and Destructor
  29. // ---------------------------------------------------------------------------
  30. template <class TKey, class TValue> KeyValuePair<TKey,TValue>::KeyValuePair()
  31. {
  32. }
  33. template <class TKey, class TValue> KeyValuePair<TKey,TValue>::
  34. KeyValuePair(const TKey& key, const TValue& value) :
  35. fKey(key)
  36. , fValue(value)
  37. {
  38. }
  39. template <class TKey, class TValue> KeyValuePair<TKey,TValue>::
  40. KeyValuePair(const KeyValuePair<TKey,TValue>& toCopy) :
  41. fKey(toCopy.fKey)
  42. , fValue(toCopy.fValue)
  43. {
  44. }
  45. template <class TKey, class TValue> KeyValuePair<TKey,TValue>::~KeyValuePair()
  46. {
  47. }
  48. // ---------------------------------------------------------------------------
  49. // KeyValuePair: Getters
  50. // ---------------------------------------------------------------------------
  51. template <class TKey, class TValue> const TKey&
  52. KeyValuePair<TKey,TValue>::getKey() const
  53. {
  54. return fKey;
  55. }
  56. template <class TKey, class TValue> TKey& KeyValuePair<TKey,TValue>::getKey()
  57. {
  58. return fKey;
  59. }
  60. template <class TKey, class TValue> const TValue&
  61. KeyValuePair<TKey,TValue>::getValue() const
  62. {
  63. return fValue;
  64. }
  65. template <class TKey, class TValue> TValue& KeyValuePair<TKey,TValue>::getValue()
  66. {
  67. return fValue;
  68. }
  69. // ---------------------------------------------------------------------------
  70. // KeyValuePair: Setters
  71. // ---------------------------------------------------------------------------
  72. template <class TKey, class TValue> TKey&
  73. KeyValuePair<TKey,TValue>::setKey(const TKey& newKey)
  74. {
  75. fKey = newKey;
  76. return fKey;
  77. }
  78. template <class TKey, class TValue> TValue&
  79. KeyValuePair<TKey,TValue>::setValue(const TValue& newValue)
  80. {
  81. fValue = newValue;
  82. return fValue;
  83. }
  84. XERCES_CPP_NAMESPACE_END