Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::XnatSessionTracker Class Reference

Tracks ctkXnatSession services in the CppMicroServices registry and emits signals when sessions are opened or about to be closed. More...

#include <mitkXnatSessionTracker.h>

Inheritance diagram for mitk::XnatSessionTracker:
Collaboration diagram for mitk::XnatSessionTracker:

Signals

void Opened (ctkXnatSession *session)
 Emitted when a tracked XNAT session has been opened. More...
 
void AboutToBeClosed (ctkXnatSession *session)
 Emitted when a tracked XNAT session is about to be closed. More...
 

Public Member Functions

 XnatSessionTracker (us::ModuleContext *context)
 Construct a session tracker for the given module context. More...
 
- Public Member Functions inherited from us::ServiceTracker< ctkXnatSession >
 ~ServiceTracker () override
 Destructor. More...
 
 ServiceTracker (ModuleContext *context, const ServiceReferenceType &reference, ServiceTrackerCustomizer< ctkXnatSession, T > *customizer=nullptr)
 Create a ServiceTracker on the specified ServiceReference. More...
 
 ServiceTracker (ModuleContext *context, const std::string &clazz, ServiceTrackerCustomizer< ctkXnatSession, T > *customizer=0)
 Create a ServiceTracker on the specified class name. More...
 
 ServiceTracker (ModuleContext *context, const LDAPFilter &filter, ServiceTrackerCustomizer< ctkXnatSession, T > *customizer=nullptr)
 Create a ServiceTracker on the specified LDAPFilter object. More...
 
 ServiceTracker (ModuleContext *context, ServiceTrackerCustomizer< ctkXnatSession, T > *customizer=nullptr)
 Create a ServiceTracker on the class template argument S. More...
 
virtual void Open ()
 Open this ServiceTracker and begin tracking services. More...
 
virtual void Close ()
 Close this ServiceTracker. More...
 
virtual T WaitForService (unsigned long timeoutMillis=0)
 Wait for at least one service to be tracked by this ServiceTracker. This method will also return when this ServiceTracker is closed. More...
 
virtual std::vector< ServiceReferenceType > GetServiceReferences () const
 Return a list of ServiceReferences for all services being tracked by this ServiceTracker. More...
 
virtual ServiceReferenceType GetServiceReference () const
 Returns a ServiceReference for one of the services being tracked by this ServiceTracker. More...
 
virtual T GetService (const ServiceReferenceType &reference) const
 Returns the service object for the specified ServiceReference if the specified referenced service is being tracked by this ServiceTracker. More...
 
virtual T GetService () const
 Returns a service object for one of the services being tracked by this ServiceTracker. More...
 
virtual std::vector< T > GetServices () const
 Return a list of service objects for all services being tracked by this ServiceTracker. More...
 
virtual void Remove (const ServiceReferenceType &reference)
 Remove a service from this ServiceTracker. More...
 
virtual int Size () const
 Return the number of services being tracked by this ServiceTracker. More...
 
virtual int GetTrackingCount () const
 Returns the tracking count for this ServiceTracker. More...
 
virtual void GetTracked (TrackingMap &tracked) const
 Return a sorted map of the ServiceReferences and service objects for all services being tracked by this ServiceTracker. The map is sorted in natural order of ServiceReference. That is, the last entry is the service with the highest ranking and the lowest service id. More...
 
virtual bool IsEmpty () const
 Return if this ServiceTracker is empty. More...
 

Additional Inherited Members

- Public Types inherited from us::ServiceTracker< ctkXnatSession >
typedef ctkXnatSession ServiceType
 The type of the service being tracked. More...
 
typedef TTT::TrackedType T
 The type of the tracked object. More...
 
typedef ServiceReference< ctkXnatSession > ServiceReferenceType
 The service reference type. More...
 
typedef std::map< ServiceReference< ctkXnatSession >, T > TrackingMap
 A map type from ServiceReference to tracked objects. More...
 
- Protected Types inherited from us::ServiceTrackerCustomizer< S, T >
typedef S ServiceType
 The service type being tracked. More...
 
typedef T TrackedType
 The tracked object type. More...
 
typedef ServiceReference< ServiceType > ServiceReferenceType
 The service reference type for the tracked service. More...
 
- Protected Member Functions inherited from us::ServiceTracker< ctkXnatSession >
T AddingService (const ServiceReferenceType &reference) override
 Default implementation of the ServiceTrackerCustomizer::AddingService method. More...
 
void ModifiedService (const ServiceReferenceType &reference, T service) override
 Default implementation of the ServiceTrackerCustomizer::ModifiedService method. More...
 
void RemovedService (const ServiceReferenceType &reference, T service) override
 Default implementation of the ServiceTrackerCustomizer::RemovedService method. More...
 
- Protected Member Functions inherited from us::ServiceTrackerCustomizer< S, T >
virtual ~ServiceTrackerCustomizer ()
 Destructor. More...
 
virtual void ModifiedService (const ServiceReferenceType &reference, TrackedType service)=0
 A service tracked by the ServiceTracker has been modified. More...
 
virtual void RemovedService (const ServiceReferenceType &reference, TrackedType service)=0
 A service tracked by the ServiceTracker has been removed. More...
 

Detailed Description

Tracks ctkXnatSession services in the CppMicroServices registry and emits signals when sessions are opened or about to be closed.

XnatSessionTracker monitors the CppMicroServices service registry for ctkXnatSession instances. When a session service is registered, the tracker connects to its opened and aboutToBeClosed signals and re-emits corresponding Qt signals. This allows plugins and modules to react to XNAT session lifecycle events without directly depending on the service registry.

See also
mitk::XnatSession, ctkXnatSession, us::ServiceTracker

Definition at line 36 of file mitkXnatSessionTracker.h.

Constructor & Destructor Documentation

◆ XnatSessionTracker()

mitk::XnatSessionTracker::XnatSessionTracker ( us::ModuleContext *  context)

Construct a session tracker for the given module context.

Parameters
[in]contextThe CppMicroServices module context used to track ctkXnatSession services.

Member Function Documentation

◆ AboutToBeClosed

void mitk::XnatSessionTracker::AboutToBeClosed ( ctkXnatSession *  session)
signal

Emitted when a tracked XNAT session is about to be closed.

Parameters
[in]sessionPointer to the ctkXnatSession that is about to close.

◆ Opened

void mitk::XnatSessionTracker::Opened ( ctkXnatSession *  session)
signal

Emitted when a tracked XNAT session has been opened.

Parameters
[in]sessionPointer to the ctkXnatSession that was opened.

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