In file List.hh:

class List

List of events

Inheritance:


Public Methods

[more] List ()
Default constructor
[more]explicit List (const char* filename, bool keepforever = true)
Constructor
[more]List* Copy () const
Copy the event
[more]int Size () const
Size
[more]bool Empty () const
Empty
[more]int MaxSize () const
Maximum Size
[more]int Capacity () const
Capacity
[more]void Reserve (size_type num)
Capacity
[more]bool operator== (const List& l) const
Equality
[more]bool operator!= (const List& l) const
Equality
[more]bool CheckOrder () const
Check order
[more]void Swap (List& l)
Swap
[more]iterator LowerBound (const Time& t)
Lower bound
[more]const_iterator LowerBound (const Time& t) const
Lower bound
[more]iterator UpperBound (const Time& t)
Upper bound
[more]const_iterator UpperBound (const Time& t) const
Upper bound
[more]iterator LowerBound (const Event& t)
Lower bound
[more]const_iterator LowerBound (const Event& t) const
Lower bound
[more]iterator UpperBound (const Event& t)
Upper bound
[more]const_iterator UpperBound (const Event& t) const
Upper bound
[more]void Sort ()
Sort
[more]void Sort (const Function& func, bool ascending = true)
Sort
[more]reference At (size_type idx)
At
[more]const_reference At (size_type idx) const
At
[more]reference operator[] (size_type idx)
Operator[]
[more]const_reference operator[] (size_type idx) const
Operator[]
[more]reference Front ()
Front
[more]const_reference Front () const
Front
[more]reference Back ()
Back
[more]const_reference Back () const
Back
[more]iterator Begin ()
Begin
[more]const_iterator Begin () const
Begin
[more]iterator End ()
End
[more]const_iterator End () const
End
[more]reverse_iterator RBegin ()
RBegin
[more]const_reverse_iterator RBegin () const
RBegin
[more]reverse_iterator REnd ()
REnd
[more]const_reverse_iterator REnd () const
REnd
[more]iterator Insert (const Event& event)
Add
[more]iterator Insert (const iterator& pos, const Event& event)
Add
[more]void Insert (const iterator& beg, const iterator& end)
Add
[more]void PushBack (const Event& event)
PushBack
[more]iterator Erase (const iterator& pos)
Erase
[more]iterator Erase (const iterator& beg, const iterator& end)
Erase
[more]void PopBack ()
PopBack
[more]void Clear ()
Clear
[more]state GetState () const
Get the state
[more]bool Load (bool keepforever = true)
Load
[more]bool Load (const char* filename, bool keepforever = true)
Load
[more]bool Unload ()
Unload
[more]bool Save (const char* filename) const
Save
[more]void SetFilename (const char* filename)
Set the filename
[more]const char* GetFilename () const
Get the filename

Public Members

[more]enum state
State of the event list
[more]typedef std::vector<Event> eventlist
Event list basic type
[more]typedef eventlist::value_type value_type
Value type
[more]typedef eventlist::size_type size_type
Size type
[more]typedef eventlist::difference_type difference_type
Difference type
[more]typedef eventlist::reference reference
Reference type
[more]typedef eventlist::const_reference const_reference
Const reference type
[more]typedef eventlist::pointer pointer
Pointer type
[more]typedef eventlist::const_pointer const_pointer
Const pointer type
[more]typedef Iterator iterator
Iterator
[more]typedef ConstIterator const_iterator
Const iterator
[more]typedef ReverseIterator reverse_iterator
Iterator
[more]typedef ConstReverseIterator const_reverse_iterator
Const iterator


Documentation

An event list contains a series of events. An event list is sorted in time. An event list has the following four states: (1) Empty: An empty list contains nothing and has not been loaded from file; (2) Loaded: A loaded event list has been read from file and is still in its original state (meaning it can be unloaded again); (3) Locked: A locked event list is loaded but can not be discared; and (4) Modified: The event list was modified by the user (meaning it can not be unloaded).

An event list contains events ordered by time with the oldest event being stored first. For efficiency reasons List provides algorithms which let you add events without checking that they are in correct orderer. In this case the user has to guarantee that the sort order is maintained, or call the Sort method afterwards.

