In file Event.hh:

class Event

Defines an event

Inheritance:


Public Methods

[more] Event ()
Default constructor
[more]explicit Event (const Time& time)
Constructor
[more]explicit Event (const Layout& layout)
Constructor
[more]explicit Event (const Type& type)
Constructor
[more]explicit Event (const char* name)
Constructor
[more]explicit Event (const std::string& name)
Constructor
[more] Event (const Event& event)
Copy constructor
[more] ~Event ()
Destructor
[more]Event& operator= (const Event& event)
Assignment operator
[more]bool IsValid () const
Valid event?
[more]Event* Copy () const
Copy the event
[more]bool operator== (const Event& event) const
Equality operator
[more]bool operator!= (const Event& event) const
Inequality operator
[more]bool operator< (const Event& event) const
Default sort order
[more]bool operator> (const Event& event) const
Inverse sort order
[more]const Layout& GetLayout () const
Get the event layout
[more]bool Update ()
Update the event
[more]void Swap (Event& e)
Swap an event
[more]Name GetName () const
Gets the event time
[more]void SetName (const Name& name)
Sets the event time
[more]Time GetTime () const
Gets the event time
[more]void SetTime (const Time& time)
Sets the event time
[more]ColumnType::ColumnIfo_t GetIfo () const
Gets the ifo set
[more]void SetIfo (const ColumnType::ColumnIfo_t& ifo)
Sets the event ifo set
[more]std::string GetIfoStr () const
Gets the ifo set
[more]void SetIfoStr (const char* ifo)
Sets the event ifo set
[more]bool GetValue (const char* name, Value& val) const
Gets the column value of an event (Value)
[more]bool GetValue (const char* name, ColumnType::Real& x) const
Gets the column value of an event (Real)
[more]bool GetValue (const char* name, ColumnType::Int& i) const
Gets the column value of an event (Int)
[more]bool GetValue (const char* name, ColumnType::Complex& c) const
Gets the column value of an event (Complex)
[more]bool GetValue (const char* name, ColumnType::Time& t) const
Gets the column value of an event (Time)
[more]bool GetValue (const char* name, std::string& s) const
Gets the column value of an event (string)
[more]bool GetValue (const char* name, char* p, int len) const
Gets the column value of an event (string)
[more]bool SetValue (const char* name, const Value& val)
Sets the column value of an event (Value)
[more]bool SetValue (const char* name, const ColumnType::Real& x)
Sets the column value of an event (Real)
[more]bool SetValue (const char* name, const ColumnType::Int& i)
Sets the column value of an event (Int)
[more]bool SetValue (const char* name, const ColumnType::Complex& c)
Sets the column value of an event (Complex)
[more]bool SetValue (const char* name, const ColumnType::Time& t)
Sets the column value of an event (Time)
[more]bool SetValue (const char* name, const std::string& s)
Sets the column value of an event (string)
[more]bool SetValue (const char* name, const char* p, int len = -1)
Sets the column value of an event (string)
[more]data_ptr GetData ()
Get the data pointer
[more]const data_ptr GetData () const
Get the data pointer
[more]void Dump (std::ostream& os, int indent = 0) const
Dump Event data to the specified output stream
[more]void Dump (int indent = 0) const
Dump Event data to the specified output stream
[more]void DumpColumn (const char* name, std::ostream& os) const
Dump column data to the specified output stream
[more]void DumpColumn (const char* name) const
Dump column data to the specified output stream
[more]static const Event& Default ()
Get default event

Protected Methods

[more]bool Init (const Layout& layout, const_data_ptr init = 0)
Initialize event
[more]void Destroy ()
Destroy event


Documentation

An event is characterized by a type, a time stamp and a set of parameters. This is the basic container to store a simple event.

o Event()
Creates an empty event.

oexplicit Event(const Time& time)
Creates an event which consists of minimum number of rows: type = "simple", type subid = 0, ifoset = "" and the specified time.

oexplicit Event(const Layout& layout)
Creates an event using a specified layout. The layout must be registered!

oexplicit Event(const Type& type)
Creates an event using a specified type. The type must correspond to a registerd layout.

oexplicit Event(const char* name)
Creates an event using a specified type name. The type must exist and correspond to a registerd layout.

