00001 /* 00002 * This file is part of openMask © INRIA, CNRS, Universite de Rennes 1 1993-2002, thereinafter the Software 00003 * 00004 * The Software has been developped within the Siames Project. 00005 * INRIA, the University of Rennes 1 and CNRS jointly hold intellectual property rights 00006 * 00007 * The Software has been registered with the Agence pour la Protection des 00008 * Programmes (APP) under registration number IDDN.FR.001.510008.00.S.P.2001.000.41200 00009 * 00010 * This file may be distributed under the terms of the Q Public License 00011 * version 1.0 as defined by Trolltech AS of Norway and appearing in the file 00012 * LICENSE.QPL included in the packaging of this file. 00013 * 00014 * Licensees holding valid specific licenses issued by INRIA, CNRS or Université de Rennes 1 00015 * for the software may use this file in accordance with that specific license 00016 * 00017 */ 00018 #ifndef PsPairHEADER 00019 #define PsPairHEADER 00020 00021 #include <iostream> 00022 #ifdef _PAIRNOTSTD 00023 #include <utility> 00024 #else 00025 #include <pair.h> 00026 #endif 00027 #include "PsType.h" 00028 #include "PsPolator.h" 00029 00030 00037 template < typename T1 , typename T2> 00038 class PsPair : public pair<T1,T2>, public PsType 00039 { 00040 public: 00042 PsPair(const T1 & t1, const T2 & t2) : 00043 pair<T1,T2>(t1,t2) , 00044 PsType() 00045 { 00046 00047 } 00048 00050 PsPair ( const PsPair & orig ): 00051 pair<T1, T2> (orig.first, orig.second ), 00052 PsType() 00053 { 00054 00055 } 00056 00057 00059 PsPair() : 00060 pair<T1,T2>(), 00061 PsType () 00062 { 00063 00064 } 00065 00066 00067 00068 virtual ~PsPair() 00069 { 00070 00071 } 00072 00075 virtual PsPolatorNT * createPolator (void) 00076 { 00077 return new PsPolator<PsPair<T1,T2> >() ; 00078 } 00079 00081 virtual void pack (PsOutgoingSynchronisationMessage & out ) const 00082 { 00083 out <<first 00084 <<second ; 00085 } 00086 00088 virtual void unpack (PsIncomingSynchronisationMessage & in ) 00089 { 00090 in >>first 00091 >>second ; 00092 } 00093 00096 virtual void extract (istream & in) 00097 { 00098 in >> first 00099 >> second ; 00100 } 00101 00104 virtual void insertInStream (ostream & out) const 00105 { 00106 out<< first <<" " 00107 << second <<" " ; 00108 } 00109 00110 }; 00111 00112 #endif
| Documentation generated on Mon Nov 25 15:25:02 2002 |
Generated with doxygen 1.2.12 by Dimitri van Heesch , 1997-2001 |