In file LayoutInfo.hh:

namespace events class LayoutInfo : public ColumnType

Defines an event layout information record

Inheritance:


Public Fields

typedef IndexList <ColumnInfo> ColumnList
Column list

Public Methods

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

Protected Methods

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.

typedef IndexList <ColumnInfo> ColumnList
Column list

LayoutInfo()
Creates an empty event layout.

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

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

bool 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.

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

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

void RefCount(bool up)
Reference counting

int GetRefCount() const
Get reference count

bool 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.
Returns:
true if column exists and can be read
Parameters:
name - Name of column
data - Pointer to event data block
val - Return value (return)

bool 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.
Returns:
true if column exists and can be set
Parameters:
name - Name of column
data - Pointer to event data block
val - Set value

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

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

const ColumnInfoList& GetColumnList() const
Get the column information

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

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

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

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

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

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

bool Destruct(data_ptr data)
Destruct the event data

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

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

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

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

static 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.
Returns:
true if suucess.
Parameters:
nameOrg - column name
nameFirst - First part of the name (return)
nameRem - Remainder of the name (return)

static 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).
Returns:
true if valid array index
Parameters:
str - Array index string
first - First index (return)
left - Remainder of indices (return)

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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++