OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
WSubject Class Reference

Container for all WDataSets belonging to one subject or patient. More...

#include <WSubject.h>

+ Collaboration diagram for WSubject:

Public Types

enum  { SUBJECT_UNKNOWN = 0 }
 List of some standard subjects. More...
 
typedef std::vector< std::shared_ptr< WDataSet > > DatasetContainerType
 For shortening: a type defining a shared vector of WSubject pointers. More...
 
typedef WSharedSequenceContainer< DatasetContainerTypeDatasetSharedContainerType
 The alias for a shared container. More...
 
typedef DatasetContainerType::iterator DatasetIterator
 The dataset iterator. More...
 
typedef DatasetContainerType::const_iterator DatasetConstIterator
 The dataset const iterator. More...
 

Public Member Functions

 WSubject ()
 Constructs a dummy subject. More...
 
 WSubject (WPersonalInformation personInfo)
 Allows one to give the subject information the person during construction. More...
 
virtual ~WSubject ()
 Destructs the subject. More...
 
std::string getName () const
 Returns the name of the subject. More...
 
WPersonalInformation getPersonalInformation () const
 Gives the personal information of a subject. More...
 
void addDataSet (std::shared_ptr< WDataSet > dataset)
 Insert a new dataset referenced by a pointer. More...
 
void removeDataSet (std::shared_ptr< WDataSet > dataset)
 Removes the specified dataset if it is in the set. More...
 
void clear ()
 Remove all datasets from the subjects. More...
 
DatasetSharedContainerType::ReadTicket getDatasets () const
 Returns read-access to the dataset list. More...
 
DatasetSharedContainerType::WriteTicket getDatasetsForWriting () const
 Returns write-access to the dataset list. More...
 
std::shared_ptr< WConditiongetChangeCondition () const
 This condition fires whenever the list of datasets changes, or one dataset got marked as "dirty" (threshold, opacity, ...). More...
 
std::shared_ptr< WConditiongetListChangeCondition () const
 This condition fires whenever the list of datasets changes. More...
 

Protected Attributes

DatasetSharedContainerType m_datasets
 A container for all WDataSet. More...
 
std::shared_ptr< WConditionSetm_changeCondition
 This condition set fires whenever one dataset gets dirty or the list of datasets changes. More...
 
std::shared_ptr< WConditionSetm_listChangeCondition
 This condition set fires whenever the list of datasets changes. More...
 

Private Attributes

WPersonalInformation m_personalInfo
 Information on the person represented by this WSubject. More...
 

Friends

class WSubjectTest
 Only tests are allowed as friends. More...
 

Detailed Description

Container for all WDataSets belonging to one subject or patient.

Definition at line 45 of file WSubject.h.

Member Typedef Documentation

◆ DatasetConstIterator

typedef DatasetContainerType::const_iterator WSubject::DatasetConstIterator

The dataset const iterator.

Definition at line 79 of file WSubject.h.

◆ DatasetContainerType

typedef std::vector< std::shared_ptr< WDataSet > > WSubject::DatasetContainerType

For shortening: a type defining a shared vector of WSubject pointers.

Definition at line 64 of file WSubject.h.

◆ DatasetIterator

typedef DatasetContainerType::iterator WSubject::DatasetIterator

The dataset iterator.

Definition at line 74 of file WSubject.h.

◆ DatasetSharedContainerType

The alias for a shared container.

Definition at line 69 of file WSubject.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

List of some standard subjects.

This is currently used for the default subject as we do not have any others.

Definition at line 56 of file WSubject.h.

Constructor & Destructor Documentation

◆ WSubject() [1/2]

WSubject::WSubject ( )

Constructs a dummy subject.

Definition at line 34 of file WSubject.cpp.

◆ WSubject() [2/2]

WSubject::WSubject ( WPersonalInformation  personInfo)
explicit

Allows one to give the subject information the person during construction.

Parameters
personInfopersonal information object

Definition at line 42 of file WSubject.cpp.

◆ ~WSubject()

WSubject::~WSubject ( )
virtual

Destructs the subject.

Removes all datasets from the list.

Definition at line 50 of file WSubject.cpp.

References clear().

+ Here is the call graph for this function:

Member Function Documentation

◆ addDataSet()

void WSubject::addDataSet ( std::shared_ptr< WDataSet dataset)

Insert a new dataset referenced by a pointer.

Parameters
dataseta pointer to the dataset that will be added

Definition at line 65 of file WSubject.cpp.

References m_changeCondition, m_datasets, m_listChangeCondition, and WSharedSequenceContainer< S >::push_back().

Referenced by WSubjectTest::testAddGetDataSet(), and WSubjectTest::testGetNumberOfDataSet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear()

void WSubject::clear ( )

Remove all datasets from the subjects.

Definition at line 88 of file WSubject.cpp.

References WSharedObject< T >::getWriteTicket(), m_datasets, and m_listChangeCondition.

Referenced by ~WSubject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getChangeCondition()

std::shared_ptr< WCondition > WSubject::getChangeCondition ( ) const

This condition fires whenever the list of datasets changes, or one dataset got marked as "dirty" (threshold, opacity, ...).

Returns
the condition

Definition at line 109 of file WSubject.cpp.

References m_changeCondition.

◆ getDatasets()

WSubject::DatasetSharedContainerType::ReadTicket WSubject::getDatasets ( ) const

Returns read-access to the dataset list.

As long as the returned ticket exists, the list of datasets can't be changed by others.

Returns
the read ticket.

Definition at line 99 of file WSubject.cpp.

References WSharedObject< T >::getReadTicket(), and m_datasets.

Referenced by WSubjectTest::testAddGetDataSet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDatasetsForWriting()

WSubject::DatasetSharedContainerType::WriteTicket WSubject::getDatasetsForWriting ( ) const

Returns write-access to the dataset list.

As long as the returned ticket exists, the list of datasets can't be changed by others.

Returns
the write ticket.

Definition at line 104 of file WSubject.cpp.

References WSharedObject< T >::getWriteTicket(), and m_datasets.

+ Here is the call graph for this function:

◆ getListChangeCondition()

std::shared_ptr< WCondition > WSubject::getListChangeCondition ( ) const

This condition fires whenever the list of datasets changes.

Returns
the condition

Definition at line 114 of file WSubject.cpp.

References m_listChangeCondition.

◆ getName()

std::string WSubject::getName ( ) const

Returns the name of the subject.

See WPersonalInformation for details on the name.

Returns
the name of the subject extracted from this subject's WPersonalInformation.

Definition at line 55 of file WSubject.cpp.

References WPersonalInformation::getCompleteName(), and m_personalInfo.

Referenced by WSubjectTest::testGetName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPersonalInformation()

WPersonalInformation WSubject::getPersonalInformation ( ) const

Gives the personal information of a subject.

Returns
the personal information of the subject.

Definition at line 60 of file WSubject.cpp.

References m_personalInfo.

◆ removeDataSet()

void WSubject::removeDataSet ( std::shared_ptr< WDataSet dataset)

Removes the specified dataset if it is in the set.

Parameters
datasetthe dataset to remove.

Definition at line 73 of file WSubject.cpp.

References WSharedObject< T >::getWriteTicket(), m_changeCondition, m_datasets, and m_listChangeCondition.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ WSubjectTest

friend class WSubjectTest
friend

Only tests are allowed as friends.

Definition at line 50 of file WSubject.h.

Member Data Documentation

◆ m_changeCondition

std::shared_ptr< WConditionSet > WSubject::m_changeCondition
protected

This condition set fires whenever one dataset gets dirty or the list of datasets changes.

Definition at line 168 of file WSubject.h.

Referenced by addDataSet(), getChangeCondition(), and removeDataSet().

◆ m_datasets

DatasetSharedContainerType WSubject::m_datasets
protected

◆ m_listChangeCondition

std::shared_ptr< WConditionSet > WSubject::m_listChangeCondition
protected

This condition set fires whenever the list of datasets changes.

Definition at line 173 of file WSubject.h.

Referenced by addDataSet(), clear(), getListChangeCondition(), and removeDataSet().

◆ m_personalInfo

WPersonalInformation WSubject::m_personalInfo
private

Information on the person represented by this WSubject.

Definition at line 176 of file WSubject.h.

Referenced by getName(), getPersonalInformation(), and WSubjectTest::TestConstructorWithInfo().


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