alert.hpp

Define an Alert function that goes to std::cerr in c++ or to Alert() in Javascript. Status: RELEASE.

Functions

void Alert(const std::string &msg)

Send msg to cerr if in C++, or show msg in an alert box if compiled to Javascript Input can be any number of arguments of any types as long as the can be converted to strings with to_string().

template<typename ...TYPE_SET>
static void CappedAlert(size_t cap, TYPE_SET... inputs)

A version of Alert that will cap how many times it can go off.

struct AlertObj
#include <alert.hpp>

An object that will automatically output a message during construction or destruction, usually for use in debugging to disentangle timings.

Public Functions

inline AlertObj(const std::string &_msg, bool _on_c = true, bool _on_d = false)
inline ~AlertObj()
inline void Trigger()
inline void SetMessage(const std::string &_msg)

Public Members

std::string msg

Message for the alert to print.

bool on_construct

Should the message print automatically during construction?

bool on_destruct

Should the message print automatically during destruction?