Skip to content

ASignal#

Signal field which can be subscribed to.

Header:#include <AUI/Common/ASignal.h>
CMake:aui_link(my_target PUBLIC aui::core)

Detailed Description#

Public Types#

call_wrapper#


struct ASignal::call_wrapper

Empty structure.

Public Methods#

bool#


operator ASignal::bool()

Check whether signal contains any connected slots or not.

Returns
true, if slot contains any connected slots, false otherwise.

It's very useful then signal argument values calculation is expensive and you do not want to calculate them if no slots connected to the signal.

Examples#

examples/app/minesweeper/src/CellView.cpp

Minesweeper Game - Minesweeper game implementation driven by ass.

        mCellValueCopy = mCell;
    }
    AView::render(context);

    if (bool(mCell & FieldCell::OPEN)) {
        int count = field_cell::getBombCountAround(mCell);
        if (count) {
            AFontStyle fs;
            fs.size = getHeight() * 6 / 7;
            fs.align = ATextAlign::CENTER;