Logo ROOT   master
Reference Guide
RooSharedProperties.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooSharedProperties.h,v 1.3 2007/05/11 09:11:30 verkerke Exp $
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 #ifndef ROO_ABS_SHARED_PROPERTY
17 #define ROO_ABS_SHARED_PROPERTY
18 
19 #include "TObject.h"
20 #include "TUUID.h"
21 #include "TString.h"
22 
23 class RooSharedProperties : public TObject {
24 public:
25 
27  RooSharedProperties(const char* uuidstr) ;
28  virtual ~RooSharedProperties() ;
29  Bool_t operator==(const RooSharedProperties& other) const ;
30 
31  virtual RooSharedProperties* clone() = 0 ;
32 
33  virtual void Print(Option_t* opts=0) const ;
34 
35  void increaseRefCount() { _refCount++ ; }
36  void decreaseRefCount() { if (_refCount>0) _refCount-- ; }
37  Int_t refCount() const { return _refCount ; }
38 
40  Bool_t inSharedList() const { return _inSharedList ; }
41 
42  TString asString() const { return TString(_uuid.AsString()); }
43 
44 protected:
45 
46  TUUID _uuid ; // Unique object ID
47  Int_t _refCount ; //! Use count
48  Int_t _inSharedList ; //! Is in shared list
49 
50  ClassDef(RooSharedProperties,1) // Abstract interface for shared property implementations
51 };
52 
53 
54 #endif
RooSharedProperties()
Default constructor.
const char Option_t
Definition: RtypesCore.h:64
Basic string class.
Definition: TString.h:131
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
Definition: TUUID.h:42
#define ClassDef(name, id)
Definition: Rtypes.h:322
virtual RooSharedProperties * clone()=0
Class RooSharedProperties is the base class for shared properties that can be stored in RooSharedProp...
virtual void Print(Option_t *opts=0) const
Printing interface.
Int_t _inSharedList
Use count.
Bool_t inSharedList() const
Bool_t operator==(const RooSharedProperties &other) const
Return true of unique id of this property is equal to that of other.
const char * AsString() const
Return UUID as string. Copy string immediately since it will be reused.
Definition: TUUID.cxx:562
Mother of all ROOT objects.
Definition: TObject.h:37
TString asString() const
virtual ~RooSharedProperties()
Destructor.
const Bool_t kTRUE
Definition: RtypesCore.h:89