ROOT logo
// Author: Andrei.Gheata@cern.ch  29/05/2013
// Following proposal by Markus Frank

/*************************************************************************
 * 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.             *
 *************************************************************************/

#include "TGeoExtension.h"

ClassImp(TGeoExtension)

//______________________________________________________________________________
//   TGeoExtension - ABC for user objects attached to TGeoVolume or TGeoNode.
//                   Provides interface for getting a reference (grab) and
//                   releasing the extension object (release), allowing for 
//                   derived classes to implement reference counted sharing.
//                   The user who should attach extensions to logical volumes
//                   or nodes BEFORE applying misalignment information so that 
//                   these will be available to all copies.
//______________________________________________________________________________

ClassImp(TGeoRCExtension)

//______________________________________________________________________________
//   TGeoRCExtension - Reference counted extension which has a pointer to and 
//                   owns a user defined TObject. This class can be used as 
//                   model for a reference counted derivation from TGeoExtension.
//______________________________________________________________________________

// Note: Creating a TGeoRCExtension with new() automatically grabs it, but the 
// creator has to Release it before the pointer gets out of scope. 
// The following sequence is valid:
//
//   // producer:
//   TGeoRCExtension *ext = new TGeoRCExtension();
//   some_TGeoVolume->SetUserExtension(ext);
//   ext->Release();
//   // user:
//   TGeoRCExtension *ext = dynamic_cast<TGeoRCExtension*>(some_TGeoVolume->GrabUserExtension());
//   // ... use extension
//   ext->Release();
//
// The extension is going to be released by the TGeoVolume holder at the destruction
// or when calling SetUserExtension(0).
//
// The following usage is not correct:
//
//   some_TGeoVolume->SetUserExtension(new TGeoRCExtension())
//
// since the producer code does not release the extension.
// One cannot call directly "delete ext" nor allocate an extension on the stack,
// since the destructor is protected. Use Release instead.
 TGeoExtension.cxx:1
 TGeoExtension.cxx:2
 TGeoExtension.cxx:3
 TGeoExtension.cxx:4
 TGeoExtension.cxx:5
 TGeoExtension.cxx:6
 TGeoExtension.cxx:7
 TGeoExtension.cxx:8
 TGeoExtension.cxx:9
 TGeoExtension.cxx:10
 TGeoExtension.cxx:11
 TGeoExtension.cxx:12
 TGeoExtension.cxx:13
 TGeoExtension.cxx:14
 TGeoExtension.cxx:15
 TGeoExtension.cxx:16
 TGeoExtension.cxx:17
 TGeoExtension.cxx:18
 TGeoExtension.cxx:19
 TGeoExtension.cxx:20
 TGeoExtension.cxx:21
 TGeoExtension.cxx:22
 TGeoExtension.cxx:23
 TGeoExtension.cxx:24
 TGeoExtension.cxx:25
 TGeoExtension.cxx:26
 TGeoExtension.cxx:27
 TGeoExtension.cxx:28
 TGeoExtension.cxx:29
 TGeoExtension.cxx:30
 TGeoExtension.cxx:31
 TGeoExtension.cxx:32
 TGeoExtension.cxx:33
 TGeoExtension.cxx:34
 TGeoExtension.cxx:35
 TGeoExtension.cxx:36
 TGeoExtension.cxx:37
 TGeoExtension.cxx:38
 TGeoExtension.cxx:39
 TGeoExtension.cxx:40
 TGeoExtension.cxx:41
 TGeoExtension.cxx:42
 TGeoExtension.cxx:43
 TGeoExtension.cxx:44
 TGeoExtension.cxx:45
 TGeoExtension.cxx:46
 TGeoExtension.cxx:47
 TGeoExtension.cxx:48
 TGeoExtension.cxx:49
 TGeoExtension.cxx:50
 TGeoExtension.cxx:51
 TGeoExtension.cxx:52
 TGeoExtension.cxx:53
 TGeoExtension.cxx:54
 TGeoExtension.cxx:55
 TGeoExtension.cxx:56