library: libCore #include "TArrayS.h"

# TArrayS

class description - source file - inheritance tree (.pdf)

## class TArrayS : public TArray

| Inheritance Chart:

`TArray`

<-

`TArrayS`

<-

`TH1S` |

`TH2S` |

`TH3S` |

        public:

                          TArrayS()
                          TArrayS(Int_t n)
                          TArrayS(Int_t n, const Short_t* array)
                          TArrayS(const TArrayS& array)
                  virtual ~TArrayS()
                     void AddAt(Short_t c, Int_t idx)
                     void Adopt(Int_t n, Short_t* array)
                  Short_t At(Int_t i) const
           static TClass* Class()
                     void Copy(TArrayS& array) const
           const Short_t* GetArray() const
                 Short_t* GetArray()
                   Stat_t GetSum() const
          virtual TClass* IsA() const
                 TArrayS& operator=(const TArrayS& rhs)
                 Short_t& operator[](Int_t i)
                  Short_t operator[](Int_t i) const
                     void Reset()
                     void Reset(Short_t val)
             virtual void Set(Int_t n)
                     void Set(Int_t n, const Short_t* array)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)

### Data Members

        public:

          Short_t* fArray  [fN] Array of fN shorts

## Class Description

     TArrayS

     Array of shorts (16 bits per element).

TArrayS()

     Default TArrayS ctor.

TArrayS(Int_t n)

     Create TArrayS object and set array size to n shorts.

TArrayS(Int_t n, const Short_t *array)

     Create TArrayS object and initialize it with values of array.

TArrayS(const TArrayS &array) : TArray(array)

     Copy constructor.

~TArrayS()

     Delete TArrayS object.

void Adopt(Int_t n, Short_t *arr)

     Adopt array arr into TArrayS, i.e. don't copy arr but use it directly
     in TArrayS. User may not delete arr, TArrayS dtor will do it.

void AddAt(Short_t c, Int_t i)

     Add short c at position i. Check for out of bounds.

void Set(Int_t n)

     Set size of this array to n shorts.
     A new array is created, the old contents copied to the new array,
     then the old array is deleted.
     This function should not be called if the array was declared via Adopt.

void Set(Int_t n, const Short_t *array)

     Set size of this array to n shorts and set the contents.
     This function should not be called if the array was declared via Adopt.

void Streamer(TBuffer &b)

     Stream a TArrayS object.

### Inline Functions

                  TArrayS& operator=(const TArrayS& rhs)
                   Short_t At(Int_t i) const
                      void Copy(TArrayS& array) const
            const Short_t* GetArray() const
                  Short_t* GetArray()
                    Stat_t GetSum() const
                      void Reset()
                      void Reset(Short_t val)
                  Short_t& operator[](Int_t i)
                   Short_t operator[](Int_t i) const
                   TClass* Class()
                   TClass* IsA() const
                      void ShowMembers(TMemberInspector& insp, char* parent)
                      void StreamerNVirtual(TBuffer& b)

Author: Rene Brun 06/03/95
Last update: root/cont:$Name: $:$Id: TArrayS.cxx,v 1.13 2004/05/06 12:32:44 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *