00001 // OSB library ************************************************ -*- C++ -*- 00006 /* 00007 AUTHOR(S): Stephan Broennimann (vb) 00008 00009 RCS information 00010 $Name: OSB_060808 $ 00011 $Revision: 1.5 $ 00012 00013 License 00014 OSB rating and billing library for communication networks 00015 Copyright (C) 2004, 2005, 2006 OSB systems 00016 00017 This file may be distributed and/or modify under the terms of the 00018 GNU General Public License (GPL) as published by the Free Software 00019 Foundation which is provided in the file LICENSE.GPL included in the 00020 packaging of this file. 00021 00022 The file is distributed in the hope that it will be useful, but WITHOUT 00023 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00024 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00025 for more details. 00026 00027 Holders of a OSB Commercial License may use this file under the terms 00028 and conditions of this commercial license. 00029 */ 00030 #ifndef _UIMCARDLIST_H_ 00031 #define _UIMCARDLIST_H_ 00032 00033 // ************************************************************************ 00034 // included header files 00035 // + standard includes 00036 #include <map> 00037 00038 // + libraries 00039 00040 // + local headers 00041 #include "uimcard.h" 00042 00043 // + class declarations 00044 namespace OSB_DB { 00045 class Session; 00046 } 00047 00048 // ************************************************************************ 00049 // namespace extensions 00050 namespace OSB_LIB { 00051 00052 // ************************************************************************ 00053 // forward declarations 00054 00055 // ************************************************************************ 00056 // type definitions 00057 00058 // ************************************************************************ 00059 // class definitions 00063 struct UimCardFilter { 00065 long maxUim_; 00066 00068 00069 00078 short useIdFor_; 00080 Id<Device> dvcId_; 00082 Id<Resource> rsrcId_; 00084 Id<InventoryPool> poolId_; 00086 00088 00089 00090 bool useStatus_; 00092 Device::Status status_; 00094 00096 00097 00106 short usePatternFor_; 00108 std::string pattern_; 00110 00112 UimCardFilter(); 00113 }; // class UimCardFilter 00114 00118 class UimCardList { 00119 public: 00121 typedef std::map< Id<Device>, UimCard > UimCards; 00123 typedef UimCards::size_type Size; 00125 typedef UimCards::iterator Iter; 00127 typedef UimCards::const_iterator ConstIter; 00128 00129 public: 00131 UimCardList(); 00132 private: 00134 UimCardList(const UimCardList&); 00136 UimCardList& operator=(const UimCardList&); 00137 00138 public: // access to uimCards_ 00140 Size size() const; 00142 ConstIter begin() const; 00144 ConstIter end() const; 00145 public: 00154 void search( 00155 const OSB_DB::Session& session, 00156 const UimCardFilter& filter, 00157 bool merge 00158 ); 00165 void refresh( 00166 const OSB_DB::Session& session 00167 ); 00171 const UimCardFilter& filter() const; 00172 00182 const UimCard* find( 00183 const Id<Device> uimId, 00184 bool doThrow 00185 ) const; 00195 UimCard* find( 00196 const Id<Device> uimId, 00197 bool doThrow 00198 ); 00199 00201 void replace( 00202 const UimCard& uim 00203 ); 00205 void erase( 00206 const Id<Device> uimId 00207 ); 00209 void clear(); 00210 private: 00212 UimCards uimCards_; 00214 UimCardFilter filter_; 00215 }; // class UimCardList 00216 } // namespace OSB_LIB 00217 00218 // ************************************************************************ 00219 // inline definitions 00220 namespace OSB_LIB { 00221 } // namespace OSB_LIB 00222 #endif // #ifndef _UIMCARDLIST_H_