timestamp Class Reference

Timestamp object. More...

#include <tstamp.h>

List of all members.

Public Types

enum  resolution_type {
  resolution_year, resolution_month, resolution_day, resolution_hour,
  resolution_minute, resolution_second
}

Public Member Functions

 timestamp ()
 C'tor.
 timestamp (const timestamp &a_t)
 C'tor.
 timestamp (const int a_year, const int a_month, const int a_day, const int a_hour, const int a_minute, const int a_second)
 C'tor.
 timestamp (const std::string &a_s)
 C'tor.
void set (void)
 Set the timestamp to the current time and date.
void assign (const timestamp &a_t)
 Set the timestamp to the value of another timestamp.
void assign (const int a_year, const int a_month, const int a_day, const int a_hour, const int a_minute, const int a_second)
 Set the timestamp.
void assign (const std::string &a_s)
 Set the timestamp from a string.
void clear (void)
 Clear the timestamp.
void resolution (resolution_type a_r)
 Set the timestamp resolution.
resolution_type resolution (void) const
 Return the timestamp resolution.
const std::string str (void) const
 Generate a string.
const std::string str (const resolution_type a_resolution) const
 Generate a string.
int second (void) const
 Return the timestamp second.
int minute (void) const
 Return the timestamp minute.
int hour (void) const
 Return the timestamp hour.
int day (void) const
 Return the timestamp day.
int month (void) const
 Return the timestamp month.
int year (void) const
 Return the timestamp year.
timestampoperator= (const timestamp &a_t)
 Assignment.
timestampoperator= (const std::string &a_s)
 Assignment.
bool operator< (const timestamp &a_t) const
 Comparison.
bool operator> (const timestamp &a_t) const
 Comparison.
bool operator== (const timestamp &a_t) const
 Comparison.

Private Member Functions

const std::string make_str_ (const int a_resolution) const
 Generate a string.

Private Attributes

int m_year
int m_month
int m_day
int m_hour
int m_minute
int m_second
resolution_type m_resolution

Detailed Description

Timestamp object.

Definition at line 13 of file tstamp.h.


Member Enumeration Documentation

Enumerator:
resolution_year 
resolution_month 
resolution_day 
resolution_hour 
resolution_minute 
resolution_second 

Definition at line 16 of file tstamp.h.


Constructor & Destructor Documentation

timestamp::timestamp ( void   ) 

C'tor.

Definition at line 23 of file tstamp.cc.

References clear().

Here is the call graph for this function:

timestamp::timestamp ( const timestamp a_t  ) 

C'tor.

Definition at line 30 of file tstamp.cc.

References assign(), and clear().

Here is the call graph for this function:

timestamp::timestamp ( const int  a_year,
const int  a_month,
const int  a_day,
const int  a_hour,
const int  a_minute,
const int  a_second 
)

C'tor.

Definition at line 37 of file tstamp.cc.

References assign(), and clear().

Here is the call graph for this function:

timestamp::timestamp ( const std::string &  a_s  ) 

C'tor.

Definition at line 51 of file tstamp.cc.

References assign(), and clear().

Here is the call graph for this function:


Member Function Documentation

void timestamp::assign ( const std::string &  a_s  ) 

Set the timestamp from a string.

Definition at line 158 of file tstamp.cc.

References assign(), ERROR, is_timestamp(), resolution(), resolution_day, resolution_hour, resolution_minute, resolution_month, resolution_second, resolution_year, str(), TRY, and TRY_nomem.

Here is the call graph for this function:

void timestamp::assign ( const int  a_year,
const int  a_month,
const int  a_day,
const int  a_hour,
const int  a_minute,
const int  a_second 
)

Set the timestamp.

Definition at line 91 of file tstamp.cc.

References ERROR, m_day, m_hour, m_minute, m_month, m_second, m_year, and TRY_nomem.

void timestamp::assign ( const timestamp a_t  ) 

Set the timestamp to the value of another timestamp.

Definition at line 79 of file tstamp.cc.

References day(), hour(), m_day, m_hour, m_minute, m_month, m_resolution, m_second, m_year, minute(), month(), resolution(), second(), and year().

Referenced by assign(), configuration_manager::init(), operator=(), test3(), and timestamp().

Here is the call graph for this function:

void timestamp::clear ( void   ) 

