00001 /************************************************************************/ 00002 /* This file is part of openMask(c) INRIA, CNRS, Universite de Rennes 1 */ 00003 /* 1993-2002, thereinafter the Software */ 00004 /* */ 00005 /* The Software has been developped within the Siames Project. */ 00006 /* INRIA, the University of Rennes 1 and CNRS jointly hold intellectual */ 00007 /* property rights */ 00008 /* */ 00009 /* The Software has been registered with the Agence pour la Protection */ 00010 /* des Programmes (APP) under registration number */ 00011 /* IDDN.FR.001.510008.00.S.P.2001.000.41200 */ 00012 /* */ 00013 /* This file may be distributed under the terms of the Q Public License */ 00014 /* version 1.0 as defined by Trolltech AS of Norway and appearing in */ 00015 /* the file LICENSE.QPL included in the packaging of this file. */ 00016 /* */ 00017 /* Licensees holding valid specific licenses issued by INRIA, CNRS or */ 00018 /* Universite Rennes 1 for the software may use this file in */ 00019 /* acordance with that specific license */ 00020 /************************************************************************/ 00021 00022 00023 #if !defined _ACCESSLEVEL_INL_ 00024 #define _ACCESSLEVEL_INL_ 00025 00026 #include "OMKAccessLevelList.h" 00027 #include "OMKSimulatedObject.h" 00028 #include "OMKParametersAccessor.inl" 00029 #include "OMKBaseType.h" 00030 00031 namespace OMK 00032 { 00033 namespace Type 00034 { 00035 00036 //======================================================================== 00037 // Default constructor 00038 template< typename ItemType > 00039 AccessLevelList< ItemType >::AccessLevelList() 00040 : AccessGroup(), 00041 _items() 00042 { 00043 } 00044 00045 //------------------------------------------------------------------------ 00046 // Copy constructor 00047 template< typename ItemType > 00048 AccessLevelList< ItemType >::AccessLevelList( const AccessLevelList& ref ) 00049 { 00050 _copy( ref ) ; 00051 } 00052 00053 //------------------------------------------------------------------------ 00054 // Constructor with the parameters 00055 template< typename ItemType > 00056 AccessLevelList< ItemType >::AccessLevelList( OMK::Name group, AccessLevel accessLevel ) 00057 : AccessGroup( group, accessLevel ), 00058 _items() 00059 { 00060 } 00061 00062 //------------------------------------------------------------------------ 00063 // Constructor with the parameters 00064 template< typename ItemType > 00065 AccessLevelList< ItemType >::AccessLevelList( const AccessGroup& access ) 00066 : AccessGroup( access ), 00067 _items() 00068 { 00069 } 00070 00071 //------------------------------------------------------------------------ 00072 // Constructor with the parameters 00073 template< typename ItemType > 00074 AccessLevelList< ItemType >::AccessLevelList( OMK::Name group, AccessLevel accessLevel, const std::list< ItemType >& items ) 00075 : AccessGroup( group, accessLevel ), 00076 _items( items ) 00077 { 00078 } 00079 00080 //------------------------------------------------------------------------ 00081 // Destructor 00082 template< typename ItemType > 00083 AccessLevelList< ItemType >::~AccessLevelList() 00084 { 00085 } 00086 00087 //------------------------------------------------------------------------ 00088 // copy operator 00089 template< typename ItemType > 00090 AccessLevelList< ItemType >& AccessLevelList< ItemType >::operator = ( const AccessLevelList& ref ) 00091 { 00092 if ( this != &ref ) 00093 { 00094 _copy( ref ) ; 00095 } 00096 return *this ; 00097 } 00098 00099 //------------------------------------------------------------------------ 00100 // Protected copy methods 00101 template< typename ItemType > 00102 void AccessLevelList< ItemType >::_copy( const AccessLevelList& ref ) 00103 { 00104 00105 AccessGroup::_copy( ref ) ; 00106 _items = ref._items ; 00107 } 00108 00109 //======================================================================== 00110 00111 } //namespace Type 00112 } //namespace OMK 00113 00114 //======================================================================== 00115 // insert in stream 00116 template< typename ItemType > 00117 std::ostream& operator << ( std::ostream& out, const OMK::Type::AccessLevelList< ItemType >& prm ) 00118 { 00119 out << (OMK::Type::AccessGroup)prm << " " 00120 << prm._items << " " 00121 << " " ; 00122 return out ; 00123 } 00124 00125 //======================================================================== 00126 // extract from a stream 00127 template< typename ItemType > 00128 std::istream& operator >> ( std::istream& in, OMK::Type::AccessLevelList< ItemType >& prm ) 00129 { 00130 in >> (OMK::Type::AccessGroup)prm ; 00131 in >> prm._items ; 00132 return in ; 00133 } 00134 00135 //======================================================================== 00136 // pack 00137 template< typename ItemType > 00138 OMK::OutgoingSynchronisationMessage& operator << 00139 ( OMK::OutgoingSynchronisationMessage& out, const OMK::Type::AccessLevelList< ItemType >& prm ) 00140 { 00141 out << (OMK::Type::AccessGroup)prm ; 00142 out << prm._items ; 00143 return out ; 00144 } 00145 00146 //======================================================================== 00147 // unpack 00148 template< typename ItemType > 00149 OMK::IncomingSynchronisationMessage& operator >> 00150 ( OMK::IncomingSynchronisationMessage& in, OMK::Type::AccessLevelList< ItemType >& prm ) 00151 { 00152 in >> (OMK::Type::AccessGroup)prm ; 00153 in >> prm._items ; 00154 return in ; 00155 } 00156 00157 #endif // defined _ACCESSLEVEL_INL_
Documentation generated on Mon Jun 9 11:45:55 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |