SNAP Library 2.0, Developer Reference  2013-05-13 16:33:57
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TTm Class Reference

#include <tm.h>

Collaboration diagram for TTm:

List of all members.

Public Member Functions

 TTm ()
 TTm (const TTm &Tm)
 TTm (const int &_Year, const int &_Month, const int &_Day, const int &_DayOfWeek=-1, const int &_Hour=0, const int &_Min=0, const int &_Sec=0, const int &_MSec=0)
 TTm (const TSecTm &SecTm)
 ~TTm ()
 TTm (TSIn &SIn)
void Save (TSOut &SOut) const
TTmoperator= (const TTm &Tm)
bool operator== (const TTm &Tm) const
bool operator< (const TTm &Tm) const
int GetMemUsed () const
int GetPrimHashCd () const
int GetSecHashCd () const
bool IsDef () const
void Undef ()
bool IsTimeDef () const
int GetYear () const
int GetMonth () const
TStr GetMonthNm () const
int GetDay () const
int GetDayOfWeek () const
TStr GetDayOfWeekNm () const
int GetHour () const
int GetMin () const
int GetSec () const
int GetMSec () const
TStr GetStr (const bool &MSecP=true) const
TStr GetYMDDashStr () const
TStr GetHMSTColonDotStr (const bool &FullP=false, const bool &MSecP=true) const
TStr GetWebLogDateStr () const
TStr GetWebLogTimeStr () const
TStr GetWebLogDateTimeStr (const bool &FullP=false, const TStr &DateTimeSepCh=" ", const bool &MSecP=true) const
TStr GetIdStr () const
TSecTm GetSecTm () const
void AddTime (const int &Hours, const int &Mins=0, const int &Secs=0, const int &MSecs=0)
void AddDays (const int &Days)
void SubTime (const int &Hours, const int &Mins=0, const int &Secs=0, const int &MSecs=0)
void SubDays (const int &Days)

Static Public Member Functions

static TTm GetCurUniTm ()
static TTm GetUniqueCurUniTm ()
static TTm GetUniqueCurUniTm (const int &UniqueSpaces, const int &UniqueSpaceN)
static TTm GetCurLocTm ()
static uint64 GetCurUniMSecs ()
static uint64 GetCurLocMSecs ()
static uint64 GetMSecsFromTm (const TTm &Tm)
static TTm GetTmFromMSecs (const uint64 &MSecs)
static uint GetMSecsFromOsStart ()
static uint64 GetPerfTimerFq ()
static uint64 GetPerfTimerTicks ()
static void GetDiff (const TTm &Tm1, const TTm &Tm2, int &Days, int &Hours, int &Mins, int &Secs, int &MSecs)
static uint64 GetDiffMSecs (const TTm &Tm1, const TTm &Tm2)
static uint64 GetDiffSecs (const TTm &Tm1, const TTm &Tm2)
static uint64 GetDiffMins (const TTm &Tm1, const TTm &Tm2)
static uint64 GetDiffHrs (const TTm &Tm1, const TTm &Tm2)
static uint64 GetDiffDays (const TTm &Tm1, const TTm &Tm2)
static TTm GetLocTmFromUniTm (const TTm &Tm)
static TTm GetUniTmFromLocTm (const TTm &Tm)
static TTm GetTmFromWebLogTimeStr (const TStr &TimeStr, const char TimeSepCh=':', const char MSecSepCh='.')
static TTm GetTmFromWebLogDateTimeStr (const TStr &DateTimeStr, const char DateSepCh='-', const char TimeSepCh=':', const char MSecSepCh='.', const char DateTimeSepCh=' ')
static TTm GetTmFromIdStr (const TStr &IdStr)
static uint GetDateTimeInt (const int &Year=0, const int &Month=1, const int &Day=1, const int &Hour=0, const int &Min=0, const int &Sec=0)
static uint GetDateIntFromTm (const TTm &Tm)
static uint GetMonthIntFromTm (const TTm &Tm)
static uint GetYearIntFromTm (const TTm &Tm)
static uint GetDateTimeIntFromTm (const TTm &Tm)
static TTm GetTmFromDateTimeInt (const uint &DateTimeInt)
static TSecTm GetSecTmFromDateTimeInt (const uint &DateTimeInt)

Private Attributes

TInt Year
TInt Month
TInt Day
TInt DayOfWeek
TInt Hour
TInt Min
TInt Sec
TInt MSec

