OpenSRX 0.1.0
C++ library for interfacing with Keyence SR series barcode readers
Loading...
Searching...
No Matches
OpenSRX::Timestamp Class Reference

Simple date/time representation used by the scanner's clock. More...

#include <Timestamp.hpp>

Public Member Functions

 Timestamp (int second=0, int minute=0, int hour=0, int day=1, int month=1, int year=1970)
 Construct a Timestamp with explicit components.
 
 Timestamp ()
 Default constructor (1970-01-01 00:00:00).
 
 Timestamp (std::vector< std::byte > buff)
 Construct a Timestamp from a raw byte buffer.
 
 ~Timestamp ()=default
 
std::tuple< int, int, int, int, int, int > asTuple () const
 Return all components as a tuple.
 
std::tuple< int, int, int > asDate () const
 Return the date portion as a tuple.
 

Public Attributes

int second
 Seconds (0–59).
 
int minute
 Minutes (0–59).
 
int hour
 Hours (0–23).
 
int day
 Day of month (1–31).
 
int month
 Month (1–12).
 
int year
 Four-digit year.
 

Detailed Description

Simple date/time representation used by the scanner's clock.

Constructor & Destructor Documentation

◆ Timestamp() [1/3]

OpenSRX::Timestamp::Timestamp ( int second = 0,
int minute = 0,
int hour = 0,
int day = 1,
int month = 1,
int year = 1970 )
inline

Construct a Timestamp with explicit components.

Parameters
secondSeconds (0–59).
minuteMinutes (0–59).
hourHours (0–23).
dayDay of month (1–31).
monthMonth (1–12).
yearFour-digit year.

◆ Timestamp() [2/3]

OpenSRX::Timestamp::Timestamp ( )
inline

Default constructor (1970-01-01 00:00:00).

◆ Timestamp() [3/3]

OpenSRX::Timestamp::Timestamp ( std::vector< std::byte > buff)

Construct a Timestamp from a raw byte buffer.

Parameters
buffBuffer containing encoded date/time data.

◆ ~Timestamp()

OpenSRX::Timestamp::~Timestamp ( )
default

Member Function Documentation

◆ asDate()

std::tuple< int, int, int > OpenSRX::Timestamp::asDate ( ) const
inline

Return the date portion as a tuple.

Returns
(year, month, day).

◆ asTuple()

std::tuple< int, int, int, int, int, int > OpenSRX::Timestamp::asTuple ( ) const
inline

Return all components as a tuple.

Returns
(year, month, day, hour, minute, second).

Member Data Documentation

◆ day

int OpenSRX::Timestamp::day

Day of month (1–31).

◆ hour

int OpenSRX::Timestamp::hour

Hours (0–23).

◆ minute

int OpenSRX::Timestamp::minute

Minutes (0–59).

◆ month

int OpenSRX::Timestamp::month

Month (1–12).

◆ second

int OpenSRX::Timestamp::second

Seconds (0–59).

◆ year

int OpenSRX::Timestamp::year

Four-digit year.


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