rooRelationshipObject
class description - source file - inheritance tree
public:
rooRelationshipObject rooRelationshipObject(const rooRelationshipObject&)
rooRelationshipObject rooRelationshipObject()
rooRelationshipObject rooRelationshipObject(void* imp)
virtual void ~rooRelationshipObject()
void add(const rooObj&)
TClass* Class()
rooClassObject& contained_in()
void del()
Bool_t exist(const rooObj&) const
Bool_t exist() const
rooClassObject get_class_obj()
Bool_t get_iterator(rooObjItr&, Int_t mode = kooNoOpen)
rooObj get_ooref()
virtual Bool_t is_relationship_object() const
virtual TClass* IsA() const
rooRelationshipObject& operator=(const rooRelationshipObject&)
const rooClass& other_class() const
rooRelationship& relationship()
void set(const rooObj&)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Streamer(TBuffer& b)
void sub(const rooObj&, const UInt_t arg = 1)
private:
rooRelationship* fRel relationship()
rooClassObject* fClassObj get_class_obj()
rooObj* fObject get_ooref()
rooClass* fOtherClass other_class()
rooClassObject* fContainedIn contained_in()
rooRelationshipObject corresponds to Relationship_Object class.
The class Relationship_Object is a self-describing data type for
relationships between persistent objects. An instance of this class is
called a relationship object.
______________________________________________________________________________
About Relationship Objects
Each relationship object provides access to persistent data for a particular
relationship, called its described relationship. The persistent data consists
of zero or more associations for a particular persistent object, called the
source object. Each association relates the source object to a particular
destination object. If the described relationship is to-one, the source
object can be associated with at most one destination object; if the
described relationship is to-many, the source object can be associated with
more than one destination object. A relationship object uses a relationship
descriptor for its described relationship to guide its access to the
associated persistent data. You obtain a relationship object for a
particular relationship of a particular source object from a class object
for that source object. To obtain the relationship object, you call the
class object's get_relationship member function, specifying the relationship
of interest.
rooRelationshipObject()
default ctor, internal use only
rooRelationshipObject(const rooRelationshipObject & rel)
Constructs a relationship object that is a copy of the specified
relationship object.
The copy constructor creates a new relationship object with the same
relationship descriptor and persistent relationship data as the specified
relationship object. Both copies access the same persistent data. Any
change to associations made with one relationship object will be seen by
the other relationship object.
~rooRelationshipObject()
rooClassObject get_class_obj()
Gets a class object for the destination object that is related to the
source object by the described to-one relationship.
Returns
A class object containing data for the destination object, or a null
class object if the source object is not associated with any
destination object.
To obtain a reference to the destination object without opening a handle
to it, call get_ooref() instead of this member function.
This member function throws exceptions:
GetAssocError if it is unable to get the destination object
DynRelAccessError if the described relationship is to-many
rooObj get_ooref()
Gets an object reference for the destination object that is related to
the source object by the described to-one relationship.
Returns:
An object reference for the destination object, or a null object
reference if the source object is not associated with any destination
object.
To open a handle for the destination object and obtain a class object
for it, call get_class_obj() instead of this member function.
This member function throws exceptions:
GetAssocError if it is unable to get the destination object
DynRelAccessError if the described relationship is to-many
Bool_t get_iterator(rooObjItr & ritr, Int_t mode)
Gets an object iterator that finds all destination objects that are
associated to the source object by the described to-many relationship.
Parameters:
ritr - an Objectivity/C++ object iterator to be initialized to find
the associated destination objects.
mode - intended level of access to each destination object found by
the object iterator's next member function:
kooNoOpen - (the default) causes next to set the object iterator
to the next associated object without opening it.
kooRead - causes next to open the next associated object for read.
kooUpdate - causes next to open the next associated object for
update.
Returns: kTRUE if successful; otherwise kFALSE.
On the successful completion of this member function, ritr is initialized
to find the destination objects. That object iterator finds persistent
objects, not class objects. You can construct a class object from any of
these persistent objects if you want to examine its persistent data.
This member function throws a DynRelAccessError exception if the
described relationship is to-one.
Bool_t exist(const rooObj & robj) const
Tests whether an association exists to the specified destination object.
Bool_t exist() const
Tests whether any association exists between the source object and a
destination
void set(const rooObj & robj)
Forms an association between the source object and the specified
destination object.
Parameters:
robj - handle for the new destination object of the described to-one
relationship.
The application must be able to obtain an update lock for the source
object. If the described relationship is bidirectional, this member
function also forms the inverse association from the specified destination
object to the source object. In that case, the application must be able
to obtain update locks on both objects. Because this member function
forms to-one associations, it throws an exception if the source object
is already associated with a destination object by the described
relationship. If you want to replace the existing destination object,
you should first call del and then call this member function.
This member function throws exceptions:
SetAssocError if it is unable to form the specified association
DynRelAccessError if the described relationship is to-many
void del()
Removes all existing associations between the source object and any
destination objects.
The application must be able to obtain an update lock for the source
object. If the described relationship is bidirectional, this member
function also removes the inverse association to this object from each
of its formerly associated destination objects. In that case, the
application must be able to obtain update locks on all of the destination
objects. If this member function is unable to remove the association(s),
it throws a DelAssocError exception.
void add(const rooObj & robj)
Adds an association between the source object and the specified
destination object.
The application must be able to obtain an update lock for the source
object. If the described relationship is bidirectional, this member
function also adds the inverse association from the specified object to
the source object. In that case, the application must be able to obtain
update locks on both objects. No error is signaled if an association
already exists between the source object and the specified destination
object. That is, you can create duplicate associations between the two
objects (even though it could be semantically meaningless to do so).
This member function throws exceptions:
AddAssocError if it is unable to add the specified association
DynRelAccessError if the described relationship is to-one
void sub(const rooObj &robj, const UInt_t num)
Removes the association(s) between the source object and the specified
destination object.
Parameters:
robj - handle for the destination object whose association is to be
removed.
num - number of associations to removed between the source object and
the specified destination object:
If you specify 0, all such associations are removed.
If you specify 1 (the default), the first or only such association
is removed.
If you specify a number greater than 1, this member function removes
the first number associations encountered.
You can use this parameter only if the described relationship is a
many-to-many bidirectional association or a one-to-many unidirectional
association.
The application must be able to obtain an update lock for the source
object. If the described relationship is bidirectional, this member
function also removes the inverse association(s) from the specified
destination object to the source object. In that case, the application
must be able to obtain update locks on both objects.
This member function throws exceptions:
SubAssocError if it is unable to remove the specified association(s)
DynRelAccessError if the described relationship is to-one
See also: add(), get_iterator(), del()
Bool_t is_relationship_object() const
Overrides the inherited member function. Indicates that this is a
relationship object.
Inline Functions
rooRelationshipObject& operator=(const rooRelationshipObject&)
rooRelationshipObject rooRelationshipObject(void* imp)
rooRelationship& relationship()
const rooClass& other_class() const
rooClassObject& contained_in()
TClass* Class()
TClass* IsA() const
void ShowMembers(TMemberInspector& insp, char* parent)
void Streamer(TBuffer& b)
Author: Valeriy Onuchin 11/09/2000
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.