Detailed Description

Definition at line 212 of file tm.h.


Constructor & Destructor Documentation

TTm::TTm ( ) [inline]

Definition at line 217 of file tm.h.

Referenced by GetMemUsed(), GetTmFromDateTimeInt(), GetTmFromIdStr(), and GetTmFromWebLogDateTimeStr().

       :
    Year(-1), Month(-1), Day(-1), DayOfWeek(-1),
    Hour(-1), Min(-1), Sec(-1), MSec(-1){}

Here is the caller graph for this function:

TTm::TTm ( const TTm Tm) [inline]

Definition at line 220 of file tm.h.

                    :
    Year(Tm.Year), Month(Tm.Month), Day(Tm.Day), DayOfWeek(Tm.DayOfWeek),
    Hour(Tm.Hour), Min(Tm.Min), Sec(Tm.Sec), MSec(Tm.MSec){}
TTm::TTm ( const int &  _Year,
const int &  _Month,
const int &  _Day,
const int &  _DayOfWeek = -1,
const int &  _Hour = 0,
const int &  _Min = 0,
const int &  _Sec = 0,
const int &  _MSec = 0 
) [inline]

Definition at line 223 of file tm.h.

                                                                                :
    Year(_Year), Month(_Month), Day(_Day), DayOfWeek(_DayOfWeek),
    Hour(_Hour), Min(_Min), Sec(_Sec), MSec(_MSec){}
TTm::TTm ( const TSecTm SecTm) [inline]

Definition at line 228 of file tm.h.

                          :
    Year(SecTm.GetYearN()), Month(SecTm.GetMonthN()), Day(SecTm.GetDayN()),
    DayOfWeek(SecTm.GetDayOfWeekN()), Hour(SecTm.GetHourN()),
    Min(SecTm.GetMinN()), Sec(SecTm.GetSecN()), MSec(0){}
TTm::~TTm ( ) [inline]

Definition at line 232 of file tm.h.

{}
TTm::TTm ( TSIn SIn) [inline]

Definition at line 233 of file tm.h.

                :
    Year(SIn), Month(SIn), Day(SIn), DayOfWeek(SIn),
    Hour(SIn), Min(SIn), Sec(SIn), MSec(SIn){}

Member Function Documentation

void TTm::AddDays ( const int &  Days) [inline]

Definition at line 299 of file tm.h.

References AddTime().

{AddTime(Days*24);}

Here is the call graph for this function:

void TTm::AddTime ( const int &  Hours,
const int &  Mins = 0,
const int &  Secs = 0,
const int &  MSecs = 0 
)

Definition at line 1004 of file tm.cpp.

References GetMSecsFromTm(), and GetTmFromMSecs().

