Pipe#
Native pipe RAII wrapper.
Header: | #include <AUI/Platform/Pipe.h> |
CMake: | aui_link(my_target PUBLIC aui::core) |
Public Methods#
closeIn#
Close in. Also known as close(pipe[1])
closeOut#
Close out. Also known as close(pipe[0])
in#
In pipe. Also known as pipe[1]
.
Examples#
examples/app/minesweeper/src/MinesweeperWindow.cpp
Minesweeper Game - Minesweeper game implementation driven by ass.
_new<AButton>("New game...").connect(&AButton::clicked, me::newGame),
},
},
_container<AStackedLayout>(
{ // also assign ".frame" ASS class in place
mGrid = _new<AViewContainer>() << ".frame" }) });
beginGame(10, 10, 20);
}
examples/ui/infinite_lazy_list/src/main.cpp
Infinite Lazy List - Usage of AUI_DECLARATIVE_FOR to make an infinite lazy list.
};
});
return Vertical {
AUI_DECLARATIVE_FOR(i, *state->items, AVerticalLayout) { return Label{} & i->value; },
Centered {
_new<ASpinnerV2>() AUI_LET {
AObject::connect(it->redrawn, AObject::GENERIC_OBSERVER, [state] {
// when a spinner appears, we indicate that we need more items.
state->needMore = true;
out#
Out pipe. Also known as pipe[0]
.
Examples#
examples/7guis/cells/src/Cell.cpp
7GUIs Cells - Spreadsheet processor (Excel).
return formula::evaluate(*spreadsheet, expression);
}
glm::uvec2 Cell::fromName(const AString& name) {
glm::uvec2 out{UNDEFINED};
auto it = name.begin();
for (;it != name.end() && 'A' <= *it && *it <= 'Z'; ++it) {
if (out.x == UNDEFINED) { out.x = 0; }
out.x *= 26;
out.x += *it - 'A';
examples/7guis/cells/src/AST.cpp
7GUIs Cells - Spreadsheet processor (Excel).
stealIn#
Steals ownership of the in pipe outside of the Pipe class.
Resets the pipe value to zero. Caller is responsible for closing the pipe.
stealOut#
Steals ownership of the out pipe outside of the Pipe class.
Resets the pipe value to zero. Caller is responsible for closing the pipe.