C++ main module for mmsd Package
1.0
|
this class describes a time class More...
#include <CORE_Time.h>
Public Member Functions | |
CORE_Time () | |
create a general time object More... | |
virtual | ~CORE_Time () |
remove More... | |
unsigned long long int | getCPUTime () const |
return the CPU time in 1/60 seconds More... | |
int | getWeekYear (int &year) const |
get the week of the year More... | |
int | getYear () const |
return the year More... | |
int | getMonth () const |
return the month More... | |
int | getDaysNumberInMonth () const |
return the number of days in month More... | |
int | getDay () const |
return the day More... | |
tString | getWeekIntervalString () |
get the week interval monday –> Sunday of the current time More... | |
void | setToFirstWeekDay (const int &year, const int &week) |
set the date to the first week day week must be in [1..53] the first day is a monday More... | |
void | setToWeekDay (const int &year, const int &week, const int &day) |
set the date to the week day week must be in [1..53] day in [0,6] 0:MONDAY....6:SUNDAY the first day is a monday More... | |
int | getWeekDay () const |
return the day of the week 0:Sunday [0..6] More... | |
int | getMinutes () const |
return the minutes of the time More... | |
int | getSeconds () const |
return the seconds of the time More... | |
int | getHours () const |
return the hours of the time More... | |
unsigned long long int | getMilliSeconds () const |
return the milliseconds seconds of the time More... | |
tTime | getSecondsSince1900 () const |
return the number of seconds since 1900 More... | |
void | setDate (const tTime &seconds) |
set the date from 1900 in seconds More... | |
void | setDate (const int &year, const int &month, const int &day, const int &hour, const int &minutes, const int &seconds, const int &ms) |
set the date year>=0 month in [1,12] day in [1,31] More... | |
void | setDate (const int &year, const int &month, const int &day, const int &hour, const int &minutes, const int &seconds) |
set the date year>=0 month in [1,12] day in [1,31] More... | |
void | setDate (int year, int month, int day) |
set the date year>=0 month in [1,12] More... | |
void | setDate (const tString &date) |
set the date from a string year-month-day More... | |
void | setDate (const CORE_Time &time) |
set the date from a string year-month-day More... | |
void | setDate (SP::CORE_Time time) |
set the date from a string year-month-day More... | |
void | setDate (const CORE_Time *time) |
set the date from a string year-month-day More... | |
void | setDate (const tString &date, const tString &format) |
set the date from a string date and with format More... | |
void | setHour (const tString &h) |
set hour xxhyy More... | |
void | setTime (const int &hour, const int &minutes, const int &seconds) |
set the time More... | |
void | setTime (const tString &date) |
set the time from a string hour:min:sec More... | |
tRelativeInteger | sub (const CORE_Time &time2) const |
get the difference with time2 this -time2 in secunds More... | |
tRelativeInteger | sub (const SP::CORE_Time &time2) const |
get the difference with time2 this -time2 in secunds More... | |
tRelativeInteger | sub (const CORE_Time *time2) const |
get the difference with time2 this -time2 in secunds More... | |
tRelativeInteger | subInMilliSeconds (const CORE_Time &time2) const |
get the difference with time2 this -time2 in secunds More... | |
tRelativeInteger | subInMilliSeconds (const SP::CORE_Time &time2) const |
get the difference with time2 this -time2 in secunds More... | |
tRelativeInteger | subInMilliSeconds (const CORE_Time *time2) const |
get the difference with time2 this -time2 in secunds More... | |
void | setToNextDay () |
set to next day More... | |
void | setToPreviousDay () |
set to previous day More... | |
void | setToPreviousDays (const int &nDays) |
set to days ago More... | |
void | setToNextMonth () |
set to next month More... | |
void | setToPreviousMonth () |
set to previous month More... | |
void | setToNextWeek () |
set to next week More... | |
void | setToPreviousWeek () |
set to previoust week More... | |
void | setToLastDay (const int &year, const int &month) |
set to last day of month More... | |
void | startChrono () |
start the chrono More... | |
unsigned long long int | continueChrono () |
contune the chrono and return the time in ms since start time or last continue step More... | |
unsigned long long int | stopChrono () |
end the chrono and return the time in ms since start time More... | |
tBoolean | isEqual (const CORE_Time *t) const |
return true if the 2 dates are equals More... | |
tBoolean | isEqual (const CORE_Time &t) const |
return true if the 2 dates are equals More... | |
tBoolean | isBefore (const CORE_Time &t) const |
return true if this < t More... | |
tBoolean | isBefore (const CORE_Time *t) const |
return true if this < t More... | |
tBoolean | isAfter (const CORE_Time &t) const |
return true if this > t More... | |
tBoolean | isAfter (const CORE_Time *t) const |
return true if this > t More... | |
tBoolean | isBeforeOrEqual (const CORE_Time &t) const |
return true if this <= t More... | |
tBoolean | isAfterOrEqual (const CORE_Time &t) const |
return true if this >= t More... | |
tBoolean | isEqual (const SP::CORE_Time &t) const |
return true if the 2 dates are equals More... | |
tBoolean | isBefore (const SP::CORE_Time &t) const |
return true if this < t More... | |
tBoolean | isAfter (const SP::CORE_Time &t) const |
return true if this > t More... | |
tBoolean | isBeforeOrEqual (const SP::CORE_Time &t) const |
return true if this <= t More... | |
tBoolean | isAfterOrEqual (const SP::CORE_Time &t) const |
return true if this >= t More... | |
virtual tString | toString () const |
return the time into a string More... | |
tString | toString (const tString &format) const |
return the time into a string with format More... | |
void | getSharedPointer (SP::CORE_Object &p) |
get the shared pointer of this class into p More... | |
void | getSharedPointer (SPC::CORE_Object &p) const |
get the shared pointer of this class into p More... | |
tString | getClassName () const |
return the class name of the object More... | |
tString | getIdentityString () const |
return the identity string of the object of the form className_at_address More... | |
tString | getPointerAddress () const |
return the identity string of the object More... | |
template<class T > | |
tBoolean | isInstanceOf () const |
return true if the object is an instance of T More... | |
virtual void | print () |
print the class More... | |
virtual ostream & | print (ostream &out) const |
print the class More... | |
virtual void | print (const tString &message) |
print the class More... | |
virtual void | print (const tInteger &str) |
print More... | |
virtual void | print (const tRelativeInteger &str) |
print More... | |
virtual void | print (const tReal &str) |
print More... | |
virtual void | print (const int &str) |
print More... | |
Static Public Member Functions | |
static SP::CORE_Time | New () |
creates a time object More... | |
static SP::CORE_Time | New (const CORE_Time &time) |
creates a time object More... | |
static SP::CORE_Time | New (const CORE_Time *time) |
creates a time object More... | |
static SP::CORE_Time | New (const tTime &time) |
creates a time object More... | |
static SP::CORE_Time | New (const SP::CORE_Time &time) |
creates a time object More... | |
static SP::CORE_Time | New (const int &year, const int &month, const int &day) |
creates a time object year > 1900 month [1,12] day [1,31] More... | |
static tTime | getDateInSeconds () |
return the time in 1/60 seconds More... | |
static tTime | getDateInMilliSeconds () |
return the time in 1/60 seconds More... | |
static long int | getTime () |
return the time in 1/60 seconds More... | |
static tString | getWeekIntervalString (const int &year, const int &week) |
get the week interval monday –> sunday week in [1...53] More... | |
static tRelativeInteger | subTimes (const CORE_Time &time1, const CORE_Time &time2) |
get the difference betwen two dates in secund time1-time2 More... | |
static tRelativeInteger | subTimes (const SP::CORE_Time &time1, const SP::CORE_Time &time2) |
get the difference betwen two dates in secund time1-time2 More... | |
static tRelativeInteger | subTimesInMilliSeconds (const CORE_Time &time1, const CORE_Time &time2) |
get the difference betwen two dates in milli-secund time1-time2 More... | |
static tRelativeInteger | subTimesInMilliSeconds (const SP::CORE_Time &time1, const SP::CORE_Time &time2) |
get the difference betwen two dates in secund time1-time2 More... | |
static tString | getDuration (const long int &duration, int &days, int &hours, int &minutes, int &seconds, int &ms) |
get duration More... | |
static tString | getDuration (const long int &duration) |
get duration More... | |
static tString | getClassName (const tString &identityString) |
return the class name of the object using only the identity string More... | |
template<class T > | |
static tString | getTypeName () |
get type name More... | |
static tBoolean | is64Architecture () |
return true if the machine is a 64 bits machine More... | |
static tBoolean | is32Architecture () |
return true if the machine is a 32 bits machine More... | |
static tString | pointer2String (const void *obj) |
return the string represantation of a pointer More... | |
static void | setOutput (ostream &out) |
set output More... | |
static ostream & | getOutput () |
get output More... | |
static void | printObjectsInMemory () |
print object in memory More... | |
static ostream & | print (ostream &out, const tString &message) |
print the class More... | |
static void | outputPrint (const tString &message) |
Static Public Attributes | |
static const tTime | MAX_YEAR =1900+ULONG_MAX/(3600*24*365) |
MAX number of years. More... | |
static const tString | DAYS [] |
days names in english More... | |
static const tString | JOURS [] |
days names in french More... | |
static const tString | MONTHS [] |
month names in english More... | |
static const tString | MOIS [] |
month names in french More... | |
static tBoolean | mIsMemoryTesting =false |
indicator to store all classes created and deleted only for debuging version More... | |
Protected Member Functions | |
void | setThis (SP::CORE_Object p) |
set this weak shared pointer called toDoAfterThis setting method More... | |
virtual void | setType (tString type) |
set the type of the object More... | |
virtual void | toDoAfterThisSetting () |
method called after setThis() method this method can oly be called once. More... | |
this class describes a time class
Attributes:
CORE_Time::CORE_Time | ( | ) |
|
virtual |
remove
|
inline |
contune the chrono and return the time in ms since start time or last continue step
return the class name of the object using only the identity string
Referenced by UI_Class::createVector2D(), LAP_DoublePackedUpperMatrix::matrixProduct(), LAP_DoubleBandedUpperMatrix::matrixProduct(), LAP_DoubleFullUpperMatrix::matrixProduct(), and CORE_Object::printObjectsInMemory().
|
inherited |
return the class name of the object
References tString.
Referenced by CORE_Object::getIdentityString().
|
inline |
return the CPU time in 1/60 seconds
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
static |
get duration
References CORE_String::toString(), and tString.
Referenced by getDuration().
|
inlinestatic |
|
inline |
return the hours of the time
[0..23]
Referenced by setDate().
|
inlineinherited |
return the identity string of the object of the form className_at_address
References CORE_Object::getClassName(), CORE_Object::pointer2String(), and tString.
Referenced by UI_Class::createPrimitiveMap(), UI_Class::saveAssociation(), UI_Class::saveClass(), UI_ClassFactory::saveIntoClass(), MATH_StiefelFunction::toString(), LAP_2DView::toString(), CORE_Object::toString(), MATH_StiefelOptimizer::toString(), and MM_Class::toString().
|
inline |
return the milliseconds seconds of the time
Referenced by subInMilliSeconds(), and subTimesInMilliSeconds().
|
inline |
return the minutes of the time
[0..59]
Referenced by setDate().
|
inline |
|
inlinestaticinherited |
get output
|
inlineinherited |
return the identity string of the object
References CORE_Object::pointer2String().
|
inline |
return the seconds of the time
[0..60]
Referenced by setDate().
|
inline |
return the number of seconds since 1900
Referenced by isAfter(), isAfterOrEqual(), isBefore(), isBeforeOrEqual(), isEqual(), setToFirstWeekDay(), setToWeekDay(), sub(), subInMilliSeconds(), subTimes(), and subTimesInMilliSeconds().
|
inlineinherited |
get the shared pointer of this class into p
Referenced by CORE_Map< Key, Value >::getSharedPointer(), CORE_Array< tFlag >::getSharedPointer(), LAP_ConstVector< lapack_real >::getSharedPointer(), STAT_Combinatorial< T >::getSharedPointer(), LAP_Vector< lapack_int >::getSharedPointer(), CORE_Vector< T >::getSharedPointer(), CORE_Matrix< T >::getSharedPointer(), and CORE_Object::printObjectsInMemory().
|
inlineinherited |
get the shared pointer of this class into p
|
inlinestatic |
return the time in 1/60 seconds
References getDateInMilliSeconds().
Referenced by MMSD_Object::initSeed().
|
inlinestaticinherited |
get type name
References tString.
|
inline |
return the day of the week 0:Sunday [0..6]
|
static |
get the week interval monday –> sunday week in [1...53]
References ASSERT_IN, MAX_YEAR, New(), CORE_Integer::toString(), and tString.
|
inline |
get the week interval monday –> Sunday of the current time
|
inline |
get the week of the year
[1...53]
|
inline |
|
inlinestaticinherited |
return true if the machine is a 32 bits machine
References CORE_Object::is64Architecture().
|
staticinherited |
return true if the machine is a 64 bits machine
Referenced by CORE_Object::is32Architecture().
return true if this > t
References getSecondsSince1900(), and null.
|
inline |
return true if this > t
return true if this >= t
References getSecondsSince1900().
|
inline |
return true if this >= t
return true if this < t
References getSecondsSince1900(), and null.
|
inline |
return true if this <= t
References getSecondsSince1900().
|
inline |
return true if this <= t
References getSecondsSince1900().
return true if the 2 dates are equals
References getSecondsSince1900(), and null.
return true if the 2 dates are equals
References getSecondsSince1900().
|
inline |
return true if the 2 dates are equals
|
inlineinherited |
return true if the object is an instance of T
References null.
|
inlinestatic |
creates a time object
References CORE_Time().
Referenced by getDateInMilliSeconds(), getDateInSeconds(), getDaysNumberInMonth(), getWeekIntervalString(), and New().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
creates a time object year > 1900 month [1,12] day [1,31]
References CORE_Time().
|
staticinherited |
print on output
References null, and CORE_Object::print().
Referenced by CORE_Exception::CORE_Exception().
|
staticinherited |
return the string represantation of a pointer
References tString.
Referenced by CORE_Object::CORE_Object(), CORE_Object::getIdentityString(), CORE_Object::getPointerAddress(), and CORE_Object::~CORE_Object().
|
inlinevirtualinherited |
print the class
References CORE_Object::toString().
Referenced by CORE_Object::outputPrint(), CORE_Out::print(), CORE_Object::print(), CORE_Out::printInt(), CORE_Out::println(), CORE_Out::printReal(), CORE_Out::printString(), and CORE_Out::setAction().
|
inlinevirtualinherited |
print the class
References CORE_Object::print(), and CORE_Object::toString().
|
virtualinherited |
print the class
Reimplemented in CORE_Out.
References null, and CORE_Object::print().
|
virtualinherited |
References null.
|
virtualinherited |
References null.
|
inlinestaticinherited |
print the class
|
staticinherited |
print object in memory
References CORE_Object::getClassName(), CORE_Object::getSharedPointer(), and CORE_Object::mIsMemoryTesting.
Referenced by main().
void CORE_Time::setDate | ( | const tTime & | seconds | ) |
set the date from 1900 in seconds
Referenced by setDate(), setToFirstWeekDay(), setToLastDay(), setToNextDay(), setToNextMonth(), setToNextWeek(), setToPreviousDay(), setToPreviousDays(), setToPreviousMonth(), setToPreviousWeek(), and setToWeekDay().
void CORE_Time::setDate | ( | const int & | year, |
const int & | month, | ||
const int & | day, | ||
const int & | hour, | ||
const int & | minutes, | ||
const int & | seconds, | ||
const int & | ms | ||
) |
|
inline |
set the date year>=0 month in [1,12] day in [1,31]
References setDate().
|
inline |
set the date year>=0 month in [1,12]
References setDate().
void CORE_Time::setDate | ( | const tString & | date | ) |
set the date from a string year-month-day
References setDate().
|
inline |
set the date from a string year-month-day
References getDay(), getHours(), getMinutes(), getMonth(), getSeconds(), getYear(), and setDate().
|
inline |
set the date from a string year-month-day
References setDate().
|
inline |
set the date from a string year-month-day
References getDay(), getHours(), getMinutes(), getMonth(), getSeconds(), getYear(), null, and setDate().
set the date from a string date and with format
format may be:
References MAX_YEAR, CORE_Integer::parseInt(), and setDate().
void CORE_Time::setHour | ( | const tString & | h | ) |
set hour xxhyy
References CORE_Integer::parseInt(), and setTime().
|
inlinestaticinherited |
set output
|
inlineprotectedinherited |
set this weak shared pointer called toDoAfterThis setting method
References CORE_Object::toDoAfterThisSetting().
void CORE_Time::setTime | ( | const int & | hour, |
const int & | minutes, | ||
const int & | seconds | ||
) |
void CORE_Time::setTime | ( | const tString & | date | ) |
set the time from a string hour:min:sec
References CORE_String::New(), CORE_Integer::parseInt(), and setTime().
void CORE_Time::setToFirstWeekDay | ( | const int & | year, |
const int & | week | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void CORE_Time::setToWeekDay | ( | const int & | year, |
const int & | week, | ||
const int & | day | ||
) |
|
inlineprotectedvirtualinherited |
set the type of the object
Referenced by LAP_IntegerVector::LAP_IntegerVector(), MATH_BetaFunction::MATH_BetaFunction(), MATH_C1Function::MATH_C1Function(), MATH_DigammaFunction::MATH_DigammaFunction(), MATH_EigenFunction::MATH_EigenFunction(), MATH_Equation::MATH_Equation(), MATH_Function::MATH_Function(), MATH_GammaFunction::MATH_GammaFunction(), MATH_KeplerFunction::MATH_KeplerFunction(), MATH_LogGammaFunction::MATH_LogGammaFunction(), MATH_NewtonEquation::MATH_NewtonEquation(), MATH_StiefelFunction::MATH_StiefelFunction(), MATH_StiefelOptimizer::MATH_StiefelOptimizer(), MATH_TranscendentEquation::MATH_TranscendentEquation(), MATH_TrigammaFunction::MATH_TrigammaFunction(), MATH_ZeroEquation::MATH_ZeroEquation(), MATH_ZKeplerFunction::MATH_ZKeplerFunction(), MM_Attribute::MM_Attribute(), MM_Class::MM_Class(), MM_ClassFactory::MM_ClassFactory(), MM_Data::MM_Data(), MM_Structure::MM_Structure(), MMSD_ClassFactory::MMSD_ClassFactory(), MMSD_Cluster::MMSD_Cluster(), MMSD_ConstDoubleVector::MMSD_ConstDoubleVector(), MMSD_ConstraintGaussianCluster::MMSD_ConstraintGaussianCluster(), MMSD_ConstraintGaussianModel::MMSD_ConstraintGaussianModel(), MMSD_DataSet::MMSD_DataSet(), MMSD_DataSetClassFactory::MMSD_DataSetClassFactory(), MMSD_DoubleFullMatrix::MMSD_DoubleFullMatrix(), MMSD_DoubleSymmetricMatrix::MMSD_DoubleSymmetricMatrix(), MMSD_DoubleVector::MMSD_DoubleVector(), MMSD_FluryGautschiGaussianLaw::MMSD_FluryGautschiGaussianLaw(), MMSD_GaussianCluster::MMSD_GaussianCluster(), MMSD_GaussianFDFunction::MMSD_GaussianFDFunction(), MMSD_GaussianLaw::MMSD_GaussianLaw(), MMSD_GaussianModel::MMSD_GaussianModel(), MMSD_Law::MMSD_Law(), MMSD_Model::MMSD_Model(), MMSD_ModelClassFactory::MMSD_ModelClassFactory(), MMSD_Object::MMSD_Object(), MMSD_StiefelFunction::MMSD_StiefelFunction(), MMSD_StiefelGaussianLaw::MMSD_StiefelGaussianLaw(), STAT_BernoulliDistribution::STAT_BernoulliDistribution(), STAT_BinomialDistribution::STAT_BinomialDistribution(), STAT_Combinatorial< T >::STAT_Combinatorial(), STAT_DiracDistribution::STAT_DiracDistribution(), STAT_Distribution::STAT_Distribution(), STAT_ExponentialDistribution::STAT_ExponentialDistribution(), STAT_GammaDistribution::STAT_GammaDistribution(), STAT_GeometricDistribution::STAT_GeometricDistribution(), STAT_InverseNormalDistribution::STAT_InverseNormalDistribution(), STAT_NormalDistribution::STAT_NormalDistribution(), STAT_Object::STAT_Object(), STAT_PoissonDistribution::STAT_PoissonDistribution(), STAT_UniformDistribution::STAT_UniformDistribution(), and STAT_UniformLaplaceTransform::STAT_UniformLaplaceTransform().
|
inline |
start the chrono
|
inline |
end the chrono and return the time in ms since start time
tRelativeInteger CORE_Time::sub | ( | const CORE_Time & | time2 | ) | const |
get the difference with time2 this -time2 in secunds
References getSecondsSince1900().
Referenced by sub(), and subInMilliSeconds().
|
inline |
get the difference with time2 this -time2 in secunds
References sub().
|
inline |
get the difference with time2 this -time2 in secunds
References getSecondsSince1900(), null, and sub().
tRelativeInteger CORE_Time::subInMilliSeconds | ( | const CORE_Time & | time2 | ) | const |
get the difference with time2 this -time2 in secunds
References getMilliSeconds(), and getSecondsSince1900().
|
inline |
get the difference with time2 this -time2 in secunds
References sub().
|
inline |
get the difference with time2 this -time2 in secunds
References getSecondsSince1900(), null, and sub().
|
static |
get the difference betwen two dates in secund time1-time2
References getSecondsSince1900().
|
static |
get the difference betwen two dates in secund time1-time2
References null.
|
static |
get the difference betwen two dates in milli-secund time1-time2
References getMilliSeconds(), and getSecondsSince1900().
|
static |
get the difference betwen two dates in secund time1-time2
References null.
|
inlineprotectedvirtualinherited |
method called after setThis() method this method can oly be called once.
Reimplemented in STAT_UniformLaplaceTransform.
Referenced by CORE_Object::setThis(), and STAT_UniformLaplaceTransform::toDoAfterThisSetting().
|
virtual |
return the time into a string
Reimplemented from CORE_Object.
References tString.
Referenced by toString().
return the time into a string with format
References CORE_Integer::toString(), toString(), and tString.
|
static |
days names in english
|
static |
days names in french
|
static |
MAX number of years.
Referenced by getWeekIntervalString(), setDate(), setToFirstWeekDay(), and setToWeekDay().
|
staticinherited |
indicator to store all classes created and deleted only for debuging version
Referenced by CORE_Object::CORE_Object(), main(), CORE_Object::printObjectsInMemory(), and CORE_Object::~CORE_Object().
|
static |
month names in french
|
static |
month names in english