Referenced by AddDays(), and GetUniqueCurUniTm().

                                                    {
  uint64 TmMSecs=TTm::GetMSecsFromTm(*this);
  TmMSecs+=(uint64(Hours)*uint64(3600)*uint64(1000));
  TmMSecs+=(uint64(Mins)*uint64(60)*uint64(1000));
  TmMSecs+=(uint64(Secs)*uint64(1000));
  TmMSecs+=uint64(MSecs);
  *this=GetTmFromMSecs(TmMSecs);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1063 of file tm.cpp.

                          {
  return TSysTm::GetCurLocMSecs();
}
TTm TTm::GetCurLocTm ( ) [static]

Definition at line 1055 of file tm.cpp.

Referenced by TLogNotify::OnStatus().

                    {
  return TSysTm::GetCurLocTm();
}

Here is the caller graph for this function:

Definition at line 1059 of file tm.cpp.

Referenced by GetUniqueCurUniTm().

                          {
  return TSysTm::GetCurUniMSecs();
}

Here is the caller graph for this function:

TTm TTm::GetCurUniTm ( ) [static]

Definition at line 1024 of file tm.cpp.

Referenced by GetUniqueCurUniTm(), TFPathNotify::OnStatus(), and TFPathNotify::TFPathNotify().

                    {
  return TSysTm::GetCurUniTm();
}

Here is the caller graph for this function:

uint TTm::GetDateIntFromTm ( const TTm Tm) [static]

Definition at line 1237 of file tm.cpp.

References GetDateTimeInt(), GetDay(), GetMonth(), GetYear(), and IsDef().

                                        {
    return Tm.IsDef() ? GetDateTimeInt(Tm.GetYear(), Tm.GetMonth(), Tm.GetDay()) : 0;
}

Here is the call graph for this function:

uint TTm::GetDateTimeInt ( const int &  Year = 0,
const int &  Month = 1,
const int &  Day = 1,
const int &  Hour = 0,
const int &  Min = 0,
const int &  Sec = 0 
) [static]

Definition at line 1231 of file tm.cpp.

References TSecTm::GetAbsSecs().

Referenced by GetDateIntFromTm(), GetDateTimeIntFromTm(), GetMonthIntFromTm(), and GetYearIntFromTm().

                                                                       {

        return TSecTm(Year, Month, Day, Hour, Min, Sec).GetAbsSecs();
}

Here is the call graph for this function:

Here is the caller graph for this function:

uint TTm::GetDateTimeIntFromTm ( const TTm Tm) [static]

Definition at line 1249 of file tm.cpp.

References GetDateTimeInt(), GetDay(), GetHour(), GetMin(), GetMonth(), GetSec(), GetYear(), and IsDef().

                                            {
    return Tm.IsDef() ? 
                GetDateTimeInt(Tm.GetYear(), Tm.GetMonth(),
        Tm.GetDay(), Tm.GetHour(), Tm.GetMin(), Tm.GetSec()) : 0;
}

Here is the call graph for this function:

int TTm::GetDay ( ) const [inline]

Definition at line 277 of file tm.h.

References Day.

Referenced by GetDateIntFromTm(), GetDateTimeIntFromTm(), and TFPathNotify::UpdateSOut().

{return Day;}

Here is the caller graph for this function:

int TTm::GetDayOfWeek ( ) const [inline]

Definition at line 278 of file tm.h.

References DayOfWeek.

{return DayOfWeek;}
TStr TTm::GetDayOfWeekNm ( ) const [inline]

Definition at line 279 of file tm.h.

References DayOfWeek.

void TTm::GetDiff ( const TTm Tm1,
const TTm Tm2,
int &  Days,
int &  Hours,
int &  Mins,
int &  Secs,
int &  MSecs 
) [static]

Definition at line 1087 of file tm.cpp.

References GetDiffMSecs().

                                                        {

        const uint64 DiffMSecs = TTm::GetDiffMSecs(Tm1, Tm2);
        const uint64 DiffSecs = DiffMSecs / 1000;
        const uint64 DiffMins = DiffSecs / 60;
        const uint64 DiffHours = DiffMins / 60; 

        MSecs = int(DiffMSecs % 1000);
        Secs = int(DiffSecs % 60);
        Mins = int(DiffMins % 60);
        Hours = int(DiffHours % 24);
        Days = int((int)DiffHours / 24);
}

Here is the call graph for this function:

static uint64 TTm::GetDiffDays ( const TTm Tm1,
const TTm Tm2 
) [inline, static]

Definition at line 324 of file tm.h.

References GetDiffMSecs().

                                                           {
    return GetDiffMSecs(Tm1, Tm2)/uint64(1000*60*60*24);}

Here is the call graph for this function:

static uint64 TTm::GetDiffHrs ( const TTm Tm1,
const TTm Tm2 
) [inline, static]

Definition at line 322 of file tm.h.

References GetDiffMSecs().

                                                          {
        return GetDiffMSecs(Tm1, Tm2)/uint64(1000*60*60);}

Here is the call graph for this function:

static uint64 TTm::GetDiffMins ( const TTm Tm1,
const TTm Tm2 
) [inline, static]

Definition at line 320 of file tm.h.

References GetDiffMSecs().

                                                           {
        return GetDiffMSecs(Tm1, Tm2)/uint64(1000*60);}

Here is the call graph for this function:

uint64 TTm::GetDiffMSecs ( const TTm Tm1,
const TTm Tm2 
) [static]

Definition at line 1102 of file tm.cpp.

References GetMSecsFromTm().

Referenced by GetDiff(), GetDiffDays(), GetDiffHrs(), GetDiffMins(), and GetDiffSecs().

                                                      {
  uint64 Tm1MSecs=GetMSecsFromTm(Tm1);
  uint64 Tm2MSecs=GetMSecsFromTm(Tm2);
  if (Tm1MSecs>Tm2MSecs){
    return Tm1MSecs-Tm2MSecs;
  } else {
    return Tm2MSecs-Tm1MSecs;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static uint64 TTm::GetDiffSecs ( const TTm Tm1,
const TTm Tm2 
) [inline, static]

Definition at line 318 of file tm.h.

References GetDiffMSecs().

                                                           {
        return GetDiffMSecs(Tm1, Tm2)/uint64(1000);}

Here is the call graph for this function:

TStr TTm::GetHMSTColonDotStr ( const bool &  FullP = false,
const bool &  MSecP = true 
) const

Definition at line 978 of file tm.cpp.

References GetStr(), Hour, Min, MSec, and Sec.

Referenced by GetWebLogDateTimeStr(), GetWebLogTimeStr(), and TLogNotify::OnStatus().

                                                                       {
  TChA ChA;
  ChA+=TInt::GetStr(Hour, "%02d");
  ChA+=':'; ChA+=TInt::GetStr(Min, "%02d");
  if (FullP||((Sec!=0)||(MSec!=0))){
    ChA+=':'; ChA+=TInt::GetStr(Sec, "%02d");
    if ((MSecP)&&(FullP||(MSec!=0))){
      ChA+='.'; ChA+=TInt::GetStr(MSec, "%d");
    }
  }
  return ChA;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int TTm::GetHour ( ) const [inline]

Definition at line 280 of file tm.h.

References Hour.

Referenced by GetDateTimeIntFromTm(), TFPathNotify::OnStatus(), and TFPathNotify::UpdateSOut().

{return Hour;}

Here is the caller graph for this function:

TStr TTm::GetIdStr ( ) const

Definition at line 991 of file tm.cpp.

References Day, GetStr(), Hour, Min, Month, MSec, Sec, and Year.

                         {
  TChA ChA;
  ChA+=TInt::GetStr(Year%100, "%02d");
  ChA+=TInt::GetStr(Month, "%02d");
  ChA+=TInt::GetStr(Day, "%02d");
  ChA+=TInt::GetStr(Hour, "%02d");
  ChA+=TInt::GetStr(Min, "%02d");
  ChA+=TInt::GetStr(Sec, "%02d");
  ChA+=TInt::GetStr(MSec, "%03d");
  return ChA;
}

Here is the call graph for this function:

TTm TTm::GetLocTmFromUniTm ( const TTm Tm) [static]

Definition at line 1112 of file tm.cpp.

                                       {
  return TSysTm::GetLocTmFromUniTm(Tm);
}
int TTm::GetMemUsed ( ) const [inline]

Definition at line 258 of file tm.h.

References TTm().

{return sizeof(TTm);}

Here is the call graph for this function:

int TTm::GetMin ( ) const [inline]

Definition at line 281 of file tm.h.

References Min.

Referenced by GetDateTimeIntFromTm().

{return Min;}

Here is the caller graph for this function:

int TTm::GetMonth ( ) const [inline]

Definition at line 275 of file tm.h.

References Month.

Referenced by GetDateIntFromTm(), GetDateTimeIntFromTm(), GetMonthIntFromTm(), and TFPathNotify::UpdateSOut().

{return Month;}

Here is the caller graph for this function:

uint TTm::GetMonthIntFromTm ( const TTm Tm) [static]

Definition at line 1241 of file tm.cpp.

References GetDateTimeInt(), GetMonth(), GetYear(), and IsDef().

                                         {
    return Tm.IsDef() ? GetDateTimeInt(Tm.GetYear(), Tm.GetMonth()) : 0;
}

Here is the call graph for this function:

TStr TTm::GetMonthNm ( ) const [inline]

Definition at line 276 of file tm.h.

References Month.

int TTm::GetMSec ( ) const [inline]

Definition at line 283 of file tm.h.

References MSec.

{return MSec;}

Definition at line 1075 of file tm.cpp.

uint64 TTm::GetMSecsFromTm ( const TTm Tm) [static]

Definition at line 1067 of file tm.cpp.

Referenced by AddTime(), GetDiffMSecs(), and SubTime().

                                       {
  return TSysTm::GetMSecsFromTm(Tm);
}

Here is the caller graph for this function:

Definition at line 1079 of file tm.cpp.

                          {
  return TSysTm::GetPerfTimerFq();
}

Definition at line 1083 of file tm.cpp.

int TTm::GetPrimHashCd ( ) const [inline]

Definition at line 260 of file tm.h.

References Day, Hour, Min, Month, MSec, Sec, and Year.

int TTm::GetSec ( ) const [inline]

Definition at line 282 of file tm.h.

References Sec.

Referenced by GetDateTimeIntFromTm().

{return Sec;}

Here is the caller graph for this function:

int TTm::GetSecHashCd ( ) const [inline]

Definition at line 261 of file tm.h.

References Day, Month, and Year.

{return Year*Month*Day;}
TSecTm TTm::GetSecTm ( ) const [inline]

Definition at line 294 of file tm.h.

References Day, Hour, Min, Month, Sec, and Year.

                          {
    return TSecTm(Year, Month, Day, Hour, Min, Sec);}
TSecTm TTm::GetSecTmFromDateTimeInt ( const uint DateTimeInt) [static]

Definition at line 1260 of file tm.cpp.

                                                           {
        if (DateTimeInt == 0) { return TSecTm(); }
        return TSecTm(DateTimeInt);
}
TStr TTm::GetStr ( const bool &  MSecP = true) const

Definition at line 956 of file tm.cpp.

References Day, Hour, Min, Month, MSec, Sec, and Year.

Referenced by GetHMSTColonDotStr(), GetIdStr(), and GetYMDDashStr().

                                        {
  TChA ChA;
  ChA+=TInt::GetStr(Year, "%04d"); ChA+='-';
//  ChA+=GetMonthNm(); ChA+='-';
  ChA+=TInt::GetStr(Month, "%02d"); ChA+='-';
  ChA+=TInt::GetStr(Day, "%02d"); ChA+=' ';
//  ChA+=GetDayOfWeekNm(); ChA+=' ';
  ChA+=TInt::GetStr(Hour, "%02d"); ChA+=':';
  ChA+=TInt::GetStr(Min, "%02d"); ChA+=':';
  ChA+=TInt::GetStr(Sec, "%02d");
  if (MSecP){ChA+='.'; ChA+=TInt::GetStr(MSec, "%03d");}
  return ChA;
}

Here is the caller graph for this function:

TTm TTm::GetTmFromDateTimeInt ( const uint DateTimeInt) [static]

Definition at line 1255 of file tm.cpp.

References TTm().

                                                     {
        if (DateTimeInt == 0) { return TTm(); }
        return TTm(TSecTm(DateTimeInt));
}

Here is the call graph for this function:

TTm TTm::GetTmFromIdStr ( const TStr IdStr) [static]

Definition at line 1210 of file tm.cpp.

References IAssert, TChA::Ins(), TCh::IsNum(), TChA::Len(), and TTm().

                                        {
  // normalize
  TChA IdChA=IdStr;
  if (IdChA.Len()==14){
    IdChA.Ins(0, "0");}
  // check
  IAssert(IdChA.Len()==15);
  for (int ChN=0; ChN<IdChA.Len(); ChN++){
    IAssert(TCh::IsNum(IdChA[ChN]));}
  // extract parts
  int YearN=2000+(TStr(IdChA[0])+TStr(IdChA[1])).GetInt();
  int MonthN=(TStr(IdChA[2])+TStr(IdChA[3])).GetInt();
  int DayN=(TStr(IdChA[4])+TStr(IdChA[5])).GetInt();
  int HourN=(TStr(IdChA[6])+TStr(IdChA[7])).GetInt();
  int MinN=(TStr(IdChA[8])+TStr(IdChA[9])).GetInt();
  int SecN=(TStr(IdChA[10])+TStr(IdChA[11])).GetInt();
  int MSecN=(TStr(IdChA[12])+TStr(IdChA[13])+TStr(IdChA[14])).GetInt();
  TTm Tm=TTm(YearN, MonthN, DayN, -1, HourN, MinN, SecN, MSecN);
  return Tm;
}

Here is the call graph for this function:

TTm TTm::GetTmFromMSecs ( const uint64 MSecs) [static]

Definition at line 1071 of file tm.cpp.

Referenced by AddTime(), GetUniqueCurUniTm(), and SubTime().

                                          {
  return TSysTm::GetTmFromMSecs(MSecs);
}

Here is the caller graph for this function:

TTm TTm::GetTmFromWebLogDateTimeStr ( const TStr DateTimeStr,
const char  DateSepCh = '-',
const char  TimeSepCh = ':',
const char  MSecSepCh = '.',
const char  DateTimeSepCh = ' ' 
) [static]

Definition at line 1154 of file tm.cpp.

References TChA::Clr(), TStr::GetInt(), TStr::Len(), and TTm().

                          {
  int DateTimeStrLen=DateTimeStr.Len();
  // year
  TChA ChA; int ChN=0;
  while ((ChN<DateTimeStrLen)&&(DateTimeStr[ChN]!=DateSepCh)){
    ChA+=DateTimeStr[ChN]; ChN++;}
  TStr YearStr=ChA;
  // month
  ChA.Clr(); ChN++;
  while ((ChN<DateTimeStrLen)&&(DateTimeStr[ChN]!=DateSepCh)){
    ChA+=DateTimeStr[ChN]; ChN++;}
  TStr MonthStr=ChA;
  // day
  ChA.Clr(); ChN++;
  while ((ChN<DateTimeStrLen)&&(DateTimeStr[ChN]!=DateTimeSepCh)){
    ChA+=DateTimeStr[ChN]; ChN++;}
  TStr DayStr=ChA;
  // hour
  ChA.Clr(); ChN++;
  while ((ChN<DateTimeStrLen)&&(DateTimeStr[ChN]!=TimeSepCh)){
    ChA+=DateTimeStr[ChN]; ChN++;}
  TStr HourStr=ChA;
  // minute
  ChA.Clr(); ChN++;
  while ((ChN<DateTimeStrLen)&&(DateTimeStr[ChN]!=TimeSepCh)){
    ChA+=DateTimeStr[ChN]; ChN++;}
  TStr MinStr=ChA;
  // second
  ChA.Clr(); ChN++;
  while ((ChN<DateTimeStrLen)&&(DateTimeStr[ChN]!=MSecSepCh)){
    ChA+=DateTimeStr[ChN]; ChN++;}
  TStr SecStr=ChA;
  // mili-second
  ChA.Clr(); ChN++;
  while (ChN<DateTimeStrLen){
    ChA+=DateTimeStr[ChN]; ChN++;}
  TStr MSecStr=ChA;
  // transform to numbers
  int YearN=YearStr.GetInt(-1);
  int MonthN=MonthStr.GetInt(-1);
  int DayN=DayStr.GetInt(-1);
  int HourN=HourStr.GetInt(0);
  int MinN=MinStr.GetInt(0);
  int SecN=SecStr.GetInt(0);
  int MSecN=MSecStr.GetInt(0);
  // construct time
  TTm Tm;
  if ((YearN!=-1)&&(MonthN!=-1)&&(DayN!=-1)){
    Tm=TTm(YearN, MonthN, DayN, -1, HourN, MinN, SecN, MSecN);
  }
  // return time
  return Tm;
}

Here is the call graph for this function:

TTm TTm::GetTmFromWebLogTimeStr ( const TStr TimeStr,
const char  TimeSepCh = ':',
const char  MSecSepCh = '.' 
) [static]

Definition at line 1120 of file tm.cpp.

References TChA::Clr(), TStr::GetInt(), and TStr::Len().

                                            {
  int TimeStrLen=TimeStr.Len();
  // year
  TChA ChA; int ChN=0;
  while ((ChN<TimeStrLen)&&(TimeStr[ChN]!=TimeSepCh)){
    ChA+=TimeStr[ChN]; ChN++;}
  TStr HourStr=ChA;
  // minute
  ChA.Clr(); ChN++;
  while ((ChN<TimeStrLen)&&(TimeStr[ChN]!=TimeSepCh)){
    ChA+=TimeStr[ChN]; ChN++;}
  TStr MinStr=ChA;
  // second
  ChA.Clr(); ChN++;
  while ((ChN<TimeStrLen)&&(TimeStr[ChN]!=MSecSepCh)){
    ChA+=TimeStr[ChN]; ChN++;}
  TStr SecStr=ChA;
  // mili-second
  ChA.Clr(); ChN++;
  while (ChN<TimeStrLen){
    ChA+=TimeStr[ChN]; ChN++;}
  TStr MSecStr=ChA;
  // transform to numbers
  int HourN=HourStr.GetInt(0);
  int MinN=MinStr.GetInt(0);
  int SecN=SecStr.GetInt(0);
  int MSecN=MSecStr.GetInt(0);
  // construct time
  TTm Tm(-1, -1, -1, -1, HourN, MinN, SecN, MSecN);
  // return time
  return Tm;
}

Here is the call graph for this function:

Definition at line 1028 of file tm.cpp.

References AddTime(), and GetCurUniTm().

                          {
  static TTm LastUniqueTm=TSysTm::GetCurUniTm();
  TTm CurUniqueTm=TSysTm::GetCurUniTm();
  if (CurUniqueTm<LastUniqueTm){CurUniqueTm=LastUniqueTm;}
  if (CurUniqueTm==LastUniqueTm){CurUniqueTm.AddTime(0, 0, 0, 1);}
  LastUniqueTm=CurUniqueTm;
  return CurUniqueTm;
}

Here is the call graph for this function:

TTm TTm::GetUniqueCurUniTm ( const int &  UniqueSpaces,
const int &  UniqueSpaceN 
) [static]

Definition at line 1037 of file tm.cpp.

References Assert, GetCurUniMSecs(), and GetTmFromMSecs().

                                                                          {
  static uint64 LastMUniqueTmMSecs=TSysTm::GetCurUniMSecs();
  // uniqueness-space-parameters range-check
  Assert(UniqueSpaces>=1&&UniqueSpaceN>=0&&UniqueSpaceN<UniqueSpaces);
  // get current time
  uint64 CurUniqueTmMSecs=TSysTm::GetCurUniMSecs();
  if (CurUniqueTmMSecs<LastMUniqueTmMSecs){CurUniqueTmMSecs=LastMUniqueTmMSecs;}
  // normalize to uniqueness-space-grid
  CurUniqueTmMSecs-=CurUniqueTmMSecs%UniqueSpaces; CurUniqueTmMSecs+=UniqueSpaceN;
  // get next free unique-time
  if (CurUniqueTmMSecs<=LastMUniqueTmMSecs){
    CurUniqueTmMSecs+=UniqueSpaces;
  }
  // update last-time
  LastMUniqueTmMSecs=CurUniqueTmMSecs;
  return GetTmFromMSecs(CurUniqueTmMSecs);
}

Here is the call graph for this function:

TTm TTm::GetUniTmFromLocTm ( const TTm Tm) [static]

Definition at line 1116 of file tm.cpp.

                                       {
  return TSysTm::GetUniTmFromLocTm(Tm);
}
TStr TTm::GetWebLogDateStr ( ) const [inline]

Definition at line 289 of file tm.h.

References GetYMDDashStr().

{return GetYMDDashStr();}

Here is the call graph for this function:

TStr TTm::GetWebLogDateTimeStr ( const bool &  FullP = false,
const TStr DateTimeSepCh = " ",
const bool &  MSecP = true 
) const [inline]

Definition at line 291 of file tm.h.

References GetHMSTColonDotStr(), and GetYMDDashStr().

                                                                                                                  {
    return GetYMDDashStr()+DateTimeSepCh+GetHMSTColonDotStr(FullP, MSecP);}

Here is the call graph for this function:

TStr TTm::GetWebLogTimeStr ( ) const [inline]

Definition at line 290 of file tm.h.

References GetHMSTColonDotStr().

{return GetHMSTColonDotStr(false);}

Here is the call graph for this function:

int TTm::GetYear ( ) const [inline]

Definition at line 274 of file tm.h.

References Year.

Referenced by GetDateIntFromTm(), GetDateTimeIntFromTm(), GetMonthIntFromTm(), GetYearIntFromTm(), and TFPathNotify::UpdateSOut().

{return Year;}

Here is the caller graph for this function:

uint TTm::GetYearIntFromTm ( const TTm Tm) [static]

Definition at line 1245 of file tm.cpp.

References GetDateTimeInt(), GetYear(), and IsDef().

                                        {
    return Tm.IsDef() ? GetDateTimeInt(Tm.GetYear()) : 0;
}

Here is the call graph for this function:

Definition at line 970 of file tm.cpp.

References Day, GetStr(), Month, and Year.

Referenced by GetWebLogDateStr(), GetWebLogDateTimeStr(), and TLogNotify::OnStatus().

                              {
  TChA ChA;
  ChA+=TInt::GetStr(Year, "%04d");
  ChA+='-'; ChA+=TInt::GetStr(Month, "%02d");
  ChA+='-'; ChA+=TInt::GetStr(Day, "%02d");
  return ChA;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool TTm::IsDef ( ) const [inline]

Definition at line 264 of file tm.h.

References Day, Hour, Min, Month, MSec, Sec, and Year.

Referenced by GetDateIntFromTm(), GetDateTimeIntFromTm(), GetMonthIntFromTm(), and GetYearIntFromTm().

                     {
   return (Year!=-1)&&(Month!=-1)&&(Day!=-1)&&
    (Hour!=-1)&&(Min!=-1)&&(Sec!=-1)&&(MSec!=-1);}

Here is the caller graph for this function:

bool TTm::IsTimeDef ( ) const [inline]

Definition at line 271 of file tm.h.

References Hour, Min, MSec, and Sec.

{ return !(Hour==0 && Min==0 && Sec==0 && MSec==0); }
bool TTm::operator< ( const TTm Tm) const [inline]

Definition at line 248 of file tm.h.

References Day, Hour, Min, Month, MSec, Sec, and Year.

                                      {
    return
     (Year<Tm.Year)||
     ((Year==Tm.Year)&&(Month<Tm.Month))||
     ((Year==Tm.Year)&&(Month==Tm.Month)&&(Day<Tm.Day))||
     (((Year==Tm.Year)&&(Month==Tm.Month)&&(Day==Tm.Day))&&(
      (Hour<Tm.Hour)||
      ((Hour==Tm.Hour)&&(Min<Tm.Min))||
      ((Hour==Tm.Hour)&&(Min==Tm.Min)&&(Sec<Tm.Sec))||
      ((Hour==Tm.Hour)&&(Min==Tm.Min)&&(Sec==Tm.Sec)&&(MSec<Tm.MSec))));} // saxo
TTm& TTm::operator= ( const TTm Tm) [inline]

Definition at line 240 of file tm.h.

References Day, DayOfWeek, Hour, Min, Month, MSec, Sec, and Year.

                               {
    Year=Tm.Year; Month=Tm.Month; Day=Tm.Day; DayOfWeek=Tm.DayOfWeek;
    Hour=Tm.Hour; Min=Tm.Min; Sec=Tm.Sec; MSec=Tm.MSec;
    return *this;}
bool TTm::operator== ( const TTm Tm) const [inline]

Definition at line 244 of file tm.h.

References Day, Hour, Min, Month, MSec, Sec, and Year.

                                       {
    return
     (Year==Tm.Year)&&(Month==Tm.Month)&&(Day==Tm.Day)&&
     (Hour==Tm.Hour)&&(Min==Tm.Min)&&(Sec==Tm.Sec)&&(MSec==Tm.MSec);}
void TTm::Save ( TSOut SOut) const [inline]

Definition at line 236 of file tm.h.

References Day, DayOfWeek, Hour, Min, Month, MSec, TInt::Save(), Sec, and Year.

                               {
    Year.Save(SOut); Month.Save(SOut); Day.Save(SOut); DayOfWeek.Save(SOut);
    Hour.Save(SOut); Min.Save(SOut); Sec.Save(SOut); MSec.Save(SOut);}

Here is the call graph for this function:

void TTm::SubDays ( const int &  Days) [inline]

Definition at line 301 of file tm.h.

References SubTime().

{SubTime(Days*24);}

Here is the call graph for this function:

void TTm::SubTime ( const int &  Hours,
const int &  Mins = 0,
const int &  Secs = 0,
const int &  MSecs = 0 
)

Definition at line 1014 of file tm.cpp.

References GetMSecsFromTm(), and GetTmFromMSecs().

Referenced by SubDays().

                                                    {
  uint64 TmMSecs=TTm::GetMSecsFromTm(*this);
  TmMSecs-=(uint64(Hours)*uint64(3600)*uint64(1000));
  TmMSecs-=(uint64(Mins)*uint64(60)*uint64(1000));
  TmMSecs-=(uint64(Secs)*uint64(1000));
  TmMSecs-=(uint64(MSecs));
  *this=GetTmFromMSecs(TmMSecs);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void TTm::Undef ( ) [inline]

Definition at line 267 of file tm.h.

References Day, DayOfWeek, Hour, Min, Month, MSec, Sec, and Year.

              {
    Year=-1; Month=-1; Day=-1; DayOfWeek=-1;
    Hour=-1; Min=-1; Sec=-1; MSec=-1;}

Member Data Documentation

TInt TTm::DayOfWeek [private]

Definition at line 214 of file tm.h.

Referenced by GetDayOfWeek(), GetDayOfWeekNm(), operator=(), Save(), and Undef().


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