In file LayoutInfo.hh:

class LayoutInfo

Defines an event layout information record

Inheritance:


Public Methods

[more] LayoutInfo ()
Default constructor
[more] LayoutInfo (const Type& type)
Default constructor
[more]LayoutInfo* Copy () const
Copy the layout information
[more]bool operator== (const LayoutInfo& info) const
Equality operator
[more]bool operator!= (const LayoutInfo& info) const
Inequality operator
[more]bool IsRegistered () const
Registered layout?
[more]void RefCount (bool up)
Reference counting
[more]int GetRefCount () const
Get reference count
[more]bool GetValue (const char* name, const_data_ptr data, Value& val) const
Gets the column value of an event
[more]bool SetValue (const char* name, data_ptr& data, const Value& val)
Sets the column value of an event
[more]const Type& GetType () const
Gets the event type
[more]bool IsCompatible (const Type& type) const
Compatible type?
[more]const ColumnInfoList& GetColumnList () const
Column information
[more]bool AddColumn (const ColumnInfo& col)
Add a column
[more]bool AddColumn (const char* name, Enum type)
Add a column
[more]bool RemoveColumn (const char* name)
Remove a column
[more]const ColumnInfo* GetColumn (const char* name) const
Get a column
[more]int DataSize () const
Data block size
[more]bool Construct (data_ptr data, const_data_ptr init = 0)
Construct event data
[more]bool Destruct (data_ptr data)
Destruct event data
[more]bool Update (data_ptr& data)
Update the event
[more]bool Compare (const_data_ptr d1, const_data_ptr d2) const
Compares event data
[more]const LayoutInfo* Register ()
Register the layout globaly
[more]void Dump (std::ostream& os) const
Dump column names to specified output stream.
[more]static bool Parse (const char* nameOrg, std::string& nameFirst, std::string& nameRem)
Get column event
[more]static bool ParseArrayIndex (const char* str, int& first, std::string& left)
Get column event
[more]static const LayoutInfo* Lookup (const Type& type)
Lookup a layout
[more]static const LayoutInfo* GetSimple ()
Get "simple" layout
[more]static const LayoutInfo* GetStandard ()
Get "standard" layout
[more]static const char* Simple ()
Name of simple event layout
[more]static const char* Standard ()
Name of standard event layout
[more]static std::string Coincidence (int order)
Name of coincidence event layout
[more]static std::string Cluster (int num)
Name of cluster event layout
[more]static const char* GdsTrigger ()
Name of gds trigger event layout
[more]static const char* SnglInspiral ()
Name of single inspiral event layout
[more]static const char* SnglBurst ()
Name of single burst event layout
[more]static const char* SnglRingdown ()
Name of single ringdown event layout
[more]static const char* SnglUnmodeled ()
Name of single unmodeled event layout
[more]static const char* SnglDPeriodic ()
Name of single directed periodic event layout
[more]static const char* MultiInspiral ()
Name of single directed periodic event layout
[more]static const char* MultiBurst ()
Name of single directed periodic event layout
[more]static const char* Segment ()
Name of single directed periodic event layout

Public Members

[more]typedef IndexList<ColumnInfo> ColumnList
Column list

Protected Methods

[more]void Recalculate ()
Recalculate data offset, column index and total size


Documentation

An event layout is used to describe an event. The layout infromation contains the (sub)type name and id, and the column information. An event layout is uniquely identified by its type and subtype ID. An event will store a pointer to its corresponding event layout.

otypedef IndexList<ColumnInfo> ColumnList
Column list

o LayoutInfo()
Creates an empty event layout.

o LayoutInfo(const Type& type)
Creates an event layout.

oLayoutInfo* Copy() const
Returns a copy of the layout information. This method must be overriden by all descendents.
Returns:
Layout information copy

obool operator== (const LayoutInfo& info) const
Equality operator. Two layouts are the same if the consist of identical columns. Columns have to be identical both in name and type.

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

obool IsRegistered() const
Is this a valid registered layout?

