cdrio.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00013 /*
00014   AUTHOR(S): Darryl Kang (dk)
00015              Stephan Broennimann (vb)
00016 
00017   RCS information
00018    $Name: OSB_060808 $
00019    $Revision: 1.17 $
00020 
00021   License
00022    OSB rating and billing library for communication networks
00023    Copyright (C) 2004, 2005, 2006  OSB systems
00024 
00025    This file may be distributed and/or modify under the terms of the
00026    GNU General Public License (GPL) as published by the Free Software
00027    Foundation which is provided in the file LICENSE.GPL included in the
00028    packaging of this file.
00029 
00030    The file is distributed in the hope that it will be useful, but WITHOUT
00031    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00032    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00033    for more details.
00034 
00035    Holders of a OSB Commercial License may use this file under the terms
00036    and conditions of this commercial license.
00037  */
00038 #ifndef _CDRIO_H_
00039 #define _CDRIO_H_
00040 
00041 // *********************************************************************
00042 // included header files
00043 // + standard includes
00044 #include <iosfwd>
00045 #include <vector>
00046 #include <memory>
00047 
00048 // + local headers
00049 
00050 // *********************************************************************
00051 // class declarations
00052 namespace OSB_LIB {
00053     class Asn1Writer;
00054     class CdrList;
00055     class BsPage;
00056     template<typename T> class Id;
00057 }
00058 
00059 // *********************************************************************
00060 // namespace extensions
00061 namespace OSB_LIB {
00062 
00063 // *********************************************************************
00064 // class definitions
00065 
00066     // *****************************************************************
00067     // class CdrIo
00077     class CdrIo {
00078     public:
00080         virtual ~CdrIo();
00081 
00083         virtual std::auto_ptr<CdrIo> clone() const = 0;
00084 
00086         virtual const Id<BsPage>& pageId() const = 0;
00087 
00095         virtual void read(
00096             CdrList& dest
00097         ) = 0;
00098 
00104         virtual void prepareWrite() = 0;
00105 
00115         virtual void write(
00116             const CdrList&    cdrs,
00117                   Asn1Writer& writer
00118         ) = 0;
00119 
00127         virtual void replace(
00128             const CdrList& newCdrs,
00129                   Asn1Writer& writer
00130         ) = 0;
00131 
00143         virtual bool commitChanges() = 0;
00144 
00155         virtual bool undoChanges() = 0;
00156 
00170         virtual bool remove() = 0;
00171 
00172     public:
00174         static void setBaseDir(const std::string& dir);
00176         static std::string baseDir_;
00177 
00179         static long maxFileSize_;
00180     };                                  // class CdrIo
00181 
00188     std::auto_ptr<CdrIo> makeCdrIo(const Id<BsPage>& pageId);
00189 
00190 }                                       // namespace OSB_LIB
00191 #endif                                  // #ifndef _CDRIO_H_
00192 

Generated on Sat Sep 2 14:06:32 2006 for OSB Library by  doxygen 1.4.7