summaryrefslogtreecommitdiff
path: root/ace/Pair_T.h
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-02-06 04:25:54 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-02-06 04:25:54 +0000
commit0d8ee7e4258f06f26d0a9dbb467ecf573dc5d689 (patch)
treea00a40326372f5fade152590802b12891788f2a3 /ace/Pair_T.h
parent93735413191d08c245df27e593d79aba9482efc2 (diff)
downloadATCD-0d8ee7e4258f06f26d0a9dbb467ecf573dc5d689.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/Pair_T.h')
-rw-r--r--ace/Pair_T.h112
1 files changed, 112 insertions, 0 deletions
diff --git a/ace/Pair_T.h b/ace/Pair_T.h
new file mode 100644
index 00000000000..1e9ffd80fe3
--- /dev/null
+++ b/ace/Pair_T.h
@@ -0,0 +1,112 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// ace
+//
+// = FILENAME
+// Pair_T.h
+//
+// = AUTHOR
+// Irfan Pyarali
+//
+// ============================================================================
+
+#ifndef ACE_PAIR_T_H
+#define ACE_PAIR_T_H
+
+#include "ace/Pair.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+////////////////////////////////////////////////////////////////////////////////
+
+template <class T1, class T2>
+class ACE_Pair
+{
+ // = TITLE
+ // Defines a pair.
+ //
+ // = DESCRIPTION
+ // Similar to the STL pair.
+public:
+
+ // = Traits.
+ typedef T1 first_type;
+ typedef T2 second_type;
+
+ // = Initialization and termination methods.
+ ACE_Pair (const T1 &t1,
+ const T2 &t2);
+ // Constructor.
+
+ ACE_Pair (void);
+ // Default constructor.
+
+ T1 &first (void);
+ void first (const T1 &t1);
+ // Get/Set first.
+
+ T2 &second (void);
+ void second (const T2 &t2);
+ // Access second.
+
+protected:
+
+ T1 first_;
+ T2 second_;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
+template <class T1, class T2>
+class ACE_Reference_Pair
+{
+ // = TITLE
+ // Defines a pair that only hold references.
+ //
+ // = DESCRIPTION
+ // Similar to the STL pair (but restricted to holding references
+ // and not copies).
+public:
+
+ // = Traits.
+ typedef T1 first_type;
+ typedef T2 second_type;
+
+ // = Initialization and termination methods.
+ ACE_Reference_Pair (T1 &t1,
+ T2 &t2);
+ // Constructor.
+
+ T1 &first (void);
+ // Access first.
+
+ T2 &second (void);
+ // Access second.
+
+protected:
+
+ T1 &first_;
+ T2 &second_;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
+#if defined (__ACE_INLINE__)
+#include "ace/Pair_T.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "ace/Pair_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation "Pair_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* ACE_PAIR_T_H */