From c9c7aa46a0db121b82b2af89249624867e00a5ef Mon Sep 17 00:00:00 2001 From: Philippe Canal <pcanal@fnal.gov> Date: Mon, 20 Mar 2006 21:42:28 +0000 Subject: [PATCH] Extract the TQClass declaration from the TQObject header. The TQClass declaration is only needed in the dictionaries and introduce a spurrious depedency of any TQObject on TClass.h CVS ---------------------------------------------------------------------- git-svn-id: http://root.cern.ch/svn/root/trunk@14335 27541ba8-7e3a-0410-8455-c3a389f83636 --- base/inc/TQClass.h | 83 +++++++++++++++++++++++++++++++++++++++++++++ base/inc/TQObject.h | 67 +++++------------------------------- 2 files changed, 91 insertions(+), 59 deletions(-) create mode 100644 base/inc/TQClass.h diff --git a/base/inc/TQClass.h b/base/inc/TQClass.h new file mode 100644 index 00000000000..300a7a1fd76 --- /dev/null +++ b/base/inc/TQClass.h @@ -0,0 +1,83 @@ +// @(#)root/base:$Name: $:$Id: TQClass.h,v 1.26 2005/05/27 16:42:58 pcanal Exp $ +// Author: Valeriy Onuchin & Fons Rademakers 15/10/2000 + +/************************************************************************* + * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_TQClass +#define ROOT_TQClass + +////////////////////////////////////////////////////////////////////////// +// // +// This is part of the ROOT implementation of the Qt object // +// communication mechanism (see also // +// http://www.troll.no/qt/metaobjects.html) // +// // +// See TQObject for details. // +// // +// This implementation is provided by // +// Valeriy Onuchin (onuchin@sirius.ihep.su). // +// // +////////////////////////////////////////////////////////////////////////// + +#ifndef ROOT_TQObject +#include "TObject.h" +#endif +#ifndef ROOT_TClass +#include "TClass.h" +#endif + +// This class makes it possible to have a single connection from +// all objects of the same class +class TQClass : public TQObject, public TClass { + +friend class TQObject; + +public: + TQClass(const char *name, Version_t cversion, + const type_info &info, TVirtualIsAProxy *isa, + ShowMembersFunc_t showmembers, + const char *dfil = 0, const char *ifil = 0, + Int_t dl = 0, Int_t il = 0) : + TQObject(), + TClass(name, cversion, info,isa,showmembers, dfil, ifil, dl, il) { } + + virtual ~TQClass() { Disconnect(); } + + ClassDef(TQClass,0) // Class with connections +}; + + +//---- Class Initialization Behavior -------------------------------------- +// +// This Class and Function are automatically used for classes inheriting from +// TQObject. They make it possible to have a single connection from all +// objects of the same class. +namespace ROOT { + class TDefaultInitBehavior; + class TQObjectInitBehavior : public TDefaultInitBehavior { + public: + virtual TClass *CreateClass(const char *cname, Version_t id, + const type_info &info, TVirtualIsAProxy *isa, + ShowMembersFunc_t show, + const char *dfil, const char *ifil, + Int_t dl, Int_t il) const + { + return new TQClass(cname, id, info, isa, show, dfil, ifil,dl, il); + } + }; + + inline const TQObjectInitBehavior *DefineBehavior(TQObject*, TQObject*) + { + TQObjectInitBehavior *behave = new TQObjectInitBehavior; + return behave; + } +} + +#endif + diff --git a/base/inc/TQObject.h b/base/inc/TQObject.h index a0f3ca44999..231e4a955b6 100644 --- a/base/inc/TQObject.h +++ b/base/inc/TQObject.h @@ -1,4 +1,4 @@ -// @(#)root/base:$Name: $:$Id: TQObject.h,v 1.25 2005/05/27 03:00:04 pcanal Exp $ +// @(#)root/base:$Name: $:$Id: TQObject.h,v 1.26 2005/05/27 16:42:58 pcanal Exp $ // Author: Valeriy Onuchin & Fons Rademakers 15/10/2000 /************************************************************************* @@ -37,19 +37,17 @@ // // ////////////////////////////////////////////////////////////////////////// -#ifndef ROOT_TClass -#include "TClass.h" -#endif #ifndef ROOT_Varargs #include "Varargs.h" #endif +#ifndef ROOT_TString +#include "TString.h" +#endif class TList; class TObject; class TQConnection; -class TQClass; - - +class TClass; class TQObject { @@ -172,8 +170,6 @@ public: R__EXTERN void *gTQSender; // the latest sender object - - class TQObjSender : public TQObject { protected: @@ -194,29 +190,6 @@ public: //to interpreted classes, see also RQ_OBJECT.h }; - - -// This class makes it possible to have a single connection from -// all objects of the same class -class TQClass : public TQObject, public TClass { - -friend class TQObject; - -public: - TQClass(const char *name, Version_t cversion, - const type_info &info, TVirtualIsAProxy *isa, - ShowMembersFunc_t showmembers, - const char *dfil = 0, const char *ifil = 0, - Int_t dl = 0, Int_t il = 0) : - TQObject(), - TClass(name, cversion, info,isa,showmembers, dfil, ifil, dl, il) { } - - virtual ~TQClass() { Disconnect(); } - - ClassDef(TQClass,0) // Class with connections -}; - - // Global function which simplifies making connections in interpreted // ROOT session // @@ -225,6 +198,9 @@ public: extern Bool_t ConnectCINT(TQObject *sender, const char *signal, const char *slot); +#ifdef G__DICTIONARY +#include "TQClass.h" +#endif //---- ClassImpQ macro ---------------------------------------------- // @@ -237,31 +213,4 @@ extern Bool_t ConnectCINT(TQObject *sender, const char *signal, #define ClassImpQ(name) \ ClassImp(name) - -//---- Class Initialization Behavior -------------------------------------- -// -// This Class and Function are automatically used for classes inheriting from -// TQObject. They make it possible to have a single connection from all -// objects of the same class. -namespace ROOT { - class TDefaultInitBehavior; - class TQObjectInitBehavior : public TDefaultInitBehavior { - public: - virtual TClass *CreateClass(const char *cname, Version_t id, - const type_info &info, TVirtualIsAProxy *isa, - ShowMembersFunc_t show, - const char *dfil, const char *ifil, - Int_t dl, Int_t il) const - { - return new TQClass(cname, id, info, isa, show, dfil, ifil,dl, il); - } - }; - - inline const TQObjectInitBehavior *DefineBehavior(TQObject*, TQObject*) - { - TQObjectInitBehavior *behave = new TQObjectInitBehavior; - return behave; - } -} - #endif -- GitLab