~ubuntu-branches/ubuntu/wily/deal.ii/wily-proposed

« back to all changes in this revision

Viewing changes to contrib/boost/include/boost/date_time/time_duration.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV, Adam C. Powell, IV, Denis Barbier
  • Date: 2010-07-29 13:47:01 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100729134701-qk60t2om7u7oklkb
Tags: 6.3.1-1
[ Adam C. Powell, IV ]
* Changed to source format 3.0 (quilt).
* Changed maintainer to debian-science with Adam Powell as uploader.
* Added source lintian overrides about Adam Powell's name.
* Added Vcs info on git repository.
* Bumped Standards-Version.
* Changed stamp-patch to patch target and fixed its application criterion.
* Moved make_dependencies and expand_instantiations to a versioned directory
  to avoid shlib package conflicts.

[ Denis Barbier ]
* New upstream release (closes: #562332).
  + Added libtbb support.
  + Forward-ported all patches.
* Updates for new PETSc version, including workaround for different versions
  of petsc and slepc.
* Add debian/watch.
* Update to debhelper 7.
* Added pdebuild patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * Boost Software License, Version 1.0. (See accompanying
7
7
 * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
8
8
 * Author: Jeff Garland, Bart Garst
9
 
 * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $
 
9
 * $Date: 2009-06-04 04:24:49 -0400 (Thu, 04 Jun 2009) $
10
10
 */
11
11
 
12
 
#include "boost/operators.hpp"
13
 
#include "boost/date_time/time_defs.hpp"
14
 
#include "boost/date_time/special_defs.hpp"
15
 
#include "boost/date_time/compiler_config.hpp"
 
12
#include <boost/cstdint.hpp>
 
13
#include <boost/operators.hpp>
 
14
#include <boost/date_time/time_defs.hpp>
 
15
#include <boost/date_time/special_defs.hpp>
 
16
#include <boost/date_time/compiler_config.hpp>
16
17
 
17
18
namespace boost {
18
19
namespace date_time {
19
20
 
20
 
  
 
21
 
21
22
  //! Represents some amount of elapsed time measure to a given resolution
22
23
  /*! This class represents a standard set of capabilities for all
23
24
      counted time durations.  Time duration implementations should derive
30
31
  */
31
32
  template<class T, typename rep_type>
32
33
  class time_duration : private
33
 
      boost::less_than_comparable<T 
 
34
      boost::less_than_comparable<T
34
35
    , boost::equality_comparable<T
35
36
    > >
36
37
  /* dividable, addable, and subtractable operator templates
37
 
   * won't work with this class (MSVC++ 6.0). return type 
38
 
   * from '+=' is different than expected return type 
39
 
   * from '+'. multipliable probably wont work 
 
38
   * won't work with this class (MSVC++ 6.0). return type
 
39
   * from '+=' is different than expected return type
 
40
   * from '+'. multipliable probably wont work
40
41
   * either (haven't tried) */
41
42
  {
42
43
  public:
50
51
    typedef typename rep_type::tick_type tick_type;
51
52
    typedef typename rep_type::impl_type impl_type;
52
53
 
53
 
    time_duration() : ticks_(0) {} 
54
 
    time_duration(hour_type hours_in, 
55
 
                  min_type minutes_in, 
 
54
    time_duration() : ticks_(0) {}
 
55
    time_duration(hour_type hours_in,
 
56
                  min_type minutes_in,
56
57
                  sec_type seconds_in=0,
57
58
                  fractional_seconds_type frac_sec_in = 0) :
58
 
      ticks_(rep_type::to_tick_count(hours_in,minutes_in,seconds_in,frac_sec_in)) 
 
59
      ticks_(rep_type::to_tick_count(hours_in,minutes_in,seconds_in,frac_sec_in))
59
60
    {}
60
61
    // copy constructor required for dividable<>
61
62
    //! Construct from another time_duration (Copy constructor)
136
137
    }
137
138
    duration_type invert_sign() const
138
139
    {
139
 
      return duration_type(ticks_ * (-1)); 
140
 
    }    
 
140
      return duration_type(ticks_ * (-1));
 
141
    }
141
142
    bool is_negative() const
142
143
    {
143
144
      return ticks_ < 0;
144
 
    }    
145
 
    bool operator<(const time_duration& rhs)  const 
 
145
    }
 
146
    bool operator<(const time_duration& rhs)  const
146
147
    {
147
148
      return ticks_ <  rhs.ticks_;
148
149
    }
149
 
    bool operator==(const time_duration& rhs)  const 
 
150
    bool operator==(const time_duration& rhs)  const
150
151
    {
151
152
      return ticks_ ==  rhs.ticks_;
152
153
    }
188
189
    {
189
190
      return duration_type(ticks_ * rhs);
190
191
    }
191
 
    duration_type operator*=(int divisor) 
 
192
    duration_type operator*=(int divisor)
192
193
    {
193
194
      ticks_ = ticks_ * divisor;
194
195
      return duration_type(ticks_);
195
196
    }
196
 
    tick_type ticks() const 
197
 
    { 
 
197
    tick_type ticks() const
 
198
    {
198
199
      return traits_type::as_number(ticks_);
199
200
    }
200
201
 
258
259
 
259
260
  //! Template for instantiating derived adjusting durations
260
261
  /* These templates are designed to work with multiples of
261
 
   * 10 for frac_of_second and resoultion adjustment 
 
262
   * 10 for frac_of_second and resoultion adjustment
262
263
   */
263
 
   template<class base_duration, boost::int64_t frac_of_second>
 
264
  template<class base_duration, boost::int64_t frac_of_second>
264
265
  class subsecond_duration : public base_duration
265
266
  {
266
267
  public:
270
271
    {}
271
272
  };
272
273
 
273
 
  
274
 
  
 
274
 
 
275
 
275
276
} } //namespace date_time
276
277
 
277
278