rooVArrayObject


class description - source file - inheritance tree

class rooVArrayObject : public rooCollectionObject


    public:
rooVArrayObject rooVArrayObject() rooVArrayObject rooVArrayObject(void* imp) rooVArrayObject rooVArrayObject(const rooVArrayObject&) virtual void ~rooVArrayObject() UInt_t cardinality() const TClass* Class() rooClassObject& contained_in() Bool_t extend(const rooNumericValue&) Bool_t extend(const rooObj&) rooNumericValue get(Int_t) rooClassObject get_class_obj(Int_t) rooObj get_ooref(Int_t) rooStringValue get_string(Int_t) void insert_element(const rooNumericValue&) void insert_element(const rooObj&) Bool_t is_empty() const virtual Bool_t is_varray_object() const virtual TClass* IsA() const rooVArrayObject& operator=(const rooVArrayObject&) void remove_all() void replace_element_at(const rooNumericValue&, UInt_t) void replace_element_at(const rooObj&, UInt_t) Bool_t resize(UInt_t) Bool_t set(Int_t, const rooNumericValue&) Bool_t set_ooref(Int_t, const rooObj&) virtual void ShowMembers(TMemberInspector& insp, char* parent) UInt_t size() const virtual void Streamer(TBuffer& b) const rooType& type_of() const Bool_t update() UInt_t upper_bound() const

Data Members

private:
rooNumericValue* fNumericValue get() rooObj* fOoref get_ooref() rooStringValue* fStringValue get_string() rooClassObject* fClassObject get_class_obj() rooClassObject* fContainedIn contained_in() rooType* fType type_of()

Class Description

 rooVArrayObject corresponds to VArray_Object class.

 The class rooVArrayObject is a self-describing data type for variable-size
 arrays.

______________________________________________________________________________

          About VArray Objects

 A VArray object provides access to a VArray (called its associated VArray)
 embedded in the data of some persistent object. You obtain a VArray object
 for a particular VArray attribute of a particular persistent object from
 a class object for that persistent object. To obtain the VArray object, you
 call the class object's get_varray member function, specifying the VArray
 attribute of interest. Member functions of a VArray object enable you to
 get information about the VArray Object and its associated VArray, to
 change the size of the VArray, to get an individual element, and to set an
 individual element. The member functions for getting information about the
 VArray and changing its size are similar to the member functions of the
 ooVArrayT<element_type> class.


!!!!!!!!!!!!!!!!!!!!!! Objectivity V5.2.1 BUG !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 rooVArrayObject::get_class_obj(idx) doesn't  work for embedded class

!!!!!!!!!!!!!!!!!!! FIXED in coming Objectivity V6. !!!!!!!!!!!!!!!!!!!!!!!!!

rooVArrayObject()
 default ctor. internal use only

rooVArrayObject(const rooVArrayObject& vo)
 Constructs a VArray that is a copy of the specified VArray object.

 The copy constructor creates a new VArray object for the same attribute
 and persistent array data as the specified VArray object. Both copies
 access the same persistent data. Any change to the VArray made with one
 VArray object will be seen by the other VArray object.

~rooVArrayObject()
 dtor

rooNumericValue get(Int_t idx)
 Gets the data for the specified element of the associated numeric VArray.

 Parameters:
    idx - the zero-based index of the desired element.

 Returns:
       The numeric value at the specified index of the associated VArray.

   This member function throws exceptions:
       BadVArrayType if the VArray's element type is not a numeric type
       VArrayBoundsError if index exceeds the VArray's upper bound

rooClassObject get_class_obj(Int_t idx)
 Gets the data for the specified element of the associated embedded-class
 or object-reference VArray.

 Parameters:
    idx - the zero-based index of the desired element.

 Returns:
    For an embedded-class VArray, a class object for the specified
    element; for an object-reference VArray, a class object for the
    persistent object referenced by the specified element.

 To obtain an element of an object reference VArray without opening
 a handle for the referenced object, call get_ooref instead of this
 member function.

 This member function throws exceptions:

    BadVArrayType if the VArray's element type is not an embedded-class
    type or an object-reference type

    VArrayBoundsError if index exceeds the VArray's upper bound

 !!! this method doesn't work for embedded class in Objectivity V5.2.1

rooObj get_ooref(Int_t idx)
 Gets the data for the specified element of the associated
 object-reference VArray.

 Parameters:
    idx - the zero-based index of the desired element.

 Returns:
    The object reference at the specified index of the associated VArray.

 To open a handle for the element and obtain a class object for it, call
 get_class_obj instead of this member function.

 This member function throws exceptions:
       BadVArrayType if the VArray's element type is not an
       object-reference type

       VArrayBoundsError if index exceeds the VArray's upper bound

 See also: set_ooref()

rooStringValue get_string(Int_t idx)
 Gets the data for the specified element of the associated string VArray.

 Parameters:
    idx - the zero-based index of the desired element.

 This member function throws exceptions:
    BadVArrayType if the VArray's element type is not a string type

    VArrayBoundsError if index exceeds the VArray's upper bound

