In file Info.hh:

class Info : public Function

Defines an event information function

Inheritance:


Public Classes

enum infotoken
Info token
kInvalid
Invalid
kType
Type
kName
Name
kTypeId
Type ID
kNameId
Name ID
kSize
Event data size
kRefCount
Reference count
kColNum
Column number
kColName
Column name
kColType
Column type
kColTypeId
Column type ID
kColTypeSize
Column type size
kColFixed
Column fixed?
kColIndex
Column index
kColOffset
Column offset

Public Methods

explicit Info (const char* name)
Constructor
explicit Info (const char* name, int index)
Constructor
explicit Info (const std::string& name, int index)
Constructor
Info (const char* name, const Function& arg1)
Constructor
virtual Info* Copy () const
Copy the event info
bool IsValid () const
Is valid?
bool operator== (const Info& info) const
Equality operator
bool operator!= (const Info& info) const
Inequality operator
virtual bool InfoValue (const Event& event, Value& val) const
Value of information item
virtual bool Evaluate (const Argument& arg, Value& val) const
Value of information item
virtual void SetName (const char* name)
Sets information item
const char* GetName () const
Name of information item
void SetIndex (int index)
Set event index
int GetIndex () const
Get event index

Inherited from Function:

Public Methods

bool operator) (const Argument& arg, Value& val) const
bool operator) (const Event& event, Value& val) const

Protected Methods

Function& operator= (const Function&)

Documentation

Event information access. Like column values, the information describing the event layout can be accessed through an event function. Rather than reading values from the event data block, this class accessed the event layout information.

The event information is accessed by name. Recognized names are:

    -------------------------------------------------------------------
    Name                Return  Description
    -------------------------------------------------------------------
    Type                String  Event type name
    Name                String  Event name
    TypeId              Int     Event type identification number
    NameId              Int     Event name identification number
    Size                Int     Size of event data block in bytes
    RefCount            Int     Number of identical events
    ColumnNumber        Int     Number of columns
    Column(i)::Name     String  Column name
    Column(i)::Type     String  Column type name
    Column(i)::TypeId   Int     Column type identification number
    Column(i)::TypeSize Int     Type size
    Column(i)::Fixed    Int     One if fixed column
    Column(i)::Index    Int     Column index
    Column(i)::Offset   Int     Column byte offset
    -------------------------------------------------------------------
    

The column index i can be specified as a number or as a column name. The notation "m:n" can be used to specify that the index should be enumerated over indices m to n. If the second argumen is missing, i.e., "m:", the enumeration goes till the last column. When enumerating columns, the result is always returned as a string of comma separated values.

The special literal "dollar" can be used to represent a column index which is specified at run-time. For example,

    Info ("Column($)::Name", Info ("ColumnNumber") - 1)
    
can be used to get the name of the last column.

If a information item is specified without an event index, the default is zero. An event index can be explicitly specified as part of the string or as a separate argument. Examples:

    Info ("Type[1]") + Value("::") + Info ("Name", 1)
    
constructs a type identifier string on the second event.

As with the column class the information function can also access events stored as event columns. The same notation applies. For example:

    Info ("Event(1).Type")
    Info ("Type(1)")
    
to access the type inormation from the event stored in a column named "Event(1)".

enum infotoken
Info token

kInvalid
Invalid

kType
Type

kName
Name

kTypeId
Type ID

kNameId
Name ID

kSize
Event data size

kRefCount
Reference count

kColNum
Column number

kColName
Column name

kColType
Column type

kColTypeId
Column type ID

kColTypeSize
Column type size

kColFixed
Column fixed?

kColIndex
Column index

kColOffset
Column offset

explicit Info(const char* name)
Create an event information item with the specified name.
Parameters:
name - Name of event information item

explicit Info(const char* name, int index)
Create an event information item with the specified name.
Parameters:
name - Name of event information item

explicit Info(const std::string& name, int index)
Create an event information item with the specified name.
Parameters:
name - Name of event information item

Info(const char* name, const Function& arg1)
Create an event information item with the specified name and argument
Parameters:
name - Name of event information item
name - full name

virtual Info* Copy() const
Returns a copy of the event information item. This method must be overriden by all descendents.
Returns:
event copy

bool IsValid() const
Checks if this is a valid info item.
Returns:
true if valid

bool operator== (const Info& info) const
Equality operator (case insensitive)

bool operator!= (const Info& info) const
Inequality operator

virtual bool InfoValue(const Event& event, Value& val) const
Returns the value of the event information item.
Returns:
true if info exists and event is of correct type
Parameters:
event - Events to pick info value from
n - Number of events passed to method
val - Info value (return)

virtual bool Evaluate(const Argument& arg, Value& val) const
Returns the value of the event information item.
Returns:
true if info exists and event is of correct type
Parameters:
arg - Event argument list
val - Column value (return)

virtual void SetName(const char* name)
Sets the name of information item.
Parameters:
name - Name of information item

const char* GetName() const
Returns the name of information item.
Returns:
Name

void SetIndex(int index)
Set the event index.
Parameters:
index - Event index

int GetIndex() const
Returns the event index.
Returns:
Event index


This class has no child classes.
Author:
Written June 2001 by Masahiro Ito and Daniel Sigg
Version:
1.0

alphabetic index hierarchy of classes


Please send questions and comments to sigg_d@ligo-wa.caltech.edu


generated by doc++