BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/DecayChain/include/DecayChain/Element/MutableReferenceHolder.h
Go to the documentation of this file.
1#ifndef DCHAIN_MUTABLEREFERENCEHOLDER_H
2#define DCHAIN_MUTABLEREFERENCEHOLDER_H
3// -*- C++ -*-
4//
5// Package: DChain
6// Module: MutableReferenceHolder
7//
8// Description: Smart pointer for classes that inherit from ReferenceCount and who can be
9// modified
10//
11// Usage:
12// This class wraps a pointer to a class inheriting from ReferenceCount
13// and deals with proper handling of the reference counting used to
14// manage the objects lifetime
15//
16// MutableReferenceHolder<Foo> pFoo = new Foo;
17// pFoo->bar();
18// takeReferenceToFoo( *pFoo);
19// takePointerToFoo( pFoo.pointer() );
20//
21// Author: Chris Jones
22// Created: Wed May 14 08:01:51 EDT 2003
23// $Id: MutableReferenceHolder.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $
24//
25// Revision history
26//
27// $Log: MutableReferenceHolder.h,v $
28// Revision 1.1.1.1 2009/03/03 06:06:56 maqm
29// first import of DecayChain
30//
31// Revision 1.1 2006/01/11 20:28:09 cdj
32// massive class renaming, addition of [] for selection and unit tests
33//
34// Revision 1.1 2003/05/15 19:56:01 cdj
35// revamped memory handling so always use a ReferenceHolder to deal with the reference counting
36//
37//
38
39// system include files
40
41// user include files
42#include "DecayChain/Element/ReferenceHolderBase.h"
43
44// forward declarations
45namespace dchain {
46 template <class T> class MutableReferenceHolder : public ReferenceHolderBase<T*, T&> {
47 public:
48 // Constructors and destructor
50 MutableReferenceHolder( T* iRef ) : ReferenceHolderBase<T*, T&>( iRef ) {}
51 };
52} // namespace dchain
53#endif // DCHAIN_MUTABLEREFERENCEHOLDER_H