Bool_t set(Int_t idx, const rooNumericValue& val)
 Sets the specified element of the associated numeric VArray.

 The application must be able to obtain an update lock for the containing
 persistent object, and the lock on its container is upgraded, if
 necessary.

 This member function throws exceptions:

    BadVArrayType if the VArray's element type is not a numeric type
    VArrayBoundsError if index exceeds the VArray's upper bound

Bool_t set_ooref(Int_t idx, const rooObj& obj)
 Sets the specified element of the associated object-reference VArray.

 Parameters:
    idx - the zero-based index of the desired element.
    obj - the new object reference for the specified element.

 Returns: kTRUE if successful; otherwise kFALSE.

 The application must be able to obtain an update lock for the containing
 persistent object, and the lock on its container is upgraded, if
 necessary.

 This member function throws exceptions:
    BadVArrayType if the VArray's element type is not an object-reference
    type
    VArrayBoundsError if index exceeds the VArray's upper bound

UInt_t cardinality() const
 (ODMG) Gets the current number of elements in the associated VArray.

Bool_t extend(const rooNumericValue& val)
 Adds the specified element at the end of the associated numeric or
 object-reference VArray, increasing the size of the array.

 Returns:
    kTRUE if successful; otherwise kFALSE.

 The application must be able to obtain an update lock for the
 containing persistent object, and the lock on its container is
 upgraded, if necessary. Extending a VArray implicitly resizes it,
 which is a potentially expensive operation. You should therefore use
 extend as a convenient way to add only a single element to a VArray.
 If you need to add multiple elements in a single transaction, you
 should instead use resize to allocate all the elements in one
 operation.

See also: resize()

Bool_t extend(const rooObj& obj)
 Adds the specified element at the end of the associated numeric or
 object-reference VArray, increasing the size of the array.

 Returns:
    kTRUE if successful; otherwise kFALSE.

 The application must be able to obtain an update lock for the
 containing persistent object, and the lock on its container is
 upgraded, if necessary. Extending a VArray implicitly resizes it,
 which is a potentially expensive operation. You should therefore use
 extend as a convenient way to add only a single element to a VArray.
 If you need to add multiple elements in a single transaction, you
 should instead use resize to allocate all the elements in one
 operation.

See also: resize()

void insert_element(const rooNumericValue& val)
 (ODMG) Adds the specified element at the end of the associated numeric or
 object-reference VArray, increasing the size of the array.

 The application must be able to obtain an update lock for the containing
 persistent object, and the lock on its container is upgraded, if
 necessary. Extending a VArray implicitly resizes it, which is a
 potentially expensive operation. You should therefore use extend as a
 convenient way to add only a single element to a VArray. If you need to
 add multiple elements in a single transaction, you should instead use
 resize to allocate all the elements in one  operation.

void insert_element(const rooObj& obj)
 ODMG) Adds the specified element at the end of the associated numeric or
 object-reference VArray, increasing the size of the array.

 The application must be able to obtain an update lock for the containing
 persistent object, and the lock on its container is upgraded, if
 necessary. Extending a VArray implicitly resizes it, which is a
 potentially expensive operation. You should therefore use extend as a
 convenient way to add only a single element to a VArray. If you need to
 add multiple elements in a single transaction, you should instead use
 resize to allocate all the elements in one  operation.

void replace_element_at(const rooNumericValue& val, UInt_t idx)
 (ODMG) Replaces the specified element of the associated numeric or
 object-reference VArray with the specified value.

void replace_element_at(const rooObj& obj, UInt_t idx)
 (ODMG) Replaces the specified element of the associated numeric or
 object-reference VArray with the specified value.

Bool_t resize(UInt_t newSize)
 Extends or truncates the associated VArray to the specified number of
 elements.

 Parameters:
    newSize - total number of elements that the associated VArray is to
    have. Specify 0 to remove all the elements, freeing the storage
    allocated for the element vector.

 Returns:
    kTRUE if successful; otherwise kFALSE.

 The application must be able to obtain an update lock for the containing
 persistent object, and the lock on its container is upgraded, if
 necessary. If the new size is larger than the current size, resize
 allocates storage for the additional elements, creating new, empty
 elements. If the new size is smaller than the current size, resize frees
 the elements from index newSize + 1 to the end and then truncates the
 VArray to the new size.

Bool_t update()
 Explicitly opens the containing persistent object for update.

 Returns:
    kTRUE if successful; otherwise kFALSE.

 When you explicitly open the persistent object for update, its container
 is locked for update; when the transaction commits, the entire VArray is
 be written to disk. You should use update primarily if you intend to
 change a large number of elements in a single transaction.



Inline Functions


         rooVArrayObject rooVArrayObject(const rooVArrayObject&)
        rooVArrayObject& operator=(const rooVArrayObject&)
                  UInt_t size() const
                  Bool_t is_empty() const
                    void remove_all()
                  UInt_t upper_bound() const
          const rooType& type_of() const
         rooClassObject& contained_in()
                  Bool_t is_varray_object() const
                 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.