//*-- Author : Valeriy Onuchin 11/09/2000 
//
//
////////////////////////////////////////////////////////////////////////////////
//
// rooInheritance corresponds to d_Inheritance Class
//
// The class rooInheritance represents descriptors for inheritance connections
// between classes. An instance of rooInheritance is called an inheritance 
// descriptor.
//______________________________________________________________________________
//
//             About Inheritance Descriptors
//
// An inheritance descriptor provides information about a particular connection 
// in an inheritance graph between one particular parent or base class and one 
// child or derived class.
//______________________________________________________________________________
//
//             Obtaining an Inheritance Descriptor
//
// You should never instantiate this class directly. Instead, you can obtain 
// an inheritance descriptor by iterating through the parent classes or the 
// child classes of a class.
//
//    Call the base_class_list_begin() member function of a class descriptor to
//    get an iterator that finds all inheritance connections in which the 
//    described class is the child class.
//
//    Call the sub_class_list_begin() member function of a class descriptor to 
//    get an iterator that finds all inheritance connections in which the 
//    described class is the parent class.
//
//______________________________________________________________________________
//
//             Getting Information About the Inheritance Connection
//
// Member functions return information about the described inheritance 
// connection:
//
//    The access kind (public, private, or protected)
//
//    The parent class from which the inheriting class is derived
// 
//    The child class that inherits from the parent class
//
//    The layout position of the parent class data within the storage of a 
//    persistent instance of the child class
//

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

ClassImp(rooInheritance)

////////////////////////////////////////////////////////////////////////////////
//______________________________________________________________________________
 rooInheritance::rooInheritance()
{
   // default ctor. internal use only

   fImp = 0;
}

//______________________________________________________________________________
 rooInheritance::~rooInheritance()
{
   // internal use only
   
   fImp = 0;
}

//______________________________________________________________________________
 Int_t rooInheritance::access_kind() const
{
   // Returns the access kind (or visibility) of the parent base class as 
   // specified in the declaration of the child or derived class; one of the 
   // following:
   //
   // kooPUBLIC indicates a public base class.
   // kooPROTECTED indicates a protected base class.
   // kooPRIVATE indicates a private base class.

   return fImp ? (Int_t)((d_Inheritance*)fImp)->access_kind() : 0;
}

//______________________________________________________________________________
 Bool_t rooInheritance::is_virtual() const
{
   // Tests whether the described inheritance connection is virtual.
   //
   // Returns: kFALSE
   //
   //  Objectivity/C++ does not support virtual inheritance, so this test 
   // fails for all inheritance connections.

   return fImp ? ((d_Inheritance*)fImp)->is_virtual() : 0;
}

//______________________________________________________________________________
const rooClass & rooInheritance::derives_from()
{
   // Returns a class descriptor for the parent or base class 
   // (from which the child class derives).

   if(!fImp) return 0;
   d_Class& cl = ((d_Inheritance*)fImp)->derives_from();
   if(!cl) return 0;

   if(!fDerivesFrom) fDerivesFrom = new rooClass((void*)&cl);      
   else fDerivesFrom->setImp((void*)&cl);
   return *fDerivesFrom;
}

//______________________________________________________________________________
const rooClass & rooInheritance::inherits_to()
{
   // Returns a class descriptor for the child or derived class 
   // (which inherits from the parent class).

   if(!fImp) return 0;
   d_Class& cl = ((d_Inheritance*)fImp)->inherits_to();
   if(!cl) return 0;

   if(!fInheritsTo) fInheritsTo = new rooClass((void*)&cl);      
   else fInheritsTo->setImp((void*)&cl);
   return *fInheritsTo;
}

//______________________________________________________________________________
 Int_t rooInheritance::position() const
{
   // Returns the zero-based layout position of data for the parent class 
   // within the storage of a persistent instance of the child class. 

   return fImp ? ((d_Inheritance*)fImp)->position() : 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.