In file Factory.hh:

class Factory

Defines an event factory

Inheritance:


Public Methods

[more]static Factory& Get ()
Event factory
[more]bool RegisterType (const char* name, TypeInfo*& type)
Register type
[more]TypeInfo* GetType (const char* name)
Get type
[more]static bool MatchType (const Type& type, const char* pat)
Match operator
[more]static bool CheckTypeName (const char* name)
Check type/subtype name
[more]bool RegisterName (const char* name, int& id)
Register name
[more]int GetNameId (const char* name)
Get name id
[more]const char* GetNameStr (int id)
Get name
[more]static bool MatchName (const Name& name, const char* pat)
Match operator
[more]static bool CheckNameName (const char* name)
Check name
[more]void InitBasicLayouts ()
Initializes the layout list
[more]const LayoutInfo* RegisterLayout (const LayoutInfo& layout)
Register layout
[more]const LayoutInfo* LookupLayout (const Type& type)
Lookup layout
[more]const LayoutInfo* StandardLayout (const char* name)
Standard layout
[more]int GetLayoutAddColVers ()
Get layout add column modification version
[more]void IncreaseLayoutAddColVers ()
Increase layout add column modification version
[more]bool AddFixedColumn (const ColumnInfo& desc)
Add fixed column
[more]const ColumnInfo* GetFixedColumn (const char* name)
Check fixed column
[more]const ColumnInfoList& FixedColumns ()
Get list of fixed columns
[more]const ColumnList& FixedColumnIndex ()
Get index list of fixed columns
[more]int GetNextAvailableColumnOffset ()
Get first available offset
[more]int GetNextAvailableColumnNumber ()
Get first available column number
[more]static bool IfoString2Tag (const char* ifostring, IfoTag& tag)
String to tag
[more]static bool IfoString2Tags (const char* ifostring, IfoTagList& list)
String to tag list
[more]static bool IfoTag2String (IfoTag& tag, std::string& ifostring)
Tag to string
[more]int IfoRegister (const char* ifostring)
Register the ifo
[more]int IfoGetBit (const char* ifostring)
Get the ifo bit
[more]bool IfoGetBits (const char* ifostring, IfoSet::ifoset_type& ifoset)
Get the ifo bits
[more]std::string IfoGetTag (int bit)
Get the ifo tag
[more]bool IfoGetTags (const IfoSet::ifoset_type& ifoset, std::string& ifostring)
Get the ifo bits
[more]void DumpAllTypes (std::ostream& os) const
Dump all registered types.
[more]void DumpAllNames (std::ostream& os) const
Dump all registered names.
[more]void DumpAllLayouts (std::ostream& os) const
Dump all registered layouts.

Public Members

[more]typedef LayoutInfo::ColumnList ColumnList
Fixed column list
[more]typedef std::pair<char, int> IfoTag
Interferometer tag
[more]typedef std::vector<IfoTag> IfoTagList
Interferometer tag list
class NameRecord
Name record
[more]typedef IndexList<NameRecord> NameList
Name list


Documentation

Defines the event factory. Every program creates a global event factory which is used to manage event types and event layouts.

otypedef LayoutInfo::ColumnList ColumnList
Fixed column list

otypedef std::pair<char, int> IfoTag
Interferometer tag

otypedef std::vector<IfoTag> IfoTagList
Interferometer tag list

otypedef IndexList<NameRecord> NameList
Name list

ostatic Factory& Get()
Reference to the global event factory.

obool RegisterType(const char* name, TypeInfo*& type)
Register an event type.
Parameters:
name - Event type name
type - Event type information (return)
subtype - Event subtype id (return)
Returns:
true if successful

oTypeInfo* GetType(const char* name)
Get an event type.
Parameters:
name - Event name
Returns:
Pointer to type information if exist

ostatic bool MatchType(const Type& type, const char* pat)
Tests if the pattern matches the event type. The pattern can contain a wildcard.
Parameters:
type - Event type to match against
pat - Pattern for event name
Returns:
true if event type matches pattern

ostatic bool CheckTypeName(const char* name)
Check if a valid type or subtype name. May not contain parentheses, brackets, dots, stars, question marks or spaces.
Parameters:
name - Type or Subtype name
Returns:
True if a valid type/subtype name

obool RegisterName(const char* name, int& id)
Register an event name.
Parameters:
name - Event name
id - Event name id information (return)
Returns:
true if successful

