source: trunk/MagicSoft/Simulation/Detector/include-GENERAL/Rtypes.h

Last change on this file was 293, checked in by harald, 25 years ago
This this directory you can find some header files that are needed by reflector and by camera. On example is the declaration-(header)-file of the runlib. This is the starting point for further development. This work was done by Jose Carlos Gonzales. Now this is under CVS control.
File size: 4.9 KB
Line 
1
2#ifndef ROOT_Rtypes
3#define ROOT_Rtypes
4
5// Copyright (C) 1994 CodeCERN. All rights reserved.
6
7//////////////////////////////////////////////////////////////////////////
8// //
9// Rtypes //
10// //
11// Basic types used by ROOT. //
12// //
13//////////////////////////////////////////////////////////////////////////
14
15
16#ifndef ROOT_RConfig
17//*KEEP,RConfig.
18#include "RConfig.h"
19//*KEND.
20#endif
21
22#include <stdio.h>
23
24//*KEEP,DllImport,T=C.
25#include "DllImport.h"
26//*KEND.
27
28//---- types -------------------------------------------------------------------
29
30typedef char Char_t; //Signed Character 1 byte
31typedef unsigned char UChar_t; //Unsigned Character 1 byte
32typedef short Short_t; //Signed Short integer 2 bytes
33typedef unsigned short UShort_t; //Unsigned Short integer 2 bytes
34#ifdef R__INT16
35typedef long Int_t; //Signed integer 4 bytes
36typedef unsigned long UInt_t; //Unsigned integer 4 bytes
37#else
38typedef int Int_t; //Signed integer 4 bytes
39typedef unsigned int UInt_t; //Unsigned integer 4 bytes
40#endif
41#ifdef R__B64
42typedef int Seek_t; //File pointer
43typedef long Long_t; //Signed long integer 4 bytes
44typedef unsigned long ULong_t; //Unsigned long integer 4 bytes
45#else
46typedef int Seek_t; //File pointer
47typedef long Long_t; //Signed long integer 8 bytes
48typedef unsigned long ULong_t; //Unsigned long integer 8 bytes
49#endif
50typedef float Float_t; //Float 4 bytes
51typedef double Double_t; //Float 8 bytes
52typedef char Text_t; //General string
53typedef unsigned char Bool_t; //Boolean (0=false, 1=true)
54typedef unsigned char Byte_t; //Byte (8 bits)
55typedef short Version_t; //Class version identifier
56typedef char Option_t; //Option string
57typedef int Ssiz_t; //String size
58typedef float Real_t; //TVector and TMatrix element type
59
60typedef void (*VoidFuncPtr_t)(); //pointer to void function
61
62
63//---- constants ---------------------------------------------------------------
64
65#ifndef NULL
66#define NULL 0
67#endif
68
69const Bool_t kTRUE = 1;
70const Bool_t kFALSE = 0;
71
72const Int_t kMaxInt = 2147483647;
73const Int_t kMaxShort = 32767;
74const size_t kBitsPerByte = 8;
75const Ssiz_t kNPOS = ~(Ssiz_t)0;
76
77
78//--- bit manipulation ---------------------------------------------------------
79
80#define BIT(n) (1 << (n))
81#define SETBIT(n,i) ((n) |= BIT(i))
82#define CLRBIT(n,i) ((n) &= ~BIT(i))
83#define TESTBIT(n,i) ((Bool_t)(((n) & BIT(i)) != 0))
84
85
86//---- debug global ------------------------------------------------------------
87
88EXTERN Bool_t gDebug;
89
90
91//---- ClassDef macros ---------------------------------------------------------
92
93class TClass;
94class TBuffer;
95class TMemberInspector;
96
97extern TClass *CreateClass(const char *cname, Version_t id,
98 const char *dfil, const char *ifil,
99 Int_t dl, Int_t il);
100
101#define ClassDef(name,id) \
102private: \
103 static TClass *fgIsA; \
104public: \
105 static const char *DeclFileName() { return __FILE__; } \
106 static int DeclFileLine() { return __LINE__; } \
107 static const char *ImplFileName(); \
108 static int ImplFileLine(); \
109 static Version_t Class_Version() { return id; } \
110 static TClass *Class(); \
111 static void Dictionary(); \
112 virtual TClass *IsA() const { return name::Class(); } \
113 virtual void ShowMembers(TMemberInspector &insp, char *parent); \
114 virtual void Streamer(TBuffer &b); \
115 friend TBuffer &operator>>(TBuffer &buf, name *&obj);
116
117#define _ClassInit_(name) \
118 extern void AddClass(const char *cname, Version_t id, VoidFuncPtr_t dict); \
119 extern void RemoveClass(const char *cname); \
120 class _NAME3_(__,name,Init__) { \
121 public: \
122 _NAME3_(__,name,Init__)() { \
123 AddClass(_QUOTE_(name), name::Class_Version(), \
124 &name::Dictionary); \
125 } \
126 ~_NAME3_(__,name,Init__)() { \
127 RemoveClass(_QUOTE_(name)); \
128 } \
129 }; \
130 static _NAME3_(__,name,Init__) _NAME3_(__g,name,Init__);
131
132#define _ClassImp_(name) \
133 TClass *name::Class() \
134 { if (!fgIsA) name::Dictionary(); return fgIsA; } \
135 const char *name::ImplFileName() { return __FILE__; } \
136 int name::ImplFileLine() { return __LINE__; } \
137 TClass *name::fgIsA = 0; \
138 _ClassInit_(name)
139
140#define ClassImp(name) \
141 void name::Dictionary() \
142 { \
143 TClass *c = CreateClass(_QUOTE_(name), Class_Version(), \
144 DeclFileName(), ImplFileName(), \
145 DeclFileLine(), ImplFileLine()); \
146 fgIsA = c; \
147 } \
148 _ClassImp_(name)
149
150#endif
151
Note: See TracBrowser for help on using the repository browser.