Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
22namespace ROOT {
23namespace 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
33}
34}
35
36// This is to provide a placement operator new on all platforms
37inline void *operator new(size_t /*size*/, ROOT::Internal::TOperatorNewHelper *p)
38{
39 return((void*)p);
40}
41
42// this should never be used but help quiet down some compiler!
43inline void operator delete(void*, ROOT::Internal::TOperatorNewHelper*) { }
44
45// The STL GenerateInitInstance are not unique and hence are declared static
46// (not accessible outside the dictionary and not linker error for duplicate)
47#define RootStlStreamer(name,STREAMER) \
48namespace ROOT { \
49 static TGenericClassInfo *GenerateInitInstance(const name*); \
50 static Short_t _R__UNIQUE_(R__dummyStreamer) = \
51 GenerateInitInstance((name*)0x0)->SetStreamer(STREAMER); \
52 R__UseDummy(_R__UNIQUE_(R__dummyStreamer)); \
53}
54
55#if defined(__cplusplus)
56/* Helper class to avoid compiler warning about casting function pointer
57** to void pointer.
58*/
59class TFunc2void {
60 typedef void (*funcptr_t)();
61
63
64 funcptr_and_voidptr(void *val) : _read(val) {}
65
66 void *_read;
67 funcptr_t _write;
68 };
69
71public:
72 template <typename T>
73 TFunc2void( T vfp ) : _tmp(nullptr) {
74 _tmp._write = ( funcptr_t )vfp;
75 }
76
77 operator void* () const {
78 return _tmp._read;
79 }
80};
81#else
82typedef union {
83 void *_read;
84 void (*_write)();
86#endif
87
88#endif
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition TError.cxx:252
winID h TVirtualViewer3D TVirtualGLPainter p
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