In file trig/SegList.hh:

class LockSegList

Segment list class.

Inheritance:


Public Methods

[more]explicit LockSegList (const char* lid, const char* file=0)
Segment list constructor
[more]virtual ~LockSegList (void)
Segment list destructor
[more] LockSegList (void)
Segment default constructor
[more]bool check (void) const
Check that segments are inserted in order.
[more]void clear (void)
Erase all the segments in the list
[more]void coalesce (void)
Coalesce overlapping segments
[more]size_type find (const Time& t) const throw(std::domain_error)
Look for the segment containing the specified time
[more]size_type findafter (const Time& t) const
Find the first segment that ends after the specified time.
[more]const char* getListID (void) const
Return the list title
[more]bool inSegment (const Time& t) const
Test whether the specified time is within one of the segments in the list
[more]bool inSegment (const Time& t, const Time& t2) const
Test whether any time between the specified start and end time is within one or more of the list segments
[more]void insert (const LockSegment& l)
Insert a copy of the specified segment into the list.
[more]void invert (void)
Invert the segment list.
[more]Interval live (Time start=Time(0), Time end=Time(SEGMENT_TINF)) const
Calculate the "live time" of the segments list. Return the sum of all segment durations between the start and the end time.
[more]void merge (const LockSegment& seg)
Insert a segment into the list.
[more]void pad (Interval pFront=0, Interval pBack=0)
Pad the front and back of each segment in the list by pFront and pBack.
[more]void read (const std::string& file)
Fill segment list from the contents of the specified file
[more]void setDebug (int lvl)
Set the debug printout level
[more]size_type size (void) const
Return the number of segments in the list
[more]void sort (void)
Sort the list
[more]void stuff (const LockSegment& seg)
Add an segment to the end of the list (unsorted insertion)
[more]const LockSegment& operator[] (size_type seg) const
Return a constant reference to the specified segment
[more]const LockSegment& operator[] (const Time& t) const throw(std::domain_error)
Return a constant reference to the segment containing the specified time
[more]LockSegList& operator|= (const LockSegList& t)
Replace the current list with the union of the list and the argument
[more]LockSegList& operator&= (const LockSegList& t)
Replace the current list with the intersection of the list and the argument
[more]LockSegList& operator^= (const LockSegList& t)
Replace the current list with the differences between the current list and the argument list argument
[more]bool overlap (const Time& t, const Time& t2) const
Test whether any segments in the list overlap the specified time span
[more]std::ostream& putID (std::ostream& out, size_type inx) const
Write a segment specifier to the list.


Documentation

LockSegList is a list of LockSegment objects ordered by Start Time.

oexplicit LockSegList(const char* lid, const char* file=0)
Segment list constructor

ovirtual ~LockSegList(void)
Segment list destructor

o LockSegList(void)
Segment default constructor

obool check(void) const
Check that segments are inserted in order. print errors to cerr.

ovoid clear(void)
Erase all the segments in the list

ovoid coalesce(void)
Coalesce overlapping segments

osize_type find(const Time& t) const throw(std::domain_error)
Look for the segment containing the specified time

osize_type findafter(const Time& t) const
Find the first segment that ends after the specified time. The index of the found segment is returned. If there are no segments after the specified time, an index equal to the size of segment list is returned.

oconst char* getListID(void) const
Return the list title

obool inSegment(const Time& t) const
Test whether the specified time is within one of the segments in the list

obool inSegment(const Time& t, const Time& t2) const
Test whether any time between the specified start and end time is within one or more of the list segments

ovoid insert(const LockSegment& l)
Insert a copy of the specified segment into the list. The segment is inserted to maintain an increasing start-time order.

ovoid invert(void)
Invert the segment list. The gaps between successive segments are converted to segments and the original segments are removed.

oInterval live(Time start=Time(0), Time end=Time(SEGMENT_TINF)) const
Calculate the "live time" of the segments list. Return the sum of all segment durations between the start and the end time.

ovoid merge(const LockSegment& seg)
Insert a segment into the list. If the segment overlaps existing one or more segments, the segments are combined. @merge a segment into the list.
Parameters:
seg - Segent to be merged intot the list.

ovoid pad(Interval pFront=0, Interval pBack=0)
Pad the front and back of each segment in the list by pFront and pBack. The pFront and pBack intervals are defined such that a positive interval increases the segment duration and a negative interval decreases the resulting segment duration. i.e. the resulting segment is [start - pStart, end + pBack]. Segments are coalesced after the the padding is added.
Parameters:
pFront - Length of padding to add to the start of the segment.
pBack - Length of padding to add to the back of the segment.

ovoid read(const std::string& file)
Fill segment list from the contents of the specified file

ovoid setDebug(int lvl)
Set the debug printout level

osize_type size(void) const
Return the number of segments in the list

ovoid sort(void)
Sort the list

ovoid stuff(const LockSegment& seg)
Add an segment to the end of the list (unsorted insertion)

oconst LockSegment& operator[](size_type seg) const
Return a constant reference to the specified segment

oconst LockSegment& operator[](const Time& t) const throw(std::domain_error)
Return a constant reference to the segment containing the specified time

oLockSegList& operator|=(const LockSegList& t)
Replace the current list with the union of the list and the argument

oLockSegList& operator&=(const LockSegList& t)
Replace the current list with the intersection of the list and the argument

oLockSegList& operator^=(const LockSegList& t)
Replace the current list with the differences between the current list and the argument list argument

obool overlap(const Time& t, const Time& t2) const
Test whether any segments in the list overlap the specified time span

ostd::ostream& putID(std::ostream& out, size_type inx) const
Write a segment specifier to the list. The list specifier consists of the List ID followed by a hyphen and the segment identifier.


This class has no child classes.
Author:
J.Zweizig
Version:
1.2; last modified 11/03/2006

Alphabetic index HTML hierarchy of classes or Java


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