EffectiveField.h header

#include <ew/core/EffectiveField.h>

Namespace ew::core

EffectiveField struct

struct ew::core::EffectiveField

One property an entity effectively has, together with where it was declared.

Provenance is not decoration: a writer looking at a property needs to know whether editing it changes one entity or every entity in a category, and a tool that offers to promote or demote it needs to know which end it currently lives on. Deriving that afterwards would mean re-walking the ancestry with a second copy of the composition rule, which is exactly how the answer and the explanation of the answer drift apart.

Exactly one of the two sources is set. ew::core::project::Project::effectiveFieldSourcesFor produces these; ew::core::project::Project::effectiveFieldsFor is the same walk with the provenance dropped.

Members

ew::core::taxonomy::FieldDefinition ew::core::project::EffectiveField::definition

The property itself, as it survived the walk – the declaration that won on its key.

ew::core::foundation::CategoryId ew::core::project::EffectiveField::sourceCategory

The category that declared it, or a null id when an entity did.

ew::core::foundation::ContentId ew::core::project::EffectiveField::sourceEntity

The entity that declared it as its own, or a null id when a category did.