In file List.hh:

namespace events class List

List of events

Inheritance:


Public Classes

enum state
State of the event list
kEmpty
Empty
kLoaded
Loaded into memory
kLocked
Loaded into memory and locked
kModified
In memory and modified

Public Fields

typedef std::vector <Event> eventlist
Event list basic type
typedef eventlist::value_type value_type
Value type
typedef eventlist::size_type size_type
Size type
typedef eventlist::difference_type difference_type
Difference type
typedef eventlist::reference reference
Reference type
typedef eventlist::const_reference const_reference
Const reference type
typedef eventlist::pointer pointer
Pointer type
typedef eventlist::const_pointer const_pointer
Const pointer type
typedef Iterator iterator
Iterator
typedef ConstIterator const_iterator
Const iterator
typedef ReverseIterator reverse_iterator
Iterator
typedef ConstReverseIterator const_reverse_iterator
Const iterator

Public Methods

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

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.

enum state
State of the event list

kEmpty
Empty

kLoaded
Loaded into memory

kLocked
Loaded into memory and locked

kModified
In memory and modified

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

typedef eventlist::value_type value_type
Value type

typedef eventlist::size_type size_type
Size type

typedef eventlist::difference_type difference_type
Difference type

typedef eventlist::reference reference
Reference type

typedef eventlist::const_reference const_reference
Const reference type

typedef eventlist::pointer pointer
Pointer type

typedef eventlist::const_pointer const_pointer
Const pointer type

typedef Iterator iterator
Iterator

typedef ConstIterator const_iterator
Const iterator

typedef ReverseIterator reverse_iterator
Iterator

typedef ConstReverseIterator const_reverse_iterator
Const iterator

List()
Creates an empty eventlist.

explicit 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

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

int Size() const
Size of list.

bool Empty() const
Empty list?

int MaxSize() const
Maximum size of list.

int Capacity() const
Capacity of list.

void Reserve(size_type num)
Capacity of list.

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

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

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

void Swap(List& l)
Swap the list.

iterator LowerBound(const Time& t)
Lower bound

const_iterator LowerBound(const Time& t) const
Lower bound

iterator UpperBound(const Time& t)
Upper bound

const_iterator UpperBound(const Time& t) const
Upper bound

iterator LowerBound(const Event& t)
Lower bound

const_iterator LowerBound(const Event& t) const
Lower bound

iterator UpperBound(const Event& t)
Upper bound

const_iterator UpperBound(const Event& t) const
Upper bound

void Sort()
Sort the list by event time.

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

reference At(size_type idx)
At

const_reference At(size_type idx) const
At

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

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

reference Front()
Front

const_reference Front() const
Front

reference Back()
Back

const_reference Back() const
Back

iterator Begin()
Begin

const_iterator Begin() const
Begin

iterator End()
End

const_iterator End() const
End

reverse_iterator RBegin()
RBegin

const_reverse_iterator RBegin() const
RBegin

reverse_iterator REnd()
REnd

const_reverse_iterator REnd() const
REnd

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

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

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

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

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

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

void PopBack()
Removes an event from the back.

void Clear()
Clear the list.

state GetState() const
Get the state

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

bool 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

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

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

void SetFilename(const char* filename)
Set the filename

const char* GetFilename() const
Get the filename


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