oenum state
State of the event list

o kEmpty
Empty

o kLoaded
Loaded into memory

o kLocked
Loaded into memory and locked

o kModified
In memory and modified

otypedef std::vector<Event> eventlist
Event list basic type

otypedef eventlist::value_type value_type
Value type

otypedef eventlist::size_type size_type
Size type

otypedef eventlist::difference_type difference_type
Difference type

otypedef eventlist::reference reference
Reference type

otypedef eventlist::const_reference const_reference
Const reference type

otypedef eventlist::pointer pointer
Pointer type

otypedef eventlist::const_pointer const_pointer
Const pointer type

otypedef Iterator iterator
Iterator

otypedef ConstIterator const_iterator
Const iterator

otypedef ReverseIterator reverse_iterator
Iterator

otypedef ConstReverseIterator const_reverse_iterator
Const iterator

o List()
Creates an empty eventlist.

oexplicit List(const char* filename, bool keepforever = true)
Reads an event list from file.
Parameters:
filename - Name of file
keepforever - Load and lock in memory if true

oList* Copy() const
Returns a copy of the event list. This method must be overriden by all descendents.
Returns:
event copy

oint Size() const
Size of list.

obool Empty() const
Empty list?

oint MaxSize() const
Maximum size of list.

oint Capacity() const
Capacity of list.

ovoid Reserve(size_type num)
Capacity of list.

obool operator== (const List& l) const
Equality operator.

obool operator!= (const List& l) const
Inequality operator.

obool CheckOrder() const
Check if events are stored in proper time order.

ovoid Swap(List& l)
Swap the list.

oiterator LowerBound(const Time& t)
Lower bound.

oconst_iterator LowerBound(const Time& t) const
Lower bound.

oiterator UpperBound(const Time& t)
Upper bound.

oconst_iterator UpperBound(const Time& t) const
Upper bound.

oiterator LowerBound(const Event& t)
Lower bound.

oconst_iterator LowerBound(const Event& t) const
Lower bound.

oiterator UpperBound(const Event& t)
Upper bound.

oconst_iterator UpperBound(const Event& t) const
Upper bound.

ovoid Sort()
Sort the list by event time.

ovoid Sort(const Function& func, bool ascending = true)
Sort the list by the specified function in ascending or descending order.

oreference At(size_type idx)
At.

oconst_reference At(size_type idx) const
At.

oreference operator[] (size_type idx)
Operator [].

oconst_reference operator[] (size_type idx) const
Operator [].

oreference Front()
Front.

oconst_reference Front() const
Front.

oreference Back()
Back.

oconst_reference Back() const
Back.

oiterator Begin()
Begin.

oconst_iterator Begin() const
Begin.

oiterator End()
End.

oconst_iterator End() const
End.

oreverse_iterator RBegin()
RBegin.

oconst_reverse_iterator RBegin() const
RBegin.

oreverse_iterator REnd()
REnd.

oconst_reverse_iterator REnd() const
REnd.

oiterator Insert(const Event& event)
Insert an event to the list at the proper location.

oiterator Insert(const iterator& pos, const Event& event)
Insert an event to the list at the specified location.

ovoid Insert(const iterator& beg, const iterator& end)
Inserts a range of events.

ovoid PushBack(const Event& event)
Inserts an event at the back.

oiterator Erase(const iterator& pos)
Erase an event.

oiterator Erase(const iterator& beg, const iterator& end)
Erase a rane of events.

ovoid PopBack()
Removes an event from the back.

ovoid Clear()
Clear the list.

ostate GetState() const
Get the state.

obool Load(bool keepforever = true)
Load the list from file.
Parameters:
keepforever - Load and lock in memory if true

obool Load(const char* filename, bool keepforever = true)
Load the list from specified file.
Parameters:
filename - Name of file
keepforever - Load and lock in memory if true

obool Unload()
Unload the event list if possible.
Returns:
true if able to unload

obool Save(const char* filename) const
Save the list to the specified file.
Parameters:
filename - Name of file

ovoid SetFilename(const char* filename)
Set the filename.

oconst char* GetFilename() const
Get the filename.


This class has no child classes.
Friends:
class Chain
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