x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
time_clock.hpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\date_time\time_clock.hpp
Girar
Efecto
Propiedad
Historial
#ifndef DATE_TIME_TIME_CLOCK_HPP___ #define DATE_TIME_TIME_CLOCK_HPP___ /* Copyright (c) 2002,2003,2005 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) $ */ /*! @file time_clock.hpp This file contains the interface for clock devices. */ #include "boost/date_time/c_time.hpp" #include "boost/shared_ptr.hpp" namespace boost { namespace date_time { //! A clock providing time level services based on C time_t capabilities /*! This clock provides resolution to the 1 second level */ template
class second_clock { public: typedef typename time_type::date_type date_type; typedef typename time_type::time_duration_type time_duration_type; static time_type local_time() { ::std::time_t t; ::std::time(&t); ::std::tm curr, *curr_ptr; //curr_ptr = ::std::localtime(&t); curr_ptr = c_time::localtime(&t, &curr); return create_time(curr_ptr); } //! Get the current day in universal date as a ymd_type static time_type universal_time() { ::std::time_t t; ::std::time(&t); ::std::tm curr, *curr_ptr; //curr_ptr = ::std::gmtime(&t); curr_ptr = c_time::gmtime(&t, &curr); return create_time(curr_ptr); } template
static time_type local_time(boost::shared_ptr
tz_ptr) { typedef typename time_type::utc_time_type utc_time_type; utc_time_type utc_time = second_clock
::universal_time(); return time_type(utc_time, tz_ptr); } private: static time_type create_time(::std::tm* current) { date_type d(static_cast
(current->tm_year + 1900), static_cast
(current->tm_mon + 1), static_cast
(current->tm_mday)); time_duration_type td(current->tm_hour, current->tm_min, current->tm_sec); return time_type(d,td); } }; } } //namespace date_time #endif
time_clock.hpp
Dirección de la página
Dirección del archivo
Anterior
46/60
Siguiente
Descargar
( 2 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.