Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
26  RooSharedProperties() ;
27  RooSharedProperties(const char* uuidstr) ;
28  virtual ~RooSharedProperties() ;
29  Bool_t operator==(const RooSharedProperties& other) ;
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 
39  void setInSharedList() { _inSharedList = kTRUE ; }
40  Bool_t inSharedList() const { return _inSharedList ; }
41 
42  TString asString() { 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