Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
us::ModuleEvent Class Reference

An event from the Micro Services framework describing a module lifecycle change. More...

#include <usModuleEvent.h>

Public Types

enum  Type { LOADED , UNLOADED , LOADING , UNLOADING }
 

Public Member Functions

 ModuleEvent ()
 Creates an invalid instance. More...
 
 ~ModuleEvent ()
 Destructor. More...
 
bool IsNull () const
 Can be used to check if this ModuleEvent instance is valid, or if it has been constructed using the default constructor. More...
 
 ModuleEvent (Type type, Module *module)
 Creates a module event of the specified type. More...
 
 ModuleEvent (const ModuleEvent &other)
 Copy constructor. More...
 
ModuleEvent & operator= (const ModuleEvent &other)
 Copy assignment operator. More...
 
Module * GetModule () const
 Returns the module which had a lifecycle change. If this is a null event (default-constructed), returns nullptr. More...
 
Type GetType () const
 Returns the type of lifecycle event. More...
 

Detailed Description

An event from the Micro Services framework describing a module lifecycle change.

ModuleEvent objects are delivered to listeners connected via ModuleContext::AddModuleListener() when a change occurs in a modules's lifecycle. A type code is used to identify the event type for future extendability.

See also
ModuleContext::AddModuleListener

Definition at line 37 of file usModuleEvent.h.

Member Enumeration Documentation

◆ Type

Enumerator
LOADED 

The module has been loaded.

The module's ModuleActivator Load method has been executed.

UNLOADED 

The module has been unloaded.

The module's ModuleActivator Unload method has been executed.

LOADING 

The module is about to be loaded.

The module's ModuleActivator Load method is about to be called.

UNLOADING 

The module is about to be unloaded.

The module's ModuleActivator Unload method is about to be called.

Definition at line 44 of file usModuleEvent.h.

Constructor & Destructor Documentation

◆ ModuleEvent() [1/3]

us::ModuleEvent::ModuleEvent ( )

Creates an invalid instance.

◆ ~ModuleEvent()

us::ModuleEvent::~ModuleEvent ( )

Destructor.

◆ ModuleEvent() [2/3]

us::ModuleEvent::ModuleEvent ( Type  type,
Module *  module 
)

Creates a module event of the specified type.

Parameters
[in]typeThe event type.
[in]moduleThe module which had a lifecycle change.

◆ ModuleEvent() [3/3]

us::ModuleEvent::ModuleEvent ( const ModuleEvent &  other)

Copy constructor.

Parameters
[in]otherThe ModuleEvent to copy.

Member Function Documentation

◆ GetModule()

Module* us::ModuleEvent::GetModule ( ) const

Returns the module which had a lifecycle change. If this is a null event (default-constructed), returns nullptr.

Returns
The module that had a change occur in its lifecycle, or nullptr for null events.

◆ GetType()

Type us::ModuleEvent::GetType ( ) const

Returns the type of lifecycle event.

Exceptions
std::logic_errorIf this ModuleEvent is null (default-constructed).

The type values are:

Returns
The type of lifecycle event.

◆ IsNull()

bool us::ModuleEvent::IsNull ( ) const

Can be used to check if this ModuleEvent instance is valid, or if it has been constructed using the default constructor.

Returns
true if this event object is valid, false otherwise.

◆ operator=()

ModuleEvent& us::ModuleEvent::operator= ( const ModuleEvent &  other)

Copy assignment operator.

Parameters
[in]otherThe ModuleEvent to assign from.
Returns
A reference to this object.

The documentation for this class was generated from the following file: