//*-- Author : Valeriy Onuchin 11/09/2000 
//
//
////////////////////////////////////////////////////////////////////////////////
//
// rooProperty corresponds to d_Property Class
//
// The abstract class rooProperty represents descriptors for properties of 
// classes in the schema of the federated database.
//
//______________________________________________________________________________
//  
//             About Property Descriptors
//
// An instance of any concrete class derived from rooProperty is called a
// property descriptor; it provides information about a particular property, 
// called its described property. Concrete derived classes represent descriptors
// for two different kinds of properties that a class can have:
//
//    Attributes or component data of the class
//
//    Relationships (or associations) from the class defining the relationship 
//    (or source class) to a destination class. The destination class can be 
//    any persistence-capable class, including the source class itself.
//
// Because this class is abstract, you never instantiate it; instead, 
// you work with instances of its concrete derived classes. You should not 
// derive your own classes from this class.

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

ClassImp(rooProperty)

///////////////////////////////////////////////////////////////////////////////
//______________________________________________________________________________
 rooProperty::rooProperty()
{
   // for internal use only

   fImp = 0;
}

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

//______________________________________________________________________________
const rooType & rooProperty::type_of()
{
   // Returns a type descriptor for the declared type of the described property.

   d_Type& tp = ((d_Property*)fImp)->type_of();
   if(!tp) return 0;   

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

//______________________________________________________________________________
 Int_t rooProperty::access_kind() const
{
   // Returns the access kind (or visibility) of the described property as 
   // specified in the declaration of the class in which it is defined; 
   // one of the following:
   //
   // kooPUBLIC      indicates a public property.
   // kooPROTECTED   indicates a protected property.
   // kooPRIVATE     indicates a private property.

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

//______________________________________________________________________________
const rooClass & rooProperty::defined_in_class()
{
   // Returns a class descriptor for the class in which the described property 
   // is defined.

   if(!fImp) return 0;
   d_Class& cl = ((d_Property*)fImp)->defined_in_class();
   if(!cl) return 0;

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

//______________________________________________________________________________
 Bool_t rooProperty::is_relationship() const
{
   // Returns kTRUE if the described property is a relationship (association) 
   // and kFALSE if it is an attribute.

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