peerplays-fc/include/fc/network/ntp.hpp

28 lines
527 B
C++
Raw Permalink Normal View History

2014-06-11 19:17:28 +00:00
#pragma once
#include <string>
2014-06-16 15:46:14 +00:00
#include <memory>
2014-06-11 19:17:28 +00:00
#include <fc/time.hpp>
2014-06-16 15:17:29 +00:00
#include <fc/optional.hpp>
2014-06-11 19:17:28 +00:00
namespace fc {
2014-06-16 15:17:29 +00:00
namespace detail { class ntp_impl; }
2014-06-11 19:17:28 +00:00
class ntp
{
public:
2014-06-16 15:17:29 +00:00
ntp();
~ntp();
void add_server( const std::string& hostname, uint16_t port = 123 );
void set_request_interval( uint32_t interval_sec );
void request_now();
optional<time_point> get_time()const;
private:
std::unique_ptr<detail::ntp_impl> my;
2014-06-11 19:17:28 +00:00
};
} // namespace fc