In file Layout.hh:

class Layout

Defines an event layout

Inheritance:


Public Methods

[more] Layout (const LayoutInfo* info = 0)
Default constructor
[more]explicit Layout (const Type& type)
Constructor
[more]explicit Layout (const char* name)
Constructor
[more]explicit Layout (const std::string& name)
Constructor
[more] Layout (const Layout& layout)
Copy constructor
[more] ~Layout ()
Destructor
[more]Layout& operator= (const Layout& layout)
Assignment operator
[more]bool operator== (const Layout& layout) const
Equality operator
[more]bool operator!= (const Layout& layout) const
Inequality operator
[more]bool IsRegistered () const
Registered layout?
[more]int GetRefCount () const
Get reference count
[more]int GetColumNum (const_data_ptr data) const
Gets the column number of an event
[more]Name GetName (const_data_ptr data) const
Gets the event name
[more]void SetName (data_ptr data, const Name& name)
Sets the event name
[more]Time GetTime (const_data_ptr data) const
Gets the event time
[more]void SetTime (data_ptr data, const Time& time)
Sets the event time
[more]ColumnType::ColumnIfo_t GetIfo (const_data_ptr data) const
Gets the event ifo set
[more]void SetIfo (data_ptr data, const ColumnType::ColumnIfo_t& ifo)
Sets the event ifo set
[more]std::string GetIfoStr (const_data_ptr data) const
Gets the event ifo string
[more]void SetIfoStr (data_ptr data, const char* ifo)
Sets the event ifo set
[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]bool SetType (const Type& type)
Sets the event type
[more]bool GetType (Type& type) 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]void Swap (Layout& l)
Swap a layout
[more]bool Register ()
Register the layout globaly
[more]void Dump (std::ostream& os) const
Dump column names to specified output stream.
[more]void Dump () const
Dump column names to specified output stream.
[more]static void DumpAll (std::ostream& os)
Dump all registered layouts to specified output stream.
[more]static void DumpAll ()
Dump all registered layouts to specified output stream.
[more]static const Layout& GetSimple ()
Get "simple" layout
[more]static const Layout& GetStandard ()
Get "standard" layout
[more]static Layout GetCoincidence (int order = 2)
Get "coincidence" layout
[more]static Layout GetCluster (int eventnum)
Get "cluster" layout


Documentation

An event layout is used to describe an event. The layout basically contains a pointer to a event layout information record. A layout can be registered which means it points to a global event layout registered by the event factory. A registerd layout is read-only. A layout owns the layout information record if it isn't registered.

o Layout(const LayoutInfo* info = 0)
Creates an event layout from a layout information record.

oexplicit Layout(const Type& type)
Creates an event layout from a type.

oexplicit Layout(const char* name)
Creates an event layout from type name and subtype name.

oexplicit Layout(const std::string& name)
Creates an event layout from type name and subtype name.

o Layout(const Layout& layout)
Copy constructor.

o ~Layout()
Destroys an event layout.

oLayout& operator= (const Layout& layout)
Assignment operator.

obool operator== (const Layout& layout) const
Equality operator.

obool operator!= (const Layout& layout) const
Inequality operator.

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

oint GetRefCount() const
Get reference count

oint GetColumNum(const_data_ptr data) const
Returns the number of columns of the event.

oName GetName(const_data_ptr data) const
Returns the event name

ovoid SetName(data_ptr data, const Name& name)
Sets the event name

oTime GetTime(const_data_ptr data) const
Returns the event time

ovoid SetTime(data_ptr data, const Time& time)
Sets the event time

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

ovoid SetIfo(data_ptr data, const ColumnType::ColumnIfo_t& ifo)
Sets the event ifo set

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

ovoid SetIfoStr(data_ptr data, const char* ifo)
Sets the event ifo set

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

obool SetType(const Type& type)
Sets the event type of the layout. The type has to be corerspond to a registered layout.

obool GetType(Type& type) 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

ovoid Swap(Layout& l)
Swap a layout with the current

obool Register()
Register the current layout with the event factory.
Parameters:
usesubtype - True if layout should be subtype specific
Returns:
True if successful

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

ovoid Dump() const
Dump column names to standard output stream.
Parameters:
os - output stream

ostatic void DumpAll(std::ostream& os)
Dump all registered layouts to specified output stream.
Parameters:
os - output stream

ostatic void DumpAll()
Dump all registered layouts to standard output stream.
Parameters:
os - output stream

ostatic const Layout& GetSimple()
Get the minimal layout.
Returns:
Simple layout

ostatic const Layout& GetStandard()
Get the standard layout.
Returns:
Standard layout

ostatic Layout GetCoincidence(int order = 2)
Get the coincidence layout. The coincidence order determines the subtype.
Parameters:
- Coincidence order
Returns:
Coincidence layout

ostatic Layout GetCluster(int eventnum)
Get the cluster layout. The number of events in the cluster determines the subtype.
Parameters:
eventnum - Number of events in cluster
Returns:
Cluster layout


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