//*-- Author : Valeriy Onuchin 11/09/2000 
//
//
////////////////////////////////////////////////////////////////////////////////
//
// rooRefType corresponds to d_Ref_Type Class
//
// The class rooRefType represents descriptors for reference types. An instance
// of rooRefType is called a reference-type descriptor.
//
//______________________________________________________________________________
//
//                About Reference-Type Descriptors
//
// A reference-type descriptor provides information about a particular
// object-reference type, called its described type.
//
// NOTE: 
//    The only reference types that Active Schema supports are object 
//    references to instances of a particular persistence-capable referenced 
//    class.
//
// You should never instantiate this class directly. Instead, you can obtain a
// reference-type descriptor either from the module descriptor for the 
// top-level module or from an attribute descriptor for an object-reference 
// attribute. Typically, you obtain an instance by calling the inherited 
// type_of member function of an attribute descriptor.

#include "rooObjy.h"
#include <ooas.h>
#include <oo.h>

ClassImp(rooRefType)

////////////////////////////////////////////////////////////////////////////////
//______________________________________________________________________________
 rooRefType::rooRefType()
{
   // default  ctor., for internal use only

   fImp = 0;
}

//______________________________________________________________________________
 rooRefType::~rooRefType()
{
   // dtor., for internal use only
   
   fImp = 0;
}

//______________________________________________________________________________
 Int_t rooRefType::ref_kind() const
{
   // Gets the ODMG reference kind of the described type.

   return fImp ? ((d_Ref_Type*)fImp)->ref_kind() : 0;
}

//______________________________________________________________________________
const rooType & rooRefType::referenced_type()
{
   // Returns a type descriptor for the class referenced by the described type.
   //
   // You can cast the returned type descriptor to a class descriptor if you 
   // need to call member functions defined by rooClass.

   if(!fImp) return 0;
   d_Type& tp = ((d_Ref_Type*)fImp)->referenced_type();
   if(!tp) return 0;

   if(!fReferencedType) fReferencedType = new rooType((void*)&tp);      
   else fReferencedType->setImp((void*)&tp);
   return *fReferencedType; 
}

//______________________________________________________________________________
 Bool_t rooRefType::is_short() const
{
   // Returns kTRUE if the described type is a short object-reference type
   // ooShortRef( Class); otherwise, kFALSE. 

   return fImp ? ((d_Ref_Type*)fImp)->is_short() : 0;
}

//______________________________________________________________________________
 Bool_t rooRefType::is_ref_type() const
{
   // Overrides the inherited member function. Indicates
   // that the described type is an object-reference type. 

   return fImp ? ((d_Ref_Type*)fImp)->is_ref_type() : 0;
}



ROOT page - Class index - Top of the page

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.