00001 // OSB library ************************************************ -*- C++ -*- 00006 /* 00007 AUTHOR(S): Stephan Broennimann (vb) 00008 00009 RCS information 00010 $Name: OSB_060808 $ 00011 $Revision: 1.6 $ 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 _RESOURCECACHE_H_ 00031 #define _RESOURCECACHE_H_ 00032 00033 // ************************************************************************ 00034 // included header files 00035 // + standard includes 00036 00037 // + libraries 00038 00039 // + local headers 00040 #include "osberror.h" 00041 #include "resourcefwd.h" 00042 00043 // + class declarations 00044 namespace OSB_DB { 00045 class Session; 00046 } 00047 namespace OSB_LIB { 00048 class DateTime; 00049 class ModuleConfig; 00050 class RatedParty; 00051 } 00052 00053 // ************************************************************************ 00054 // namespace extensions 00055 namespace OSB_LIB { 00056 00057 // ************************************************************************ 00058 // forward declarations 00059 00060 // ************************************************************************ 00061 // type definitions 00062 00063 // ************************************************************************ 00064 // class definitions 00069 class ResourceCache { 00070 public: 00080 explicit ResourceCache(bool useLocks); 00082 virtual ~ResourceCache(); 00083 private: 00085 00086 00087 ResourceCache(const ResourceCache&); 00089 ResourceCache& operator=(const ResourceCache&); 00091 public: 00093 00094 00117 virtual bool getDetails( 00118 const OSB_DB::Session& session, 00119 const DateTime& ts, 00120 RatedParty* rp, 00121 OsbError* error 00122 ) = 0; 00124 00126 00127 00134 virtual bool initialize( 00135 const OSB_DB::Session& session, 00136 const ModuleConfig& config 00137 ) = 0; 00147 virtual void finalize( 00148 bool doLog 00149 ) = 0; 00151 00152 protected: 00154 00155 00156 static OsbError noResourceType(); 00158 static OsbError notSupported(ResourceType type); 00160 }; // class ResourceCache 00161 } // namespace OSB_LIB 00162 00163 // ************************************************************************ 00164 // inline definitions 00165 namespace OSB_LIB { 00166 } // namespace OSB_LIB 00167 #endif // #ifndef _RESOURCECACHE_H_