CppMicroServices

C++ Micro Services: ModuleEvent Class Reference
ModuleEvent Class Reference

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

Public Types

enum  Type {
  LOADED, UNLOADED, LOADING, UNLOADING,
  INSTALLED, UNINSTALLED
}
 

Public Member Functions

 ModuleEvent ()
 Creates an invalid instance. More...
 
 ~ModuleEvent ()
 
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)
 
ModuleEventoperator= (const ModuleEvent &other)
 
ModuleGetModule () const
 Returns the module which had a lifecycle change. More...
 
Type GetType () const
 Returns the type of lifecyle 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

Constructor & Destructor Documentation

ModuleEvent::ModuleEvent ( )

Creates an invalid instance.

ModuleEvent::~ModuleEvent ( )
ModuleEvent::ModuleEvent ( Type  type,
Module module 
)

Creates a module event of the specified type.

Parameters
typeThe event type.
moduleThe module which had a lifecycle change.
ModuleEvent::ModuleEvent ( const ModuleEvent other)

Member Function Documentation

Module* ModuleEvent::GetModule ( ) const

Returns the module which had a lifecycle change.

Returns
The module that had a change occur in its lifecycle.
Type ModuleEvent::GetType ( ) const

Returns the type of lifecyle event.

The type values are:

Returns
The type of lifecycle event.
bool 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.
ModuleEvent& ModuleEvent::operator= ( const ModuleEvent other)