errrecordfile.h

Go to the documentation of this file.
00001 // OSB library ************************************************ -*- C++ -*-
00006 /*
00007   AUTHOR(S): Stephan Broennimann (vb)
00008 
00009   RCS information
00010    $Name: OSB_060808 $
00011    $Revision: 1.13 $
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 _ERRRECORDFILE_H_
00031 #define _ERRRECORDFILE_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + libraries
00038 
00039 // + local headers
00040 #include "cdrfile.h"
00041 #include "recordstream.h"
00042 
00043 // + class declarations
00044 namespace OSB_LIB {
00045     class DateTime;
00046 }
00047 
00048 namespace OSB_DB {
00049     class Session;
00050 }
00051 
00052 // ************************************************************************
00053 // namespace extensions
00054 namespace OSB_LIB {
00055 
00056 // ************************************************************************
00057 // class definitions
00061     class ErrRecordFile {
00062     public:
00078         ErrRecordFile(
00079                   Asn1Writer&        writer,
00080             const std::string&       format,
00081                   RecordStream::Type type,
00082             const size_t             blockSize = 0,
00083             const char               filler    = 0x00
00084           );
00085     private:
00087         ErrRecordFile(const ErrRecordFile&);
00089         ErrRecordFile& operator=(const ErrRecordFile&);
00090 
00091     public:
00104         OsbError beginStream(
00105             const OSB_DB::Session&  session,
00106             const RecordStreamInfo& input
00107         );
00108 
00117         bool write(
00118             const Cdr&        cdr,
00119                   OsbError&   error
00120         );
00121 
00132         bool write(
00133             const std::string& record,
00134             const DateTime&    timeStamp,
00135                   OsbError&    error
00136         );
00137 
00146         bool write(
00147             const Asn1Data& asn1,
00148                   OsbError& error
00149         );
00150 
00161         OsbError closeFile();
00162 
00173         OsbError storeCdrs(
00174             const OSB_DB::Session&  session,
00175             const RecordStreamInfo& input
00176         );
00177 
00184         OsbError endStream();
00185 
00201         bool undoChanges(
00202             OSB_DB::Session& session
00203         );
00204 
00205     public:
00207         void setBaseDir(const std::string& baseDir);
00208 
00209     private:
00211         Asn1Writer& asn1Writer_;
00212 
00214         RecordStreamInfo::Oid inputId_;
00216         RecordStreamInfo rsInfo_;
00218         CdrOutputFile outFile_;
00219 
00221         std::string format_;
00223         RecordStream::Type streamType_;
00225         std::string cdrBaseDir_;
00226     };                                  // class ErrRecordFile
00227 }                                       // namespace OSB_LIB
00228 #endif                                  // #ifndef _ERRRECORDFILE_H_

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