Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RtypesImp.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 #if defined(__CINT__)
0048 #define RootStlStreamer(name,STREAMER)
0049 #else
0050 #define RootStlStreamer(name,STREAMER)                               \
0051 namespace ROOT {                                                     \
0052    static TGenericClassInfo *GenerateInitInstance(const name*);      \
0053    static Short_t _R__UNIQUE_(R__dummyStreamer) =                    \
0054            GenerateInitInstance((name*)0x0)->SetStreamer(STREAMER);  \
0055    R__UseDummy(_R__UNIQUE_(R__dummyStreamer));                       \
0056 }
0057 #endif
0058 
0059 
0060 #if defined(__cplusplus)
0061 /* Helper class to avoid compiler warning about casting function pointer
0062 ** to void pointer.
0063 */
0064 class TFunc2void {
0065    typedef void (*funcptr_t)();
0066 
0067    union funcptr_and_voidptr {
0068 
0069       funcptr_and_voidptr(void *val) : _read(val) {}
0070 
0071       void *_read;
0072       funcptr_t _write;
0073    };
0074 
0075    funcptr_and_voidptr _tmp;
0076 public:
0077    template <typename T>
0078    TFunc2void( T vfp ) : _tmp(nullptr) {
0079       _tmp._write = ( funcptr_t )vfp;
0080    }
0081 
0082    operator void* () const {
0083       return _tmp._read;
0084    }
0085 };
0086 #else
0087 typedef union {
0088    void *_read;
0089    void (*_write)();
0090 } funcptr_and_voidptr_t;
0091 #endif
0092 
0093 #endif