Class to handle all ML Notify prints, errors and warnings.
void notify(MLuint32 objType, void *objData1=nullptr, void *objData2=nullptr)
Calls all registered functions and pass object type code in objType.
const std::vector< MLNotifyCB * > & getCallbackList() const
Returns const access to callback function pointers.
void addNotifyCB(void *userData, MLNotifyCB *callback)
Registers a function callback callback that is called if any error, warning, Notify or cout/cerr prin...
void setEnabled(bool flag)
Enables/disables whether notifications are to be sent; default is true;.
size_t getNumNotifyCBs() const
Returns the number of registered callbacks.
const std::vector< void * > & getUserDataList() const
Returns const access to user data pointers.
void reset()
Resets instance to construction state.
std::vector< void * > _notifyCBUserDataList
User data for registered notify callbacks.
void removeNotifyCB(void *userData, MLNotifyCB *callback)
Unregisters a given callback function with its user data.
~Notify()
Destructor. Destroys the Notify object after removing all registered callbacks.
bool _enabled
Flag if notify sends notifications; enabled by default.
Notify()
Constructor. Creates a Notify object without registered callbacks.
std::vector< MLNotifyCB * > _notifyCBList
List of function pointers for error printing.
bool isEnabled() const
Returns true if notifications are enabled.
void removeAllNotifyCBs()
Removes all registered callback functions.
Notify(const Notify ¬ifyObj)
Copy constructor.
Notify & operator=(const Notify ¬ifyObj)
Assignment operator.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
void MLNotifyCB(MLuint32 objType, void *usrData, void *objectData1, void *objData2)
Function type which is registered by the Notify object; it receives a code objType of type MLNotifyCh...
#define ML_UTILS_EXPORT
Defines platform dependent DLL export macro for mlUtils.
ML_UTILS_EXPORT Notify MLNotify
Singleton which contains all registered callback functions of the ML.
MLEXPORT std::ostream & operator<<(std::ostream &s, const ml::Field &v)
Overloads the operator "<<" for stream output of Field objects.