CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Member Functions | List of all members
ctkEvent Class Reference

#include <Libs/PluginFramework/service/event/ctkEvent.h>

Inheritance diagram for ctkEvent:
Inheritance graph
[legend]

Public Member Functions

bool containsProperty (const QString &name) const
 
 ctkEvent ()
 
 ctkEvent (const ctkEvent &event)
 
 ctkEvent (const QString &topic, const ctkDictionary &properties=ctkDictionary())
 
QVariant getProperty (const QString &name) const
 
QStringList getPropertyNames () const
 
const QString & getTopic () const
 
bool isNull () const
 
bool matches (const ctkLDAPSearchFilter &filter) const
 
ctkEventoperator= (const ctkEvent &other)
 
bool operator== (const ctkEvent &other) const
 
 ~ctkEvent ()
 

Detailed Description

A CTK event.

ctkEvent objects are delivered to ctkEventHandler or Qt slots which subscribe to the topic of the event.

Definition at line 44 of file ctkEvent.h.

Constructor & Destructor Documentation

◆ ctkEvent() [1/3]

ctkEvent::ctkEvent ( )

Default constructor for use with the Qt meta object system.

◆ ~ctkEvent()

ctkEvent::~ctkEvent ( )

◆ ctkEvent() [2/3]

ctkEvent::ctkEvent ( const QString &  topic,
const ctkDictionary properties = ctkDictionary() 
)

Constructs an event.

Parameters
topicThe topic of the event.
propertiesThe event's properties (may be empty).
Exceptions
ctkInvalidArgumentExceptionIf topic is not a valid topic name.

◆ ctkEvent() [3/3]

ctkEvent::ctkEvent ( const ctkEvent event)

Member Function Documentation

◆ containsProperty()

bool ctkEvent::containsProperty ( const QString &  name) const

Indicate the presence of an event property. The event topic is present using the property name "event.topics".

Parameters
nameThe name of the property.
Returns
true if a property with the specified name is in the event. This property may have an invalid QVariant value. false otherwise.

◆ getProperty()

QVariant ctkEvent::getProperty ( const QString &  name) const

Retrieve the value of an event property. The event topic may be retrieved with the property name "event.topics".

Parameters
namethe name of the property to retrieve
Returns
The value of the property, or an invalid QVariant if not found.

◆ getPropertyNames()

QStringList ctkEvent::getPropertyNames ( ) const

Returns a list of this event's property names. The list will include the event topic property name "event.topics".

Returns
A non-empty list with one element per property.

◆ getTopic()

const QString& ctkEvent::getTopic ( ) const

Returns the topic of this event.

Returns
The topic of this event.

◆ isNull()

bool ctkEvent::isNull ( ) const

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

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

◆ matches()

bool ctkEvent::matches ( const ctkLDAPSearchFilter filter) const

Tests this event's properties against the given filter using a case sensitive match.

Parameters
filterThe filter to test.
Returns
true If this event's properties match the filter, false otherwise.

◆ operator=()

ctkEvent& ctkEvent::operator= ( const ctkEvent other)

◆ operator==()

bool ctkEvent::operator== ( const ctkEvent other) const

Compares this ctkEvent object to another object.

An event is considered to be equal to another event if the topic is equal and the properties are equal.

Parameters
otherThe ctkEvent object to be compared.
Returns
true if other is equal to this object; false otherwise.

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