In file Factory.hh:

namespace events class Factory

Defines an event factory

Inheritance:


Public Classes

class NameRecord
Name record

Public Fields

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

Public Methods

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

Documentation

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

typedef LayoutInfo::ColumnList ColumnList
Fixed column list

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

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

class NameRecord
Name record

typedef IndexList <NameRecord> NameList
Name list

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

const ColumnList& FixedColumnIndex()
Get index list of fixed columns
Returns:
Column descriptor list

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

int GetNextAvailableColumnNumber()
Get first available column number
Returns:
Offset

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

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

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

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

int 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.
Returns:
Bit index of tag
Parameters:
ifostring - Interferometer string

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

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

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

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

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

void 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 hierarchy of classes


Please send questions and comments to sigg_d@ligo-wa.caltech.edu


generated by doc++