ovoid RefCount(bool up)
Reference counting

oint GetRefCount() const
Get reference count

obool GetValue(const char* name, const_data_ptr data, Value& val) const
Returns the data value of the specified column. If the specified column was added to the layout after the event was created, the default value for this column type will be returned. The event data block will not be changed.
Parameters:
name - Name of column
data - Pointer to event data block
val - Return value (return)
Returns:
true if column exists and can be read

obool SetValue(const char* name, data_ptr& data, const Value& val)
Sets the data value of the specified column. If the specified column was added to the layout after the event was created, the event data block will be automatically extended.
Parameters:
name - Name of column
data - Pointer to event data block
val - Set value
Returns:
true if column exists and can be set

oconst Type& GetType() const
Returns the event type of the layout

obool IsCompatible(const Type& type) const
Checks if the layout corresponds to the specified type.

oconst ColumnInfoList& GetColumnList() const
Get the column information

obool AddColumn(const ColumnInfo& col)
Add a column to the layout.

obool AddColumn(const char* name, Enum type)
Add a column to the layout.

obool RemoveColumn(const char* name)
Remove a column from the layout.

oconst ColumnInfo* GetColumn(const char* name) const
Get a column from the layout.

oint DataSize() const
Size of data block described by layout.

obool Construct(data_ptr data, const_data_ptr init = 0)
Construct the event data (optional copy construct)

obool Destruct(data_ptr data)
Destruct the event data

obool Update(data_ptr& data)
Updates the event data block, if columns have been added. Fills added columns with default values.

obool Compare(const_data_ptr d1, const_data_ptr d2) const
Compares event data
Returns:
true if equal

oconst LayoutInfo* Register()
Register the current layout with the event factory.
Parameters:
usesubtype - True if layout should be subtype specific
Returns:
Pointer to global layout information (0 if failed)

ovoid Dump(std::ostream& os) const
Dump column names to specified output stream.
Parameters:
os - output stream

ostatic bool Parse(const char* nameOrg, std::string& nameFirst, std::string& nameRem)
Parse a column name. For a name of the form "(n)" or "(n,...)". The function returns the first section of the name and its remainder.
Parameters:
nameOrg - column name
nameFirst - First part of the name (return)
nameRem - Remainder of the name (return)
Returns:
true if suucess.

ostatic bool ParseArrayIndex(const char* str, int& first, std::string& left)
Parse an array index. The str argument must point to a valid array index of the form "(n)" or "(n,...)". The function returns the first index and the remainder if the second form was used (i.e., multiple indices).
Parameters:
str - Array index string
first - First index (return)
left - Remainder of indices (return)
Returns:
true if valid array index

ostatic const LayoutInfo* Lookup(const Type& type)
Lookup a registered layout.

ostatic const LayoutInfo* GetSimple()
Get the minimal layout.
Returns:
Simple layout

ostatic const LayoutInfo* GetStandard()
Get the standard layout.
Returns:
Standard layout

ostatic const char* Simple()
Name of simple event layout

ostatic const char* Standard()
Name of standard event layout

ostatic std::string Coincidence(int order)
Name of coincidence event layout

ostatic std::string Cluster(int num)
Name of cluster event layout

ostatic const char* GdsTrigger()
Name of gds trigger event layout

ostatic const char* SnglInspiral()
Name of single inspiral event layout

ostatic const char* SnglBurst()
Name of single burst event layout

ostatic const char* SnglRingdown()
Name of single ringdown event layout

ostatic const char* SnglUnmodeled()
Name of single unmodeled event layout

ostatic const char* SnglDPeriodic()
Name of single directed periodic event layout

ostatic const char* MultiInspiral()
Name of single directed periodic event layout

ostatic const char* MultiBurst()
Name of single directed periodic event layout

ostatic const char* Segment()
Name of single directed periodic event layout

ovoid Recalculate()
Recalculate data offset, column index and total size


This class has no child classes.
Friends:
class Factory
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