In file Info.hh:

class Info

Defines an event information function

Inheritance:


Public Methods

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

Public Members

[more]enum infotoken
Info token


Inherited from Function:

Public Methods

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

Protected Methods

oFunction& 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)".

oenum infotoken
Info token

o kInvalid
Invalid

o kType
Type

o kName
Name

o kTypeId
Type ID

o kNameId
Name ID

o kSize
Event data size

o kRefCount
Reference count

o kColNum
Column number

o kColName
Column name

o kColType
Column type

o kColTypeId
Column type ID

o kColTypeSize
Column type size

o kColFixed
Column fixed?

o kColIndex
Column index

o kColOffset
Column offset

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

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

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

o 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

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

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

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

obool operator!= (const Info& info) const
Inequality operator.

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

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

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

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

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

oint 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 HTML hierarchy of classes or Java


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