BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Calibration/CalibSvc/CalibMySQLCnv/include/CalibMySQLCnvSvc/TreeAddress.h
Go to the documentation of this file.
1// $Id: TreeAddress.h,v 1.5 2012/01/05 03:51:51 zhangy Exp $
2#ifndef TREEADDRESS_H
3#define TREEADDRESS_H
4
5// Framework include files
6#include "DatabaseSvc/IDatabaseSvc.h"
7#include "GaudiKernel/IOpaqueAddress.h"
8#include "GaudiKernel/Kernel.h"
9#include "TBuffer.h"
10#include "TTree.h"
11#include <mysql.h>
12
13// Forward declarations
14class IRegistry;
15
16/** @class TreeAddress TreeAddress.h GaudiKernel/TreeAddress.h
17
18 Tree Transient Address.
19 The generic transient address describes the recipe to load/save
20 a persistent object from/to its transient representation.
21
22 @author Markus Frank
23 @version 1.0
24*/
25class TreeAddress : public IOpaqueAddress {
26protected:
27 /// Reference count
28 unsigned long m_refCount;
29 /// Storage type
31 /// Class id
32 CLID m_clID;
33 /// String parameters to be accessed
34 std::string m_par[3];
35 /// Integer parameters to be accessed
36 unsigned long m_ipar[2];
37 unsigned long m_treesize[9];
38 // MYSQL_ROW m_row;
39 /// Pointer to corresponding directory
40 IRegistry* m_pRegistry;
41 // char m_pp[8][1024000];
42 // Trees
46
47public:
48 /// Dummy constructor
49 TreeAddress() : m_refCount( 0 ), m_svcType( 0 ), m_clID( 0 ), m_pRegistry( 0 ) {
50 // m_ipar[0]=m_ipar[1]=m_ipar[2]=m_ipar[3]=0xFFFFFFFF;
51 }
52 /// Standard Constructor
53 TreeAddress( const TreeAddress& copy )
54 : IOpaqueAddress( copy )
55 , m_refCount( 0 )
56 , m_svcType( copy.m_svcType )
57 , m_clID( copy.m_clID )
58 , m_pRegistry( copy.m_pRegistry ) {}
59 /// Standard Constructor
60
61 TreeAddress( long svc, const CLID& clid, DatabaseRecord& records, const unsigned long* ipar )
62 : m_refCount( 0 ), m_svcType( svc ), m_clID( clid ), m_pRegistry( 0 ) {
63 m_records = &records;
64 m_ipar[0] = ipar[0];
65 m_ipar[1] = ipar[1];
66 }
67
68 /// Standard Destructor
69 virtual ~TreeAddress() {}
70
71 /// Add reference to object
72 virtual unsigned long addRef() { return ++m_refCount; }
73 /// release reference to object
74 virtual unsigned long release() {
75 int cnt = --m_refCount;
76 if ( 0 == cnt ) { delete this; }
77 return cnt;
78 }
79 /// Pointer to directory
80 virtual IRegistry* registry() const { return m_pRegistry; }
81 /// Set pointer to directory
82 virtual void setRegistry( IRegistry* pRegistry ) { m_pRegistry = pRegistry; }
83 /// Access : Retrieve class ID of the link
84 const CLID& clID() const { return m_clID; }
85 /// Access : Set class ID of the link
86 void setClID( const CLID& clid ) { m_clID = clid; }
87 /// Access : retrieve the storage type of the class id
88 long svcType() const { return m_svcType; }
89 /// Access : set the storage type of the class id
90 void setSvcType( long typ ) { m_svcType = typ; }
91 ///// Retrieve string parameters
92 virtual const std::string* par() const { return m_par; }
93
94 virtual DatabaseRecord* pp() { return m_records; }
95
96 /// Retrieve integer parameters
97 virtual const unsigned long* ipar() const { return m_ipar; }
98
99 /// set run from
100 void setRunFrom( int runFrom ) { m_runFrom = runFrom; }
101 /// set run to
102 void setRunTo( int runTo ) { m_runTo = runTo; }
103 /// get run from
104 int getRunFrom() { return m_runFrom; }
105 /// get run to
106 int getRunTo() { return m_runTo; }
107};
108#endif // GAUDIKERNEL_GENERICADDRESS_H
IRegistry * m_pRegistry
Pointer to corresponding directory.
TreeAddress(const TreeAddress &copy)
Standard Constructor.
virtual unsigned long release()
release reference to object
const CLID & clID() const
Access : Retrieve class ID of the link.
virtual const unsigned long * ipar() const
Retrieve integer parameters.
unsigned long m_ipar[2]
Integer parameters to be accessed.
void setClID(const CLID &clid)
Access : Set class ID of the link.
virtual IRegistry * registry() const
Pointer to directory.
std::string m_par[3]
String parameters to be accessed.
void setSvcType(long typ)
Access : set the storage type of the class id.
virtual unsigned long addRef()
Add reference to object.
TreeAddress(long svc, const CLID &clid, DatabaseRecord &records, const unsigned long *ipar)
Standard Constructor.
long svcType() const
Access : retrieve the storage type of the class id.
virtual void setRegistry(IRegistry *pRegistry)
Set pointer to directory.