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.
THaArrayString() | |
THaArrayString(const char* string) | |
THaArrayString(const THaArrayString&) | |
virtual | ~THaArrayString() |
static TClass* | Class() |
const Int_t* | GetDim() const |
Int_t | GetLen() const |
const char* | GetName() const |
Byte_t | GetNdim() const |
ULong_t | Hash() const |
virtual TClass* | IsA() const |
Bool_t | IsArray() const |
Bool_t | IsError() const |
const char* | operator const char*() const |
THaArrayString& | operator=(const THaArrayString&) |
THaArrayString& | operator=(const char* rhs) |
virtual Int_t | Parse(const char* string = "") |
virtual void | Print(Option_t* opt = "") |
virtual void | ShowMembers(TMemberInspector& insp, char* parent) |
THaArrayString::EStatus | Status() const |
virtual void | Streamer(TBuffer& b) |
void | StreamerNVirtual(TBuffer& b) |
Int_t* | fDim | Dimensions, if any (NULL for scalar) |
Int_t | fLen | Length of array (product of all dimensions) |
TString | fName | Variable name |
Byte_t | fNdim | Number of array dimensions (0=scalar) |
THaArrayString::EStatus | fStatus | Status of Parse() |
Inheritance Chart: | |||||
|
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).