class THaArrayString


 THaArrayString

 This class parses the array subscript(s) of variable.
 In the trivial case of a scalar, it simply stores the variable name.
 Otherwise, it extracts the individual subscript(s) and number of
 dimensions.

 Example:

   THaArrayString txt("x[7,4]");

 gives
    fName   = "x"
    fNdim   = 2
    fDim    = [ 7, 4 ]
    fLen    = 7*4 = 28
    fStatus = 0

 THaArrayStrings are used in particular by THaFormula and THaVar.


Function Members (Methods)

public:
THaArrayString()
THaArrayString(const char* string)
THaArrayString(const THaArrayString&)
virtual~THaArrayString()
static TClass*Class()
const Int_t*GetDim() const
Int_tGetLen() const
const char*GetName() const
Byte_tGetNdim() const
ULong_tHash() const
virtual TClass*IsA() const
Bool_tIsArray() const
Bool_tIsError() const
const char*operator const char*() const
THaArrayString&operator=(const THaArrayString&)
THaArrayString&operator=(const char* rhs)
virtual Int_tParse(const char* string = "")
virtual voidPrint(Option_t* opt = "")
virtual voidShowMembers(TMemberInspector& insp, char* parent)
THaArrayString::EStatusStatus() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)

Data Members

public:
enum EStatus { kOK
kBadsyntax
kIllegalchars
kToolarge
kToolong
kNotinit
};
protected:
Int_t*fDimDimensions, if any (NULL for scalar)
Int_tfLenLength of array (product of all dimensions)
TStringfNameVariable name
Byte_tfNdimNumber of array dimensions (0=scalar)
THaArrayString::EStatusfStatusStatus of Parse()

Class Charts

Inheritance Chart:
THaArrayString

Function documentation

THaArrayString( const THaArrayString& rhs )
 Copy constructor
THaArrayString& operator=( const THaArrayString& rhs )
 Assignment operator
Int_t Parse(const char* string = "")
 Parse the given string for array syntax.
 For multidimensional arrays, both C-style and comma-separated subscripts
 are supported.

 Examples of legal expressions:

    "x"           scalar "x"
    "x[2]"        1-d array "x" of size 2
    "x[2][3]"     2-d array "x" of size 2x3=6
    "x[2,3]"      same 2-d array
    "x[2][3][4]"  3-d array "x" of size 2x3x4=24

 Results are stored in this object and can be retrieved using
 GetName(), GetNdim(), GetDim(), and GetLen().

 The maximum length of the input string is 255 characters.

 Returns 0 if ok, or EStatus error code otherwise (see header).
void Print(Option_t* opt = "")
THaArrayString()
{}
THaArrayString( const char* string )
{ Parse(); }
THaArrayString& operator=( const THaArrayString& )
virtual ~THaArrayString()
{ delete [] fDim; }
operator const char*()
{ return fName.Data(); }
const Int_t* GetDim()
{ return fDim; }
Int_t GetLen()
{ return fLen; }
const char* GetName()
{ return fName.Data(); }
Byte_t GetNdim()
{ return fNdim; }
ULong_t Hash()
{ return fName.Hash(); }
Bool_t IsArray()
{ return (fNdim > 0); }
Bool_t IsError()
{ return (fStatus != kOK); }

Last change: Sat Nov 7 21:26:42 2009
Last generated: 2009-11-07 21:26

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.