Initial Patch of Auction House bot rev. 135
[auctionmangos.git] / dep / ACE_wrappers / ace / Pair_T.h
blob2f744ec4d0a5bb4106e92c6631ede27b8af2f6b2
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file Pair_T.h
7 * $Id: Pair_T.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Irfan Pyarali <irfan@cs.wustl.edu>
11 //=============================================================================
14 #ifndef ACE_PAIR_T_H
15 #define ACE_PAIR_T_H
16 #include /**/ "ace/pre.h"
18 #include /**/ "ace/config-all.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 /**
27 * @class ACE_Pair
29 * @brief Defines a pair.
31 * Similar to the STL pair.
33 template <class T1, class T2>
34 class ACE_Pair
36 public:
38 // = Traits.
39 typedef T1 first_type;
40 typedef T2 second_type;
42 // = Initialization and termination methods.
43 /// Constructor.
44 ACE_Pair (const T1 &t1,
45 const T2 &t2);
47 /// Default constructor.
48 ACE_Pair (void);
50 /// Get first.
51 T1 &first (void);
52 const T1 &first (void) const;
54 /// Set first.
55 void first (const T1 &t1);
57 /// Get second.
58 T2 &second (void);
59 const T2 &second (void) const;
61 /// Set second.
62 void second (const T2 &t2);
64 // Compare pairs.
65 bool operator== (const ACE_Pair<T1, T2> &rhs) const;
67 protected:
68 /// First.
69 T1 first_;
71 /// Second.
72 T2 second_;
75 /**
76 * @class ACE_Reference_Pair
78 * @brief Defines a pair that only hold references.
80 * Similar to the STL pair (but restricted to holding references
81 * and not copies).
83 template <class T1, class T2>
84 class ACE_Reference_Pair
86 public:
88 // = Traits.
89 typedef T1 first_type;
90 typedef T2 second_type;
92 // = Initialization and termination methods.
93 /// Constructor.
94 ACE_Reference_Pair (T1 &t1,
95 T2 &t2);
97 /// Access first.
98 T1 &first (void) const;
100 /// Access second.
101 T2 &second (void) const;
103 // Compare pairs.
104 bool operator== (const ACE_Reference_Pair<T1, T2> &rhs) const;
106 protected:
107 /// First.
108 T1 &first_;
110 /// Second.
111 T2 &second_;
114 ACE_END_VERSIONED_NAMESPACE_DECL
116 #if defined (__ACE_INLINE__)
117 #include "ace/Pair_T.inl"
118 #endif /* __ACE_INLINE__ */
120 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
121 #include "ace/Pair_T.cpp"
122 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
124 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
125 #pragma implementation ("Pair_T.cpp")
126 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
128 #include /**/ "ace/post.h"
129 #endif /* ACE_PAIR_T_H */