Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <usModule.h>
Public Member Functions | |
~Module () | |
bool | IsLoaded () const |
ModuleContext * | GetModuleContext () const |
long | GetModuleId () const |
std::string | GetLocation () const |
std::string | GetName () const |
ModuleVersion | GetVersion () const |
Any | GetProperty (const std::string &key) const |
std::vector< std::string > | GetPropertyKeys () const |
std::vector< ServiceReferenceU > | GetRegisteredServices () const |
std::vector< ServiceReferenceU > | GetServicesInUse () const |
ModuleResource | GetResource (const std::string &path) const |
std::vector< ModuleResource > | FindResources (const std::string &path, const std::string &filePattern, bool recurse) const |
Static Public Member Functions | |
static const std::string & | PROP_ID () |
static const std::string & | PROP_NAME () |
static const std::string & | PROP_LOCATION () |
static const std::string & | PROP_VERSION () |
static const std::string & | PROP_VENDOR () |
static const std::string & | PROP_DESCRIPTION () |
static const std::string & | PROP_AUTOLOAD_DIR () |
static const std::string & | PROP_AUTOLOADED_MODULES () |
Represents a CppMicroServices module.
A Module
object is the access point to a CppMicroServices module. Each CppMicroServices module has an associated Module
object.
A module has unique identity, a long
, chosen by the framework. This identity does not change during the lifecycle of a module.
A module can be in one of two states:
You can determine the current state by using IsLoaded().
A module can only execute code when its state is LOADED
. An UNLOADED
module is a zombie and can only be reached because it was loaded before. However, unloaded modules can be loaded again.
The framework is the only entity that is allowed to create Module
objects.
Definition at line 78 of file usModule.h.
us::Module::~Module | ( | ) |
Definition at line 87 of file usModule.cpp.
std::vector< ModuleResource > us::Module::FindResources | ( | const std::string & | path, |
const std::string & | filePattern, | ||
bool | recurse | ||
) | const |
Returns resources in this module.
This method is intended to be used to obtain configuration, setup, localization and other information from this module.
This method can either return only resources in the specified path
or recurse into subdirectories returning resources in the directory tree beginning at the specified path.
Examples:
path | The path name in which to look. The path is always relative to the root of this module and may begin with '/'. A path value of "/" indicates the root of this module. |
filePattern | The resource name pattern for selecting entries in the specified path. The pattern is only matched against the last element of the resource path. Substring matching is supported using the wildcard charachter ('*'). If filePattern is empty, this is equivalent to "*" and matches all resources. |
recurse | If true , recurse into subdirectories. Otherwise only return resources from the specified path. |
Definition at line 278 of file usModule.cpp.
std::string us::Module::GetLocation | ( | ) | const |
Returns this module's location.
The location is the full path to the module's shared library. This method continues to return this module's location while this module is in the UNLOADED
state.
Definition at line 216 of file usModule.cpp.
Referenced by QmitkModuleTableModel::data(), and us::operator<<().
ModuleContext * us::Module::GetModuleContext | ( | ) | const |
Returns this module's ModuleContext. The returned ModuleContext
can be used by the caller to act on behalf of this module.
If this module is not in the LOADED
state, then this module has no valid ModuleContext
. This method will return 0
if this module has no valid ModuleContext
.
ModuleContext
for this module or 0
if this module has no valid ModuleContext
. Definition at line 206 of file usModule.cpp.
Referenced by mitk::BindDispatcherInteractor::BindDispatcherInteractor(), us::GetModuleContext(), and QmitkFreeSurferParcellationHandler::QmitkFreeSurferParcellationHandler().
long us::Module::GetModuleId | ( | ) | const |
Returns this module's unique identifier. This module is assigned a unique identifier by the framework when it was loaded.
A module's unique identifier has the following attributes:
long
. This method continues to return this module's unique identifier while this module is in the UNLOADED
state.
Definition at line 211 of file usModule.cpp.
Referenced by QmitkModuleTableModel::data(), us::operator<<(), and us::ModuleRegistry::Register().
std::string us::Module::GetName | ( | ) | const |
Returns the name of this module as specified by the US_CREATE_MODULE CMake macro. The module name together with a version must identify a unique module.
This method continues to return this module's name while this module is in the UNLOADED
state.
Definition at line 221 of file usModule.cpp.
Referenced by mitk::EventConfig::AddConfig(), QmitkModuleTableModel::data(), mitk::EventConfig::EventConfig(), and mitk::XML2EventParser::XML2EventParser().
Any us::Module::GetProperty | ( | const std::string & | key | ) | const |
Returns the value of the specified property for this module. The method returns an empty Any if the property is not found.
key | The name of the requested property. |
Definition at line 231 of file usModule.cpp.
std::vector< std::string > us::Module::GetPropertyKeys | ( | ) | const |
Returns a list of top-level property keys for this module.
Definition at line 236 of file usModule.cpp.
std::vector< ServiceReferenceU > us::Module::GetRegisteredServices | ( | ) | const |
Returns this module's ServiceReference list for all services it has registered or an empty list if this module has no registered services.
The list is valid at the time of the call to this method, however, as the framework is a very dynamic environment, services can be modified or unregistered at anytime.
Definition at line 241 of file usModule.cpp.
ModuleResource us::Module::GetResource | ( | const std::string & | path | ) | const |
Returns the resource at the specified path
in this module. The specified path
is always relative to the root of this module and may begin with '/'. A path value of "/" indicates the root of this module.
path | The path name of the resource. |
path
. If the path
cannot be found in this module or the module's state is UNLOADED
, an invalid ModuleResource object is returned. Definition at line 267 of file usModule.cpp.
Referenced by mitk::EventConfig::AddConfig(), mitk::EventConfig::EventConfig(), mitk::TrackingVolumeGenerator::GenerateData(), mitk::FillRegionTool::GetCursorIconResource(), mitk::EraseRegionTool::GetCursorIconResource(), mitk::DrawPaintbrushTool::GetCursorIconResource(), mitk::ErasePaintbrushTool::GetCursorIconResource(), mitk::AddContourTool::GetCursorIconResource(), mitk::SubtractContourTool::GetCursorIconResource(), mitk::CorrectorTool2D::GetCursorIconResource(), mitk::RegionGrowingTool::GetCursorIconResource(), mitk::FastMarchingTool::GetCursorIconResource(), mitk::OtsuTool3D::GetIconResource(), mitk::FillRegionTool::GetIconResource(), mitk::BinaryThresholdTool::GetIconResource(), mitk::EraseRegionTool::GetIconResource(), mitk::BinaryThresholdULTool::GetIconResource(), mitk::DrawPaintbrushTool::GetIconResource(), mitk::ErasePaintbrushTool::GetIconResource(), mitk::PickingTool::GetIconResource(), mitk::AddContourTool::GetIconResource(), mitk::SubtractContourTool::GetIconResource(), mitk::CorrectorTool2D::GetIconResource(), mitk::RegionGrowingTool::GetIconResource(), mitk::AdaptiveRegionGrowingTool::GetIconResource(), mitk::WatershedTool::GetIconResource(), mitk::FastMarchingTool3D::GetIconResource(), mitk::FastMarchingTool::GetIconResource(), mitk::AbstractToFDeviceFactory::GetIntrinsicsResource(), mitk::StateMachineContainer::LoadBehavior(), SphereInterpolator::LoadLookuptables(), and mitk::XML2EventParser::XML2EventParser().
std::vector< ServiceReferenceU > us::Module::GetServicesInUse | ( | ) | const |
Returns this module's ServiceReference list for all services it is using or returns an empty list if this module is not using any services. A module is considered to be using a service if its use count for that service is greater than zero.
The list is valid at the time of the call to this method, however, as the framework is a very dynamic environment, services can be modified or unregistered at anytime.
Definition at line 254 of file usModule.cpp.
ModuleVersion us::Module::GetVersion | ( | ) | const |
Returns the version of this module as specified by the US_INITIALIZE_MODULE CMake macro. If this module does not have a specified version then ModuleVersion::EmptyVersion is returned.
This method continues to return this module's version while this module is in the UNLOADED
state.
Definition at line 226 of file usModule.cpp.
Referenced by QmitkModuleTableModel::data().
bool us::Module::IsLoaded | ( | ) | const |
Returns this module's current state.
A module can be in only one state at any time.
true
if the module is LOADED
false
if it is UNLOADED
Definition at line 114 of file usModule.cpp.
Referenced by QmitkModuleTableModel::data().
|
static |
Returns the property key with a value of module.autoload_dir
for looking up this module's auto-load directory. The property value is of type std::string
.
Definition at line 69 of file usModule.cpp.
|
static |
Returns the property key with a value of module.autoloaded_modules
for looking up this module's auto-load modules. The property value is of type std::vector<std::string>
and contains the file system locations for the auto-loaded modules triggered by this module.
Definition at line 75 of file usModule.cpp.
|
static |
Returns the property key with a value of module.description
for looking up this module's description. The property value is of type std::string
.
Definition at line 63 of file usModule.cpp.
|
static |
Returns the property key for looking up this module's id. The property value is of type long
.
Definition at line 36 of file usModule.cpp.
|
static |
Returns the property key for looking up this module's location in the file system. The property value is of type std::string
.
Definition at line 46 of file usModule.cpp.
|
static |
Returns the property key for looking up this module's name. The property value is of type std::string
.
Definition at line 41 of file usModule.cpp.
|
static |
Returns the property key with a value of module.vendor
for looking up this module's vendor information. The property value is of type std::string
.
Definition at line 57 of file usModule.cpp.
|
static |
Returns the property key with a value of module.version
for looking up this module's version identifier. The property value is of type std::string
.
Definition at line 51 of file usModule.cpp.