GVUpdater(3U)

πŸ’– GVUpdater β€” ok bestie, let's talk πŸ’–

InterViews Reference Manual Β· section 3U Β· yeah we're in the library pages now, buckle up πŸŽ€


✨ NAME ✨

GVUpdater β€” she updates the GraphicViews structure so it matches its subject. glow-up service, basically πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <Unidraw/Components/gvupdater.h>

🌸 DESCRIPTION 🌸

okay so. GVUpdater is an implementation class that GraphicViews uses to keep its state and structure consistent with its GraphicComps subject. no cap, she's the behind-the-scenes bestie making sure nobody's out here looking mismatched 😭

here's what she guarantees:

  • the subject's immediate children are identical to the view's β€” same number, same graphics state attributes. fr fr, exactly matching.
  • the root GraphicViews and GraphicComps themselves have the same graphics state. slay.

and here's the thing she does not do, and this matters:

GVUpdater does not ensure that it will detect and update changes made to deeper child nodes. like, she's not doing a full deep dive, bestie. immediate children only. deeper nodes are on their own πŸ’€

πŸ‘‘ PUBLIC OPERATIONS πŸ‘‘

  • GVUpdater(GraphicView*) β€” the constructor takes the GraphicView that it will be updating as a parameter and stores it in the protected member _gv. normally, GraphicViews are the only objects that will instantiate GVUpdater β€” so if that's you, bestie, you're special ✨
  • virtual void Update() β€” Update the GraphicView to make it consistent with its subject. that's the whole assignment. go make them match 🫢

🧚 PROTECTED OPERATIONS 🧚

  • void UpdateStructure()
  • void UpdateState()

The Update procedure takes place in two stages, and the order is not vibes-based, it's real:

  1. the subject's and view's structures are reconciled first by UpdateStructure
  2. and then the view's graphic state is changed to match the subjects with UpdateState.

structure first, then state. periodt 🌈


  • void AddDamage(Graphic*)
  • void IncurDamage(Graphic*)
  • void Unselect(GraphicView*)
  • virtual void Add(GraphicView*)
  • virtual void Append(GraphicView*)
  • virtual void InsertBefore(Iterator, GraphicView*)
  • virtual void Remove(Iterator&)
  • virtual void DeleteView(Iterator&)

GVUpdater is a friend of GraphicViews β€” yes, actual friend privileges, main character energy πŸ‘‘ these convenience operations provide an interface to the corresponding protected GraphicViews operations. iykyk πŸŽ€


  • virtual ClassId ViewCategory() β€” Returns the view category (see classes(3U)) that GVUpdater will use to instantiate views of subjects. ViewCategory returns COMPONENT_VIEW by default. that's the default, don't forget it πŸ’œ

πŸ”₯ SEE ALSO πŸ”₯

GraphicComp(3U), GraphicView(3U), classes(3U)


that's the whole page bestie, go forth and keep your views consistent πŸ’–βœ¨

with love from the Unidraw girlies β€” 19 January 1991 β€” yeah we've been iconic since then πŸ’…πŸŽ€