Clear the timestamp.

Definition at line 290 of file tstamp.cc.

References m_day, m_hour, m_minute, m_month, m_resolution, m_second, m_year, and resolution_day.

Referenced by timestamp().

int timestamp::day ( void   )  const

Return the timestamp day.

Definition at line 426 of file tstamp.cc.

References m_day.

Referenced by assign(), make_str_(), test1(), test2(), and test3().

int timestamp::hour ( void   )  const

Return the timestamp hour.

Definition at line 420 of file tstamp.cc.

References m_hour.

Referenced by assign(), make_str_(), test1(), test2(), and test3().

const std::string timestamp::make_str_ ( const int  a_resolution  )  const [private]
int timestamp::minute ( void   )  const

Return the timestamp minute.

Definition at line 414 of file tstamp.cc.

References m_minute.

Referenced by assign(), make_str_(), test1(), test2(), and test3().

int timestamp::month ( void   )  const

Return the timestamp month.

Definition at line 432 of file tstamp.cc.

References m_month.

Referenced by assign(), make_str_(), test1(), test2(), and test3().

bool timestamp::operator< ( const timestamp a_t  )  const

Comparison.

Definition at line 466 of file tstamp.cc.

References m_resolution, resolution(), and str().

Here is the call graph for this function:

timestamp & timestamp::operator= ( const std::string &  a_s  ) 

Assignment.

Definition at line 458 of file tstamp.cc.

References assign().

Here is the call graph for this function:

timestamp & timestamp::operator= ( const timestamp a_t  ) 

Assignment.

Definition at line 450 of file tstamp.cc.

References assign().

Here is the call graph for this function:

bool timestamp::operator== ( const timestamp a_t  )  const

Comparison.

Definition at line 490 of file tstamp.cc.

References m_resolution, resolution(), and str().

Here is the call graph for this function:

bool timestamp::operator> ( const timestamp a_t  )  const

Comparison.

Definition at line 478 of file tstamp.cc.

References m_resolution, resolution(), and str().

Here is the call graph for this function:

timestamp::resolution_type timestamp::resolution ( void   )  const

Return the timestamp resolution.

Definition at line 444 of file tstamp.cc.

References m_resolution.

Referenced by assign().

void timestamp::resolution ( timestamp::resolution_type  a_r  ) 
int timestamp::second ( void   )  const

Return the timestamp second.

Definition at line 408 of file tstamp.cc.

References m_second.

Referenced by assign(), make_str_(), test1(), test2(), and test3().

void timestamp::set ( void   ) 

Set the timestamp to the current time and date.

Definition at line 58 of file tstamp.cc.

References ERROR, m_day, m_hour, m_minute, m_month, m_resolution, m_second, m_year, and resolution_day.

Referenced by configuration_manager::clear(), and test2().

const std::string timestamp::str ( const resolution_type  a_resolution  )  const

Generate a string.

Definition at line 397 of file tstamp.cc.

References make_str_(), str(), and TRY_nomem.

Here is the call graph for this function:

const std::string timestamp::str ( void   )  const
int timestamp::year ( void   )  const

Return the timestamp year.

Definition at line 438 of file tstamp.cc.

References m_year.

Referenced by assign(), make_str_(), test1(), test2(), and test3().


Member Data Documentation

int timestamp::m_day [private]

Definition at line 70 of file tstamp.h.

Referenced by assign(), clear(), day(), and set().

int timestamp::m_hour [private]

Definition at line 71 of file tstamp.h.

Referenced by assign(), clear(), hour(), and set().

int timestamp::m_minute [private]

Definition at line 72 of file tstamp.h.

Referenced by assign(), clear(), minute(), and set().

int timestamp::m_month [private]

Definition at line 69 of file tstamp.h.

Referenced by assign(), clear(), month(), and set().

Definition at line 74 of file tstamp.h.

Referenced by assign(), clear(), operator<(), operator==(), operator>(), resolution(), set(), and str().

int timestamp::m_second [private]

Definition at line 73 of file tstamp.h.

Referenced by assign(), clear(), second(), and set().

int timestamp::m_year [private]

Definition at line 68 of file tstamp.h.

Referenced by assign(), clear(), set(), and year().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Thu Sep 30 14:09:56 2010 for rvm by  doxygen 1.6.1