#ifndef ROOT_TClassRef
#define ROOT_TClassRef
#ifndef ROOT_TClass
#include "TClass.h"
#endif
#ifndef ROOT_TRef
#include "TRef.h"
#endif
#include <string>
class TClassRef {
private:
std::string fClassName;
TClass *fClassPtr;
TClassRef *fPrevious;
TClassRef *fNext;
friend class TClass;
TClass *InternalGetClass() const;
void ListReset();
public:
TClassRef() : fClassName(), fClassPtr(0), fPrevious(0), fNext(0) {}
TClassRef(TClass *cl);
TClassRef(const char *classname);
TClassRef(const TClassRef&);
TClassRef &operator=(const TClassRef&);
TClassRef &operator=(TClass*);
~TClassRef() { if (fClassPtr) fClassPtr->RemoveRef(this); };
void SetName(const char* new_name) {
if ( fClassPtr && fClassName != new_name ) Reset();
fClassName = new_name;
}
const char *GetClassName() { return fClassName.c_str(); }
TClass *GetClass() const { return fClassPtr ? fClassPtr : InternalGetClass(); }
void Reset() { if (fClassPtr) fClassPtr->RemoveRef(this); fClassPtr = 0; }
TClass* operator->() const { return fClassPtr ? fClassPtr : InternalGetClass(); }
operator TClass*() const { return fClassPtr ? fClassPtr : InternalGetClass(); }
};
#endif
Last change: Wed Jun 25 08:35:38 2008
Last generated: 2008-06-25 08:35
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.