oexplicit Event(const std::string& name)
Creates an event using a specified type name. The type must exist and correspond to a registerd layout.

o Event(const Event& event)
Copy constructor.

o ~Event()
Destroys an event.

oEvent& operator= (const Event& event)
Assignment operator.

obool IsValid() const
Is a valid event? A valid event must have a registered layout.

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

obool operator== (const Event& event) const
Equality operator. Compares the layout and the full data.

obool operator!= (const Event& event) const
Inequality operator. Compares the layout and the full data.

obool operator< (const Event& event) const
Default sort order (by time).

obool operator> (const Event& event) const
Inverse sort order (by time).

oconst Layout& GetLayout() const
Get the event layout.

obool Update()
Updates the event, if columns have been added. Fills additonal columns with default values.

ovoid Swap(Event& e)
Swap a event with the current

oName GetName() const
Returns the name of the event

ovoid SetName(const Name& name)
Sets the time of the event

oTime GetTime() const
Returns the time of the event

ovoid SetTime(const Time& time)
Sets the time of the event

oColumnType::ColumnIfo_t GetIfo() const
Returns the ifo set of the event

ovoid SetIfo(const ColumnType::ColumnIfo_t& ifo)
Sets the ifo set of the event

ostd::string GetIfoStr() const
Returns the ifo set string of the event

ovoid SetIfoStr(const char* ifo)
Sets the ifo set of the event

obool GetValue(const char* name, Value& val) const
Returns the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
val - Column value (return)
Returns:
true if column exists and value could be read

obool GetValue(const char* name, ColumnType::Real& x) const
Returns the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
x - Column value (return)
Returns:
true if column exists and value could be read

obool GetValue(const char* name, ColumnType::Int& i) const
Returns the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
i - Column value (return)
Returns:
true if column exists and value could be read

obool GetValue(const char* name, ColumnType::Complex& c) const
Returns the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
c - Column value (return)
Returns:
true if column exists and value could be read

obool GetValue(const char* name, ColumnType::Time& t) const
Returns the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
t - Column value (return)
Returns:
true if column exists and value could be read

obool GetValue(const char* name, std::string& s) const
Returns the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
s - Column value (return)
Returns:
true if column exists and value could be read

obool GetValue(const char* name, char* p, int len) const
Returns the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
p - Column value (return)
len - Maximum length of buffer
Returns:
true if column exists and value could be read

obool SetValue(const char* name, const Value& val)
Sets the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
val - New column value
Returns:
true if column exists and value could be read

obool SetValue(const char* name, const ColumnType::Real& x)
Sets the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
x - New column value
Returns:
true if column exists and value could be read

obool SetValue(const char* name, const ColumnType::Int& i)
Sets the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
i - New column value
Returns:
true if column exists and value could be read

obool SetValue(const char* name, const ColumnType::Complex& c)
Sets the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
c - New column value
Returns:
true if column exists and value could be read

obool SetValue(const char* name, const ColumnType::Time& t)
Sets the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
t - New column value
Returns:
true if column exists and value could be read

obool SetValue(const char* name, const std::string& s)
Sets the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
s - New column value
Returns:
true if column exists and value could be read

obool SetValue(const char* name, const char* p, int len = -1)
Sets the data value of the specified column. In general, use the column class to access an event column value.
Parameters:
name - Name of column
p - New column value
len - length of buffer, or -1 for NULL terminated
Returns:
true if column exists and value could be read

odata_ptr GetData()
Get the data pointer

oconst data_ptr GetData() const
Get the data pointer

ovoid Dump(std::ostream& os, int indent = 0) const
Dump Event data to the specified output stream
Parameters:
os - output stream
indent - indent level (number of tabs)

ovoid Dump(int indent = 0) const
Dump Event data to the standard output stream
Parameters:
indent - indent level (number of tabs)

ovoid DumpColumn(const char* name, std::ostream& os) const
Dump column data to the specified output stream
Parameters:
name - column name
os - output stream

ovoid DumpColumn(const char* name) const
Dump column data to the standard output stream
Parameters:
name - column name

ostatic const Event& Default()
Gets a pointer to a default event

obool Init(const Layout& layout, const_data_ptr init = 0)
Init method.

ovoid Destroy()
Destroy method.


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