In file Layout.hh:

class Layout : public ColumnType

Defines an event layout

Inheritance:


Public Methods

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

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

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

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

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

Layout(const Layout& layout)
Copy constructor

~Layout()
Destroys an event layout.

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

bool operator== (const Layout& layout) const
Equality operator

bool operator!= (const Layout& layout) const
Inequality operator

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

int GetRefCount() const
Get reference count

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

Name GetName(const_data_ptr data) const
Returns the event name

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

Time GetTime(const_data_ptr data) const
Returns the event time

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

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

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

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

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

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

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

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

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

bool Register()
Register the current layout with the event factory.
Returns:
True if successful
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

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

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

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

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

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

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

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


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