MeVisLab Toolbox Reference
mlDicomModifyFieldAddOnList.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
5 
10 //----------------------------------------------------------------------------------
11 #pragma once
12 
13 #include "MLDicomModifySystem.h"
14 #include <mlFieldAddOnList.h>
16 
17 ML_START_NAMESPACE
18 
19 //----------------------------------------------------------------------------------
29 //----------------------------------------------------------------------------------
30 template <typename BASE_FIELD_ADD_ON_TYPE, typename PIMPL_OBJ_TYPE=void*>
31 class DicomModifyFieldAddOnList : public FieldAddOnList<BASE_FIELD_ADD_ON_TYPE, PIMPL_OBJ_TYPE>
32 {
33 public:
34 
37 
39  typedef BASE_FIELD_ADD_ON_TYPE SuperBase;
40 
43  FieldAddOnList<SuperBase, PIMPL_OBJ_TYPE>(fieldContainerRef){};
44 
48 
51  std::string applyModifications(DCMTree::TreePtr dcmTree,
52  const FieldContainer *treeInfos=nullptr) override
53  {
54  std::string retStr;
55  auto it = SuperList::getFieldAddOns().begin();
56  for (; it != SuperList::getFieldAddOns().end(); it++){
57  retStr += (*it)->applyModifications(dcmTree, treeInfos);
58  }
59  return retStr;
60  }
61 
63  void inheritValues(DCMTree::Const_TreePtr dcmTree) override
64  {
65  auto it = SuperList::getFieldAddOns().begin();
66  for (; it != SuperList::getFieldAddOns().end(); it++){ (*it)->inheritValues(dcmTree); }
67  }
68 
71  std::string checkConsistency() const override
72  {
73  std::string retStr;
74  auto it = SuperList::getFieldAddOns().begin();
75  for (; it != SuperList::getFieldAddOns().end(); it++){
76  retStr += (*it)->checkConsistency();
77  }
78  return retStr;
79  }
80 
81 };
82 
83 ML_END_NAMESPACE
Project global and OS specific declarations.
Class managing a list of BASE_FIELD_ADD_ON_TYPE to simplify usage of multiple AddOns; AddOns are neve...
DicomModifyFieldAddOnList(FieldContainer &fieldContainerRef)
Constructor, setting the reference of the FieldContainer managing the fields.
BASE_FIELD_ADD_ON_TYPE SuperBase
Type of inherited SuperClass base class.
std::string checkConsistency() const override
Applies DicomModifyFieldAddOnBase::checkConsistency to each instance, and returns the concatenation o...
FieldAddOnList< BASE_FIELD_ADD_ON_TYPE, PIMPL_OBJ_TYPE > SuperList
Type of inherited SuperClass base class.
std::string applyModifications(DCMTree::TreePtr dcmTree, const FieldContainer *treeInfos=nullptr) override
Add functionality of additional methods of DicomModifyFieldAddOnBase; addFields(),...
void inheritValues(DCMTree::Const_TreePtr dcmTree) override
Applies DicomModifyFieldAddOnBase::inheritValues for each instance.
Class managing a list of FieldAddOns to simplify usage of multiple AddOns; AddOns are never owned by ...
Defines the class FieldContainer to encapsulate a vector of fields for (see class Field).
Header file of the DicomModifyFieldAddOnBase class dedicated to manage fields for ML modules and inst...
Header file of a class managing many FieldAddOns to simplify usage of multiple AddOns.
boost::shared_ptr< const Tree > Const_TreePtr
Definition: DCMTree_Lib.h:73
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree
Definition: DCMTree_Lib.h:70