Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
berryObjectList.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef BERRYOSGIOBJECTLIST_H_
14 #define BERRYOSGIOBJECTLIST_H_
15 
16 #include "berryMacros.h"
17 
18 #include <berryObject.h>
19 
20 #include <QList>
21 
22 namespace berry {
23 
24 template<typename T>
25 class ObjectList : public Object, public QList<T>
26 {
27 public:
29 
30  ObjectList() : QList<T>() {}
31  ObjectList(const QList<T>& l) : QList<T>(l) {}
32 
33  bool operator==(const Object* o) const override
34  {
35  if (const QList<T>* l = dynamic_cast<const QList<T>*>(o))
36  {
37  return QList<T>::operator ==(*l);
38  }
39  return false;
40  }
41 };
42 
43 }
44 
45 #endif /*BERRYOSGIOBJECTLIST_H_*/
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:72
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
#define berryObjectMacro(...)
Definition: berryMacros.h:33
bool operator==(const Object *o) const override