All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Friends
nemo3::ana_event::timestamp Class Reference

event time stamp: More...

#include <ana_event.h>

List of all members.

Public Member Functions

 timestamp ()
 timestamp (int date_, int time_)
void set (int date_, int time_)
int32_t get_date () const
int32_t get_time () const
int32_t get_sec_epoch () const
int32_t get_millisec () const
int32_t get_year () const
 get year yyyy
int32_t get_month () const
 get month 1-12
int32_t get_day () const
 get day 1-31
int32_t get_hours () const
 get hour 00-23
int32_t get_minutes () const
 get minutes 0-59
int32_t get_seconds () const
 get seconds 0-59
int32_t get_milliseconds () const
 < get microseconds
bool is_valid () const
void clear ()
std::string to_string () const
void from_string (const std::string &)

Static Public Member Functions

static int32_t convert_to_sec_epoch (int date_, int time_)
static int32_t extract_millisec (int time_)

Public Attributes

int32_t __date
int32_t __time
uint32_t __sec_epoch
int32_t __millisec

Static Public Attributes

static const char IO_FORMAT_SEP = '_'

Private Member Functions

template<class Archive >
void serialize (Archive &ar_, const unsigned int version_)

Friends

class boost::serialization::access
 what is saved and opened in data file
std::ostream & operator<< (std::ostream &, const timestamp &)
std::istream & operator>> (std::istream &, timestamp &)

Detailed Description

event time stamp:


Constructor & Destructor Documentation

default constructor

nemo3::ana_event::timestamp::timestamp ( int  date_,
int  time_ 
)

Constructor with a defined date and time in format yyyymmdd and hhmmss


Member Function Documentation

erase and set not valid format

void nemo3::ana_event::timestamp::from_string ( const std::string &  )

set an easy to read string format

See also:
to_string ()

get date in format yyyymmdd

get microseconds

Referenced by get_milliseconds().

get elapsed second from 1970

Referenced by nemo3::ana_event::get_sec_epoch().

get time of day in format hhmmss

check timestamp format (everything > 0)

void nemo3::ana_event::timestamp::set ( int  date_,
int  time_ 
)

sSet date and time in format yyyymmdd and hhmmss

return an easy to read string format


Friends And Related Function Documentation

friend class boost::serialization::access [friend]

what is saved and opened in data file

Using boost format, to add a new element, use versionning.

See also:
ana_event::serialization::access for example.
Parameters:
date
time
sec_epoch
millisec
std::ostream& operator<< ( std::ostream &  ,
const timestamp  
) [friend]

standard cout overloading

See also:
operator>> (std::istream &, timestamp &)
std::istream& operator>> ( std::istream &  ,
timestamp  
) [friend]

standard cin overloading

See also:
operator<< (std::ostream &, const timestamp &)

Member Data Documentation

Date in format yyyymmdd

microseconds

elapsed second from 1970

Time of day in format hhmmss


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