oint GetNameId(const char* name)
Get an event name id.
Parameters:
name - Event name
Returns:
name Id or zero

oconst char* GetNameStr(int id)
Get an event name.
Parameters:
id - Event id
Returns:
name string or NULL

ostatic bool MatchName(const Name& name, const char* pat)
Tests if the pattern matches the event name. The pattern can contain a wildcard.
Parameters:
name - Event name to match against
pat - Pattern for event name
Returns:
true if event name matches pattern

ostatic bool CheckNameName(const char* name)
Check if a valid event name. May not contain parentheses, brackets, dots, stars, question marks or spaces.
Parameters:
name - Name
Returns:
True if a valid event name

ovoid InitBasicLayouts()
Initializes the basic set of event layout.

oconst LayoutInfo* RegisterLayout(const LayoutInfo& layout)
Register an event layout.
Parameters:
layout - Event layout
Returns:
Layout info

oconst LayoutInfo* LookupLayout(const Type& type)
Lookup a layout.
Parameters:
type - Event type
Returns:
Layout info

oconst LayoutInfo* StandardLayout(const char* name)
Lookup a predefined layout.
Parameters:
name - Event type
Returns:
Layout info

oint GetLayoutAddColVers()
Get the Layout add column modification version.
Returns:
version

ovoid IncreaseLayoutAddColVers()
Increase the layout add column modification version.

obool AddFixedColumn(const ColumnInfo& desc)
Add a fixed event column (must be done before anything else).
Parameters:
desc - Column descriptor
Returns:
True if successful

oconst ColumnInfo* GetFixedColumn(const char* name)
Check if the name corresponds to a fixed column.
Parameters:
name - Event column name
Returns:
Column descriptor

oconst ColumnInfoList& FixedColumns()
Get the fixed column descriptor list.
Returns:
Column descriptor list

oconst ColumnList& FixedColumnIndex()
Get the fixed column index list.
Returns:
Column descriptor list

oint GetNextAvailableColumnOffset()
Get next available column offset (in bytes).
Returns:
Offset

oint GetNextAvailableColumnNumber()
Get next available column number.
Returns:
Offset

ostatic bool IfoString2Tag(const char* ifostring, IfoTag& tag)
Returns the tag corresponding to the interferometer string.
Parameters:
ifostring - Interferometer string
tag - Interferometer tag (return)
Returns:
True if successful

ostatic bool IfoString2Tags(const char* ifostring, IfoTagList& list)
Returns the tag list corresponding to the interferometer string.
Parameters:
ifostring - Interferometer string
tag - Interferometer tag list (return)
Returns:
True if successful

ostatic bool IfoTag2String(IfoTag& tag, std::string& ifostring)
Returns the string corresponding to the interferometer tag.
Parameters:
tag - Interferometer tag
ifostring - Interferometer string (return)
Returns:
True if successful

oint IfoRegister(const char* ifostring)
Register a new interferometer.
Parameters:
ifostring - Interferometer string
Returns:
Bit index of ifo, or <0 on error

oint IfoGetBit(const char* ifostring)
Get the bit index of an interferometer tag. An ifo tag has to contain a single letter and a number. Returns -1 if the interferometer does not exist.
Parameters:
ifostring - Interferometer string
Returns:
Bit index of tag

obool IfoGetBits(const char* ifostring, IfoSet::ifoset_type& ifoset)
Get the encoded value of a set of interferometer tags.
Parameters:
ifostring - Interferometer string
ifoset - Bit encoded value (return)
Returns:
True if successful

ostd::string IfoGetTag(int bit)
Get the string of an ifo tag. An empty string is returned if the tag does not exist.
Parameters:
bit - Index of tag
Returns:
Interferometer string

obool IfoGetTags(const IfoSet::ifoset_type& ifoset, std::string& ifostring)
Get the interferometer set string from the bit encoded value.
Parameters:
ifoset - Bit encoded value
ifostring - Interferometer string (return)
Returns:
True if successful

ovoid DumpAllTypes(std::ostream& os) const
Dump all registered types.
Parameters:
os - output stream

ovoid DumpAllNames(std::ostream& os) const
Dump all registered names.
Parameters:
os - output stream

ovoid DumpAllLayouts(std::ostream& os) const
Dump all registered layouts.
Parameters:
os - output stream


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