Subject(3I)
π Subject(3I) β the InterViews Reference Manual page, but make it cute π
okay bestie, sit down, hydrate, because we're talking about Subject from the InterViews Reference Manual, and honestly? she's a whole social coordinator. π
β¨ NAME β¨
Subject β an object with views π¦
πΈ SYNOPSIS πΈ
#include <InterViews/subject.h>
π DESCRIPTION π
So a subject is an object that has one or more views that it wants to notify when it changes. That's the whole job. That's the vibe. She changes, everybody who's watching her hears about it. π£
If you ever need to walk through the views of a subject explicitly, there's the SubjectIteractor class for that. (Yes, that's how it's spelled in the source, bestie, we do not fix it. π)
Now here's the lore: because subjects get shared, Subject is a subclass of Resource. And because multiple inheritance is a possibility β and in that scenario you only want a single copy of resource information hanging around, no duplicates, no drama β Resource is a virtual base class. π That's just how it has to be. periodt.
π PUBLIC OPERATIONS π
π the enum π
enum UpdateHint {
attaching, detaching, setting, changing
}
This type enumerates the possible hints you get when a subject is notifying a view that it has changed. Let's break it down, one by one, no skips:
attachingβ this hint means a view has attached to the subject. new bestie acquired π«Άdetachingβ this one means the subject is being deleted, and the view should consider itself detached. it's giving farewell tour πsettingβ the subject's value has been set, though possibly to the same value as it already has. so like... she said the same thing again. still counts as an announcement.changingβ the value is set to something different than it was previously. an actual plot twist. π₯
π the operations π
virtual void attach(View*)β add a view to the subject's list. welcome to the group chat, babes πvirtual void detach(View*)β remove a view from the subject's list. we hate to see you go π¦virtual void notify(UpdateHint = changing)β notify all the views of a subject that it has been updated. default hint ischanging, fyi. she's shouting it from the rooftops π’virtual boolean viewed_by(View*)β returns whether a given view is on the subject's list of views. a little vibe check, if you will. β¨
π the backward-compatibility corner (iykyk) π
heads up bestie: every single one of these exists solely for backward compatibility, and every single one of them will be removed in a future version. do not build your whole personality around them. π
virtual void Attach(Interactor*)β equivalent toattach. legacy. will be removed in a future version.virtual void Detach(Interactor*)β equivalent todetach. legacy. will be removed in a future version.virtual void Notify()β equivalent tonotify(changing). legacy. will be removed in a future version.boolean IsView(Interactor*)β equivalent toviewed_by. legacy. will be removed in a future version.
π¦ SUBJECTITERATOR OPERATIONS π¦
A subject iterator can be used to iterate through the views in a subject. she's your little tour guide through the list. π§
SubjectIterator(Subject*)β create a subject iterator for the given subject. > β οΈ the iterator is only valid as long as the subject exists. once the subject dips, so does your iterator. no cap.virtual void init()β reset the iteration to start at the beginning of the list. this operation is called by the constructor, so it already happens for you, slay. βvirtual boolean more()β return whether there are more views in the list. are we there yet? are we there yet? πvirtual View* cur()β return the current view. the main character of this exact moment. πvirtual void remove()β remove the current view from the list. πvirtual void next()β move the iteration to the next view in the list. onward! β¨
π SEE ALSO π
View(3I)
that's the whole page, bestie, and you ate it. π
β¨ the InterViews manual, dated 29 June 1989, brought to you by InterViews itself β mwah, sending you a little kiss and a Subject(3I) reference card, go forth and notify your views. ππ«Άπ
π¦ 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