|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Base class of every component: a piece of state attached to an entity, plus a "changed" flag. More...
#include <headers/guillaume/ecs/component.hpp>

Public Member Functions | |
| bool | hasChanged (void) const |
| Tell whether a value of the component changed since the flags were last reset (the end of the previous frame). | |
| void | setHasChanged (bool hasChanged) |
| Raise or lower the changed flag. | |
| Component (void)=default | |
| Create a component that is not marked as changed. | |
| virtual | ~Component (void)=default |
| Virtual destructor, so components can be destroyed through the base class. | |
Base class of every component: a piece of state attached to an entity, plus a "changed" flag.
A component holds data only (a size, a color, a checkbox configuration); the rules that read and write it live in systems. One instance is stored per entity and per component type in a ComponentRegistry, and is reached by entity identifier.
The base class adds one thing: the changed flag. A derived component raises it from its setters when a value really changes; the frame loop lowers every flag at the end of the frame (ComponentRegistry::resetChangedFlags). A component starts unchanged: adding it to an entity does not raise the flag.
Definition at line 71 of file component.hpp.
| bool guillaume::ecs::Component::hasChanged | ( | void | ) | const |
Tell whether a value of the component changed since the flags were last reset (the end of the previous frame).
Definition at line 27 of file component.cpp.

| void guillaume::ecs::Component::setHasChanged | ( | bool | hasChanged | ) |
Raise or lower the changed flag.
Setters of derived components call setHasChanged(true) after storing a different value. ComponentRegistry::resetChangedFlags calls setHasChanged(false) on every component.
| hasChanged | True to mark the component as changed, false to mark it as unchanged. |
Definition at line 32 of file component.cpp.
