Library: settle long standing confusion regarding time border conditions

basically we can pick just any convention here, and so we should pick the convention in a way
that makes most sense informally, for a *human reader*. But what we previously did, was to pick
the condition such as to make it simple in some situations for the programmer....

With the predictable result: even with the disappointingly small number of usages we have up to now,
we got that condition backwards several times.

OK, so from now on!!!

Time::NEVER == Time::MAX, because "never" is as far as possible into the future
This commit is contained in:
Fischlurch 2018-11-17 17:25:10 +01:00
parent a49d79ffbd
commit b68d0f24cb
4 changed files with 8 additions and 8 deletions

View file

@ -86,8 +86,8 @@ namespace time {
const Time Time::MIN ( TimeValue::buildRaw_(-_raw(Time::MAX) ) );
const Time Time::ZERO;
const Time Time::ANYTIME(Time::MAX);
const Time Time::NEVER (Time::MIN);
const Time Time::ANYTIME(Time::MIN);
const Time Time::NEVER (Time::MAX);
const Offset Offset::ZERO (Time::ZERO);

View file

@ -147,7 +147,7 @@ namespace play {
Duration
Timings::constantFrameTimingsInterval (TimeValue) const
{
return Duration (Time::ANYTIME);
return Duration (Time::MAX);
}

View file

@ -107,7 +107,7 @@ namespace engine {
Job::isValid() const
{
return this->jobClosure
&& myClosure(this).verify (getNominalTime(),
and myClosure(this).verify (getNominalTime(),
getInvocationInstanceID());
}

View file

@ -86,7 +86,7 @@ namespace engine {
bool
verify (Time nominalJobTime, InvocationInstanceID invoKey) const
{
return Time::NEVER < nominalJobTime
return Time::ANYTIME < nominalJobTime
&& 0 <= invoKey.metaInfo.a
&& invoKey.metaInfo.a < MAX_PARAM_A
&& -MAX_PARAM_B <= invoKey.metaInfo.b
@ -116,8 +116,8 @@ namespace engine {
{ }
Invocation()
: nominal(Time::NEVER)
, real(Time::ANYTIME)
: nominal(Time::ANYTIME)
, real(Time::NEVER)
, a(MAX_PARAM_A), b(0)
{ }
};
@ -178,7 +178,7 @@ namespace engine {
{
REQUIRE (job.usesClosure (dummyClosure));
return Time::NEVER != dummyClosure.queryInvocation(job.parameter).nominal;
return Time::NEVER != dummyClosure.queryInvocation(job.parameter).real;
}