The Vish Visualization Shell 0.3
Vish
MemCore::Ageable Class Reference

Base class for objects which change from time to time. More...

#include <elementary/memcore/Ageable.hpp>

Inheritance diagram for MemCore::Ageable:
Wizt::VAbstractValue< VSocketAction > Wizt::Creator_t< Type > Wizt::VValue< Wizt::VThreadManager > Wizt::VValue< VSocketAction > Wizt::VValue< VThreadManager > Wizt::VValue< MemCore::StrongPtr > Eagle::BoundingBall Wizt::Colormap Wizt::DisplayList Wizt::RenderNamespace::LightSource Wizt::RenderNamespace::Lighting Wizt::TextureBase Wizt::VAbstractValue< Type > Wizt::VBO Wizt::VBO::Renderer Wizt::VConnectionValidator Wizt::VRequest Wizt::VSlotContainer::VInputSet Wizt::VStateCreatorBase::State Wizt::VValue< Type > Wizt::VValue< VThreadManager > Wizt::VishSaver

Public Member Functions

 Ageable () noexcept
 Constructor; remembers birth time from current time counter.
constexpr Ageable (age_t t) noexcept
 Constructor with explicit time value.
constexpr Ageable (const Ageable &A) noexcept
 Copy constructor.
 Ageable (const volatile Ageable &A) noexcept
 Copy constructor.
constexpr const AgeablegetAge () const
 Return reference to this age, useful for derived classes.
bool isNewerThan (const Ageable &a) const noexcept
 Comparison operator.
bool isOlderThan (const Ageable &a) const noexcept
 Comparison operator.
bool isYoungerThan (const Ageable &a) const noexcept
 Comparison operator (alias to isNewerThan() ).
bool operator!= (const Ageable &a) const noexcept
 Comparison operator.
bool operator< (const Ageable &a) const noexcept
 Comparison operator.
bool operator<= (const Ageable &a) const noexcept
 Comparision operator.
bool operator<= (const volatile Ageable &a) const volatile noexcept
 Comparision operator.
bool operator== (const Ageable &a) const noexcept
 Comparison operator.
bool operator> (const Ageable &a) const noexcept
 Comparison operator.
bool operator> (const volatile Ageable &a) const volatile throw ()
 Comparision operator.
bool operator>= (const Ageable &a) const noexcept
 Comparision operator.
bool operator>= (const volatile Ageable &a) const volatile noexcept
 Comparison operator.
constexpr void resetAge () noexcept
 Set time value to InfinitelyOld().
void setInfinitelyNew () noexcept
 Set time value to InfinitelyNew().
age_t time_value () const noexcept
 Return an object's current age.
age_t time_value () const volatile noexcept
 Return an object's current age.
Ageabletouch () noexcept
 Mark the current object as being modified "now".
age_t update (age_t age) noexcept
 Set the age of the current object to a specific age if that is newer than the current one.
age_t update (const Ageable &Other) noexcept
 Set the age of the current object to the age of another object if that other one is newer than the current one.
age_t update (const volatile Ageable &Other) volatile noexcept
 Set the age of the current object to the age of another object if that other one is newer than the current one.
 ~Ageable () noexcept
 Destructor.

Static Public Member Functions

static const AgeableInfinitelyNew () noexcept
 Return a time that is infinitely in the future (well, sort of).
static constexpr const AgeableInfinitelyOld () noexcept
 Return a time that is infinitely in the past (well, sort of).
static age_t now () noexcept
 Return the current global time.

Detailed Description

Base class for objects which change from time to time.

Upon touching such "ageable" objects, a change is indicated. The "age" is not related to physical time, but just an integer number. This number is a global counter that is increased when any object is touched.

Member Function Documentation

◆ InfinitelyNew()

const Ageable & MemCore::Ageable::InfinitelyNew ( )
staticnoexcept

Return a time that is infinitely in the future (well, sort of).

It is a reference to a static members whose time value is the largest one possible, meaning no object will ever reach this age.

References Ageable().

Referenced by setInfinitelyNew().

◆ InfinitelyOld()

constexpr const Ageable & MemCore::Ageable::InfinitelyOld ( )
inlinestaticconstexprnoexcept

Return a time that is infinitely in the past (well, sort of).

It is a reference to a static members whose time value is zero, means it's the oldest of all objects (smallest age).

References Ageable().

Referenced by resetAge(), Wizt::VRequest::VRequest(), and Wizt::VRequest::VRequest().

◆ touch()

Ageable & MemCore::Ageable::touch ( )
inlinenoexcept

Mark the current object as being modified "now".

The global time counter is increased by this operation.

References Ageable(), and touch().

Referenced by Wizt::VishSaver::Save(), Wizt::VRenderContext::setLightSources(), touch(), and MemCore::Attributes::touchAttributes().