Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
berryObjectList.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef BERRYOSGIOBJECTLIST_H_
18 #define BERRYOSGIOBJECTLIST_H_
19 
20 #include "berryMacros.h"
21 
22 #include <berryObject.h>
23 
24 #include <QList>
25 
26 namespace berry {
27 
28 template<typename T>
29 class ObjectList : public Object, public QList<T>
30 {
31 public:
33 
34  ObjectList() : QList<T>() {}
35  ObjectList(const QList<T>& l) : QList<T>(l) {}
36 
37  bool operator==(const Object* o) const
38  {
39  if (const QList<T>* l = dynamic_cast<const QList<T>*>(o))
40  {
41  return QList<T>::operator ==(*l);
42  }
43  return false;
44  }
45 };
46 
47 }
48 
49 #endif /*BERRYOSGIOBJECTLIST_H_*/
bool operator==(const Object *o) const
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:78
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
#define berryObjectMacro(...)
Definition: berryMacros.h:37