ROOT  6.06/09
Reference Guide
RtypesImp.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Philippe Canal 23/2/02
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2002, Rene Brun, Fons Rademakers and al. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_RtypesImp
13 #define ROOT_RtypesImp
14 
15 #ifndef G__DICTIONARY
16 #error RtypesImp.h should only be included by ROOT dictionaries.
17 #endif
18 
19 #include "TMemberInspector.h"
20 #include "TError.h"
21 
22 namespace ROOT {
23 namespace Internal {
24  inline void GenericShowMembers(const char *topClassName,
25  void *obj, TMemberInspector &R__insp,
26  bool transientMember)
27  {
28  Warning("ROOT::Internal::GenericShowMembers", "Please regenerate your dictionaries!");
29  R__insp.GenericShowMembers(topClassName, obj, transientMember);
30  }
31 
32  class TOperatorNewHelper { };
33 }
34 }
35 
36 // This is to provide a placement operator new on all platforms
37 inline void *operator new(size_t /*size*/, ROOT::Internal::TOperatorNewHelper *p)
38 {
39  return((void*)p);
40 }
41 
42 #ifdef R__PLACEMENTDELETE
43 // this should never be used but help quiet down some compiler!
44 inline void operator delete(void*, ROOT::Internal::TOperatorNewHelper*) { }
45 #endif
46 
47 // The STL GenerateInitInstance are not unique and hence are declared static
48 // (not accessible outside the dictionary and not linker error for duplicate)
49 #if defined(__CINT__)
50 #define RootStlStreamer(name,STREAMER)
51 #else
52 #define RootStlStreamer(name,STREAMER) \
53 namespace ROOT { \
54  static TGenericClassInfo *GenerateInitInstance(const name*); \
55  static Short_t _R__UNIQUE_(R__dummyStreamer) = \
56  GenerateInitInstance((name*)0x0)->SetStreamer(STREAMER); \
57  R__UseDummy(_R__UNIQUE_(R__dummyStreamer)); \
58 }
59 #endif
60 
61 
62 #if defined(__cplusplus)
63 /* Helper class to avoid compiler warning about casting function pointer
64 ** to void pointer.
65 */
66 class TFunc2void {
67  typedef void (*funcptr_t)();
68 
69  union funcptr_and_voidptr {
70  typedef void (*funcptr_t)();
71 
72  funcptr_and_voidptr(void *val) : _read(val) {}
73 
74  void *_read;
75  funcptr_t _write;
76  };
77 
78  funcptr_and_voidptr _tmp;
79 public:
80  template <typename T>
81  TFunc2void( T vfp ) : _tmp(0) {
82  _tmp._write = ( funcptr_t )vfp;
83  }
84 
85  operator void* () const {
86  return _tmp._read;
87  }
88 };
89 #else
90 typedef union {
91  void *_read;
92  void (*_write)();
94 #endif
95 
96 #endif
void GenericShowMembers(const char *topClassName, const void *obj, Bool_t transientMember)
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
double T(double x)
Definition: ChebyshevPol.h:34
Abstract base class for accessing the data-members of a class.
void GenericShowMembers(const char *topClassName, void *obj, TMemberInspector &R__insp, bool transientMember)
Definition: RtypesImp.h:24
void Warning(const char *location, const char *msgfmt,...)
typedef void((*Func_t)())
TObject * obj