Logo ROOT  
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
24public:
25
27 RooSharedProperties(const char* uuidstr) ;
28 virtual ~RooSharedProperties() ;
29 Bool_t operator==(const RooSharedProperties& other) const ;
30
31 // Copying and moving is disabled for RooSharedProperties and derived classes
32 // because it is not meaningful. Instead, one should copy and move around
33 // shared pointers to RooSharedProperties instances.
38
39 virtual void Print(Option_t* opts=0) const ;
40
42 void decreaseRefCount() { if (_refCount>0) _refCount-- ; }
43 Int_t refCount() const { return _refCount ; }
44
46 Bool_t inSharedList() const { return _inSharedList ; }
47
48 TString asString() const { return TString(_uuid.AsString()); }
49
50protected:
51
52 TUUID _uuid ; // Unique object ID
53 Int_t _refCount ; //! Use count
54 Int_t _inSharedList ; //! Is in shared list
55
56 ClassDef(RooSharedProperties,1) // Abstract interface for shared property implementations
57};
58
59
60#endif
int Int_t
Definition: RtypesCore.h:45
bool Bool_t
Definition: RtypesCore.h:63
const Bool_t kTRUE
Definition: RtypesCore.h:100
const char Option_t
Definition: RtypesCore.h:66
#define ClassDef(name, id)
Definition: Rtypes.h:325
Class RooSharedProperties is the base class for shared properties that can be stored in RooSharedProp...
RooSharedProperties & operator=(const RooSharedProperties &)=delete
Bool_t operator==(const RooSharedProperties &other) const
Return true of unique id of this property is equal to that of other.
TString asString() const
virtual void Print(Option_t *opts=0) const
Printing interface.
Bool_t inSharedList() const
RooSharedProperties(const RooSharedProperties &)=delete
RooSharedProperties()
Default constructor.
RooSharedProperties & operator=(RooSharedProperties &&)=delete
RooSharedProperties(RooSharedProperties &&)=delete
virtual ~RooSharedProperties()
Destructor.
Int_t _inSharedList
Use count.
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:136
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
Definition: TUUID.h:42
const char * AsString() const
Return UUID as string. Copy string immediately since it will be reused.
Definition: TUUID.cxx:570