BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
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 "GaudiKernel/Kernel.h"
7#include "GaudiKernel/IOpaqueAddress.h"
8#include "TTree.h"
9#include <mysql.h>
11#include "TTree.h"
12#include "TBuffer.h"
13
14// Forward declarations
15class IRegistry;
16
17/** @class TreeAddress TreeAddress.h GaudiKernel/TreeAddress.h
18
19 Tree Transient Address.
20 The generic transient address describes the recipe to load/save
21 a persistent object from/to its transient representation.
22
23 @author Markus Frank
24 @version 1.0
25*/
26class TreeAddress : public IOpaqueAddress{
27protected:
28 /// Reference count
29 unsigned long m_refCount;
30 /// Storage type
32 /// Class id
33 CLID m_clID;
34 /// String parameters to be accessed
35// std::string m_par[3];
36 /// Integer parameters to be accessed
37 unsigned long m_ipar[2];
38 unsigned long m_treesize[9];
39// MYSQL_ROW m_row;
40 /// Pointer to corresponding directory
41 IRegistry* m_pRegistry;
42// char m_pp[8][1024000];
43 //Trees
47public:
48 /// Dummy constructor
50 : m_refCount(0),
51 m_svcType(0),
52 m_clID(0),
54 {
55 // m_ipar[0]=m_ipar[1]=m_ipar[2]=m_ipar[3]=0xFFFFFFFF;
56 }
57 /// Standard Constructor
59 : IOpaqueAddress(copy),
60 m_refCount(0),
61 m_svcType(copy.m_svcType),
62 m_clID(copy.m_clID),
64 {
65
66 }
67 /// Standard Constructor
68
69 TreeAddress( long svc,
70 const CLID& clid,
71 DatabaseRecord& records,
72 const unsigned long *ipar
73 )
74 : m_refCount(0),
75 m_svcType(svc),
76 m_clID(clid),
78 {
79 m_records=&records;
80 m_ipar[0] = ipar[0];
81 m_ipar[1] = ipar[1];
82 }
83
84
85 /// Standard Destructor
86 virtual ~TreeAddress() {
87 }
88
89 /// Add reference to object
90 virtual unsigned long addRef () {
91 return ++m_refCount;
92 }
93 /// release reference to object
94 virtual unsigned long release () {
95 int cnt = --m_refCount;
96 if ( 0 == cnt ) {
97 delete this;
98 }
99 return cnt;
100 }
101 /// Pointer to directory
102 virtual IRegistry* registry() const {
103 return m_pRegistry;
104 }
105 /// Set pointer to directory
106 virtual void setRegistry(IRegistry* pRegistry) {
107 m_pRegistry = pRegistry;
108 }
109 /// Access : Retrieve class ID of the link
110 const CLID& clID() const {
111 return m_clID;
112 }
113 /// Access : Set class ID of the link
114 void setClID(const CLID& clid) {
115 m_clID = clid;
116 }
117 /// Access : retrieve the storage type of the class id
118 long svcType() const {
119 return m_svcType;
120 }
121 /// Access : set the storage type of the class id
122 void setSvcType(long typ) {
123 m_svcType = typ;
124 }
125 ///// Retrieve string parameters
126 virtual const std::string* par() const {
127 //return m_par;
128 }
129
130virtual DatabaseRecord* pp() {
131 return m_records;
132}
133
134 /// Retrieve integer parameters
135 virtual const unsigned long* ipar() const {
136 return m_ipar;
137 }
138
139 /// set run from
140 void setRunFrom(int runFrom){
141 m_runFrom= runFrom;
142 }
143 /// set run to
144 void setRunTo(int runTo){
145 m_runTo= runTo;
146 }
147 /// get run from
149 return m_runFrom;
150 }
151 /// get run to
152 int getRunTo(){
153 return m_runTo;
154 }
155};
156#endif // GAUDIKERNEL_GENERICADDRESS_H
157
unsigned long m_treesize[9]
Definition TreeAddress.h:38
int getRunFrom()
get run from
TreeAddress(const TreeAddress &copy)
Standard Constructor.
Definition TreeAddress.h:58
virtual unsigned long release()
release reference to object
Definition TreeAddress.h:94
const CLID & clID() const
Access : Retrieve class ID of the link.
virtual const unsigned long * ipar() const
Retrieve integer parameters.
unsigned long m_refCount
Reference count.
Definition TreeAddress.h:29
CLID m_clID
Class id.
Definition TreeAddress.h:33
DatabaseRecord * m_records
Definition TreeAddress.h:44
unsigned long m_ipar[2]
String parameters to be accessed.
Definition TreeAddress.h:37
long m_svcType
Storage type.
Definition TreeAddress.h:31
void setClID(const CLID &clid)
Access : Set class ID of the link.
virtual IRegistry * registry() const
Pointer to directory.
void setSvcType(long typ)
Access : set the storage type of the class id.
virtual unsigned long addRef()
Add reference to object.
Definition TreeAddress.h:90
void setRunFrom(int runFrom)
set run from
TreeAddress()
Dummy constructor.
Definition TreeAddress.h:49
int getRunTo()
get run to
virtual ~TreeAddress()
Standard Destructor.
Definition TreeAddress.h:86
virtual const std::string * par() const
TreeAddress(long svc, const CLID &clid, DatabaseRecord &records, const unsigned long *ipar)
Standard Constructor.
Definition TreeAddress.h:69
void setRunTo(int runTo)
set run to
IRegistry * m_pRegistry
Pointer to corresponding directory.
Definition TreeAddress.h:41
long svcType() const
Access : retrieve the storage type of the class id.
virtual DatabaseRecord * pp()
virtual void setRegistry(IRegistry *pRegistry)
Set pointer to directory.