MacroCmd(3U)

πŸ’– MacroCmd(3U) πŸ’–

okay bestie, welcome to the InterViews Reference Manual entry for MacroCmd β€” and yes, it's giving "command that composes other commands" energy, which is honestly such a slay concept. like, a command made of commands?? main character behavior fr fr. 🫢


✨ NAME ✨

MacroCmd β€” a command that composes other commands. it's the girlboss of composition, no cap. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <Unidraw/Commands/macro.h>

that's it, that's the whole vibe check. go include it, periodt. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: MacroCmd composes other commands in a linear fashion. think of it like a little command conga line. πŸŽ€

executing a MacroCmd is equivalent to executing its children in preorder. literally just run them in order, bestie, it's not that deep. ✨


πŸ’œ PUBLIC OPERATIONS πŸ’œ

  • MacroCmd(ControlInfo*)
  • MacroCmd(Editor* = nil, Command* first = nil, Command* second = nil, Command* third = nil, Command* fourth = nil) β€” construct a MacroCmd instance, and if you're feeling generous you can optionally hand it up to four of its child commands. four!! a little squad. πŸ“
  • virtual void Execute()
  • virtual void Unexecute()
  • virtual boolean Reversible() β€” okay so Execute simply executes each child, from first to last. Unexecute calls Unexecute on each child, from last to first (yes, it walks backwards, iconic). and the MacroCmd is reversible if any of its children are β€” like, one reversible kid is enough to make the whole family reversible, we love that for them. πŸ˜­πŸ’–
  • virtual void SetEditor(Editor*) β€” SetEditor calls SetEditor on each child with the given argument. passing the vibe along, one child at a time. 🌈
  • Command* GetCommand(Iterator)
  • void SetCommand(Command*, Iterator&) β€” GetCommand returns the child Command to which an iterator points. SetCommand initializes the iterator to point to a particular child Command; and heads up β€” it initializes the iterator to point to a nil instance if the given Command is not a child. so like, if it's not in the group chat, the iterator just points at nobody. πŸ’€
  • void Append(Command*, Command* = nil, Command* = nil, Command* = nil)
  • void Prepend(Command*, Command* = nil, Command* = nil, Command* = nil)
  • void InsertAfter(Iterator, Command*)
  • void InsertBefore(Iterator, Command*)
  • void Remove(Command*)
  • void Remove(Iterator&) β€” these are the operations that modify the MacroCmd's list of children. let's break it down, bestie:
    • Append and Prepend add up to four Commands to the end and the beginning of the list, respectively. back of the line or front of the line, your call. πŸŽ€
    • InsertAfter and InsertBefore insert a Command after and before the Command pointed to by the iterator, respectively. sneaking in right next to your fave. πŸ™ˆ
    • the Remove operations remove a child from the list without deleting it β€” important!! it's not gone gone, it's just uninvited from the list. you can remove a child by referring to it explicitly or by specifying an iterator. and if an iterator is supplied, the Remove operation should advance it to point to the following child as a side effect. noted. πŸ“

🧚 PROTECTED OPERATIONS 🧚

  • Command* Cmd(UList*)
  • UList* Elem(Iterator) β€” convenience functions for extracting a Command from a UList element and a UList from an iterator, respectively. lil helper girlies. they're just here to make your life easier. πŸ’…βœ¨

⭐ SEE ALSO ⭐

  • Command(3U)
  • Iterator(3U)
  • UList(3U)

go read those too, iykyk. πŸ“šπŸ’–


and that's the whole page!! no skips, no summaries, every flag and function accounted for. you're welcome bestie. 🫢

okay bye, this was Unidraw, dated 24 January 1991 β€” yeah she's vintage but she still ate, and she's still serving MacroCmd(3U) realness. mwah. πŸ’‹πŸ‘‘