Class Reference for E1039 Core & Analysis Software
PdbApplication.h
Go to the documentation of this file.
1 #ifndef PDBAPPLICATION_H__
2 #define PDBAPPLICATION_H__
3 
4 #include "Pdb.h"
5 
6 #include <cstddef> // for size_t
7 #include <memory> // for auto_ptr
8 #include <string>
9 
10 class PdbCalBank;
11 class PHTimeStamp;
12 
14 {
15 
16 protected:
18  virtual ~PdbApplication() {}
19 
20 public:
21  static PdbApplication *instance();
22 
23 
24  virtual PdbStatus startUpdate() = 0;
25  virtual PdbStatus startRead() = 0;
26  virtual PdbStatus commit() = 0;
27  virtual PdbStatus abort() = 0;
28  virtual PdbStatus isActive() = 0;
29  virtual PdbStatus commit(PdbCalBank *) = 0;
30  virtual PdbStatus commit(PdbCalBank *,int,long,long,long) = 0;
31  //
32  // Should return the file (database) size in bytes.
33  //
34 
35  virtual int setDBName(const std::string &name) = 0;
36  virtual int DisconnectDB() = 0;
37 
38 protected:
39  // Wrap the singleton object in an auto_ptr so it gets cleaned up.
40  // Even though auto_ptr is often a horrible choice, here it should be ok
41  // since __instance will never be copied. If this wouldn't be visible for
42  // CINT a good choice would have been boost::scoped_ptr, or in C++11
43  // std::unique_ptr.
44  friend class std::auto_ptr<PdbApplication>;
45  static std::auto_ptr<PdbApplication> __instance;
46 };
47 
48 #endif /* PDBAPPLICATION_H */
int PdbStatus
Definition: Pdb.h:4
virtual int setDBName(const std::string &name)=0
virtual int DisconnectDB()=0
virtual PdbStatus startRead()=0
virtual PdbStatus abort()=0
virtual PdbStatus commit(PdbCalBank *, int, long, long, long)=0
static PdbApplication * instance()
virtual PdbStatus commit(PdbCalBank *)=0
virtual PdbStatus commit()=0
static std::auto_ptr< PdbApplication > __instance
virtual PdbStatus isActive()=0
virtual PdbStatus startUpdate()=0
virtual ~PdbApplication()