libtins  3.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Tins::Timestamp Class Reference

Represents a packet timestamp. More...

#include <timestamp.h>

Public Types

typedef time_t seconds_type
 
typedef suseconds_t microseconds_type
 

Public Member Functions

 Timestamp ()
 
template<typename Rep , typename Period >
 Timestamp (const std::chrono::duration< Rep, Period > &ts)
 
 Timestamp (const timeval &time_val)
 
seconds_type seconds () const
 
microseconds_type microseconds () const
 
 operator std::chrono::microseconds () const
 

Static Public Member Functions

static Timestamp current_time ()
 Constructs a Timestamp which will hold the current time.
 

Detailed Description

Represents a packet timestamp.

Constructor & Destructor Documentation

Tins::Timestamp::Timestamp ( )
inline

Default constructs the timestamp.

template<typename Rep , typename Period >
Tins::Timestamp::Timestamp ( const std::chrono::duration< Rep, Period > &  ts)
inline

Constructs a Timestamp from a std::chrono::duration.

Tins::Timestamp::Timestamp ( const timeval &  time_val)
inline

Constructs a timestamp from a timeval object.

Parameters
time_valThe timeval object.

Member Function Documentation

microseconds_type Tins::Timestamp::microseconds ( ) const
inline

Returns the amount of microseconds in this timestamp.

Tins::Timestamp::operator std::chrono::microseconds ( ) const
inline

Converts this Timestamp to a std::chrono::microseconds

seconds_type Tins::Timestamp::seconds ( ) const
inline

Returns the amount of seconds in this timestamp.


The documentation for this class was generated from the following file: