DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
#ifndef DATE_TIME_TIME_RESOLUTION_TRAITS_HPP #define DATE_TIME_TIME_RESOLUTION_TRAITS_HPP /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ */ #include "boost/date_time/time_defs.hpp" #include "boost/date_time/int_adapter.hpp" #include "boost/cstdint.hpp" namespace boost { namespace date_time { //! Simple function to calculate absolute value of a numeric type template
// JDG [7/6/02 made a template], // moved here from time_duration.hpp 2003-Sept-4. inline T absolute_value(T x) { return x < 0 ? -x : x; } //! traits struct for time_resolution_traits implementation type struct time_resolution_traits_bi32_impl { typedef boost::int32_t int_type; typedef boost::int32_t impl_type; static int_type as_number(impl_type i){ return i;} //! Used to determine if implemented type is int_adapter or int static bool is_adapted() { return false;} }; //! traits struct for time_resolution_traits implementation type struct time_resolution_traits_adapted32_impl { typedef boost::int32_t int_type; typedef boost::date_time::int_adapter
impl_type; static int_type as_number(impl_type i){ return i.as_number();} //! Used to determine if implemented type is int_adapter or int static bool is_adapted() { return true;} }; //! traits struct for time_resolution_traits implementation type struct time_resolution_traits_bi64_impl { typedef boost::int64_t int_type; typedef boost::int64_t impl_type; static int_type as_number(impl_type i){ return i;} //! Used to determine if implemented type is int_adapter or int static bool is_adapted() { return false;} }; //! traits struct for time_resolution_traits implementation type struct time_resolution_traits_adapted64_impl { typedef boost::int64_t int_type; typedef boost::date_time::int_adapter
impl_type; static int_type as_number(impl_type i){ return i.as_number();} //! Used to determine if implemented type is int_adapter or int static bool is_adapted() { return true;} }; template
class time_resolution_traits { public: typedef typename frac_sec_type::int_type fractional_seconds_type; typedef typename frac_sec_type::int_type tick_type; typedef typename frac_sec_type::impl_type impl_type; typedef v_type day_type; typedef v_type hour_type; typedef v_type min_type; typedef v_type sec_type; // bring in function from frac_sec_type traits structs static typename frac_sec_type::int_type as_number(typename frac_sec_type::impl_type i) { return frac_sec_type::as_number(i); } static bool is_adapted() { return frac_sec_type::is_adapted(); } //Would like this to be frac_sec_type, but some compilers complain BOOST_STATIC_CONSTANT(int, ticks_per_second = resolution_adjust); // static const boost::int32_t ticks_per_second = resolution_adjust; static time_resolutions resolution() { return res; } static unsigned short num_fractional_digits() { return frac_digits; } static fractional_seconds_type res_adjust() { return resolution_adjust; } //! Any negative argument results in a negative tick_count static tick_type to_tick_count(hour_type hours, min_type minutes, sec_type seconds, fractional_seconds_type fs) { if(hours < 0 || minutes < 0 || seconds < 0 || fs < 0) { hours = absolute_value(hours); minutes = absolute_value(minutes); seconds = absolute_value(seconds); fs = absolute_value(fs); return (((((fractional_seconds_type(hours)*3600) + (fractional_seconds_type(minutes)*60) + seconds)*res_adjust()) + fs) * -1); } return (((fractional_seconds_type(hours)*3600) + (fractional_seconds_type(minutes)*60) + seconds)*res_adjust()) + fs; } }; typedef time_resolution_traits
milli_res; typedef time_resolution_traits
micro_res; typedef time_resolution_traits
nano_res; } } //namespace date_time #endif
time_resolution_traits.hpp
Page URL
File URL
Prev
53/60
Next
Download
( 5 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.