Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-26 09:12:43

0001 // @(#)root/base:$Id$
0002 // Author: Philippe Canal   23/2/02
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2002, Rene Brun, Fons Rademakers and al.           *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_RtypesImp
0013 #define ROOT_RtypesImp
0014 
0015 #ifndef G__DICTIONARY
0016 #error RtypesImp.h should only be included by ROOT dictionaries.
0017 #endif
0018 
0019 #include "TMemberInspector.h"
0020 #include "TError.h"
0021 
0022 namespace ROOT {
0023 namespace Internal {
0024    inline void GenericShowMembers(const char *topClassName,
0025                                   void *obj, TMemberInspector &R__insp,
0026                                   bool transientMember)
0027    {
0028       Warning("ROOT::Internal::GenericShowMembers", "Please regenerate your dictionaries!");
0029       R__insp.GenericShowMembers(topClassName, obj, transientMember);
0030    }
0031 
0032   class TOperatorNewHelper { };
0033 }
0034 }
0035 
0036 // This is to provide a placement operator new on all platforms
0037 inline void *operator new(size_t /*size*/, ROOT::Internal::TOperatorNewHelper *p)
0038 {
0039    return((void*)p);
0040 }
0041 
0042 // this should never be used but help quiet down some compiler!
0043 inline void operator delete(void*, ROOT::Internal::TOperatorNewHelper*) { }
0044 
0045 // The STL GenerateInitInstance are not unique and hence are declared static
0046 // (not accessible outside the dictionary and not linker error for duplicate)
0047 #define RootStlStreamer(name,STREAMER)                               \
0048 namespace ROOT {                                                     \
0049    static TGenericClassInfo *GenerateInitInstance(const name*);      \
0050    static Short_t _R__UNIQUE_(R__dummyStreamer) =                    \
0051            GenerateInitInstance((name*)0x0)->SetStreamer(STREAMER);  \
0052    R__UseDummy(_R__UNIQUE_(R__dummyStreamer));                       \
0053 }
0054 
0055 #if defined(__cplusplus)
0056 /* Helper class to avoid compiler warning about casting function pointer
0057 ** to void pointer.
0058 */
0059 class TFunc2void {
0060    typedef void (*funcptr_t)();
0061 
0062    union funcptr_and_voidptr {
0063 
0064       funcptr_and_voidptr(void *val) : _read(val) {}
0065 
0066       void *_read;
0067       funcptr_t _write;
0068    };
0069 
0070    funcptr_and_voidptr _tmp;
0071 public:
0072    template <typename T>
0073    TFunc2void( T vfp ) : _tmp(nullptr) {
0074       _tmp._write = ( funcptr_t )vfp;
0075    }
0076 
0077    operator void* () const {
0078       return _tmp._read;
0079    }
0080 };
0081 #else
0082 typedef union {
0083    void *_read;
0084    void (*_write)();
0085 } funcptr_and_voidptr_t;
0086 #endif
0087 
0088 #endif