[MERGE] libi2ncommon: (reinhard) added clear() method to Interval and Intervals.
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 8 Jul 2008 11:32:24 +0000 (11:32 +0000)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 8 Jul 2008 11:32:24 +0000 (11:32 +0000)
src/timefunc.cpp
src/timefunc.hxx

index f54a11f..139862b 100644 (file)
@@ -363,6 +363,16 @@ string get_month_name(unsigned char month)
 ** implementaion of Interval
 */
 
+
+/**
+ * @brief clears the interval (make it empty).
+ */
+void Interval::clear()
+{
+    m_lower_bound = m_upper_bound = 0;
+} // eo Interval::clear()
+
+
 /**
  * @brief tests if there is some overlapping with another interval
  * @param other the other interval
@@ -404,6 +414,11 @@ Intervals::Intervals()
 } // eo Intervals::Intervals
 
 
+void Intervals::clear()
+{
+    m_intervals.clear();
+} // eo Intervals::clear()
+
 /**
  * @brief tests if one of the intervals of the list intersects with the given interval.
  * @param other the interval to check for intersection.
index b4657b5..68fb538 100644 (file)
@@ -92,6 +92,9 @@ class Interval
         {
         } //
 
+
+        void clear();
+
         bool is_valid() const
         {
             return m_lower_bound <= m_upper_bound;
@@ -171,6 +174,7 @@ class Intervals
         void add(const Interval& new_frame);
         void sub(const Interval& new_frame);
 
+        void clear();
 
         const_iterator begin() const { return m_intervals.begin(); }
         const_iterator end() const { return m_intervals.end(); }