ComponentView(3U)
π ComponentView(3U) β like, the whole vibe π
InterViews Reference Manual Β· Unidraw Β· bestie edition π¦
β¨ NAME β¨
ComponentView β the base class for views of objects that model domain-specific elements. she's the blueprint, the blueprint-iest blueprint, the mother of all views π
πΈ SYNOPSIS πΈ
#include <Unidraw/Components/compview.h>
π DESCRIPTION π
okay so listen. ComponentView is an abstract base class for views of component subjects. no cap.
component views give you a specialized presentation of the info living inside the component subject they're attached to. and like, usually there's at least one view subclass defined for each subclass of component subject. it's giving "every subject deserves its own dedicated little presentation era" π
π PUBLIC OPERATIONS π
virtual void Interpret(Command*)virtual void Uninterpret(Command*)
these two call the corresponding subject operations by default. they're in the component view protocol purely for convenience, because other objects are always out here dealing with component views instead of their subjects. relatable honestly π
virtual void Update()
notifies the view that some state it depends on changed β normally state in the subject. by default this operation does nothing. she's silent, she's unbothered, she's not reacting π
virtual Component* GetParent()
returns the view's parent, if any. just like component subjects, component views may be structured hierarchically β and their structure may or may not reflect that of their subject. messy family tree energy fr fr π³
Component* GetSubject()
returns the component view's subject. that's her person, that's who she's attached to π«Ά
virtual void First(Iterator&)virtual void Last(Iterator&)virtual void Next(Iterator&)virtual void Prev(Iterator&)virtual boolean Done(Iterator)
the operations for iterating over the component view's children, if any. First and Last initialize an iterator to point to the beginning and end of the list of children, respectively. Next increments the iterator to point to the following child, while Prev decrements the iterator to point to the preceding child. and Done returns whether or not the iterator points beyond the first or last child in the list. yes bestie, she walks the whole list, forward and back, iconic behavior β¨
virtual ClassId GetClassId()virtual boolean IsA(ClassId)
GetClassId returns the unique class identifier for the ComponentView subclass, while IsA returns whether the instance is of a class or subclass corresponding to the given identifier. IsA typically checks the given identifier against the instance's own (as defined by its GetClassId operation) and, failing that, calls its parent classes' IsA operation. so like, she asks herself first, then asks her mom, then her mom's mom β generational knowledge π
all subclasses MUST redefineGetClassIdandIsAto ensure that their identifiers are unique and that view category information is defined properly. not optional, bestie, this is a hard requirement.
see classes(3U) for more info on class identifiers and view categories. iykyk π
π PROTECTED OPERATIONS π
ComponentView(Component* subject = nil)
the constructor initializes the component view's subject pointer to the given value. and the view will also attach itself to the subject if the argument is non-nil β so if you hand her a subject, she's immediately claiming it, no hesitation, main character energy π
virtual void SetSubject(Component*)
sets the component's subject pointer to the given value. by default, this operation does not call Attach or Detach on the subject(s). so it's a quiet little pointer swap, no drama, no notifications π
virtual void SetParent(Component* child, Component* parent)
notifies a child component that it has a new or different parent. by default this operation does nothing.
composite components should call this function in their structure-modifying operations, and components that keep information about their parents should redefine it to update this information. otherwise the child is just out here parentless and confused π
π₯ SEE ALSO π₯
Command(3U), Component(3U), Iterator(3U), classes(3U)
and that's the whole page bestie π this one came out of Unidraw on 20 August 1990 β yeah, before most of us were even a thought, and she's still serving. periodt. ππΈπ¦
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms