28#ifndef itkMetaDataObject_h
29#define itkMetaDataObject_h
67template <
typename MetaDataObjectType>
80 itkFactorylessNewMacro(
Self);
100 const std::type_info &
108 const MetaDataObjectType &
124 Print(std::ostream & os)
const override;
130 return Self::EqualValues(lhs.m_MetaDataObjectValue, rhs.m_MetaDataObjectValue);
137 return !(lhs == rhs);
147 template <
typename TValue>
149 Assign(TValue & target,
const TValue & source) ->
decltype(target = source)
151 return target = source;
155 template <
typename TValue,
size_t VNumberOfElements>
157 Assign(TValue (&target)[VNumberOfElements],
const TValue (&source)[VNumberOfElements])
159 for (
size_t i = 0; i < VNumberOfElements; ++i)
161 Self::Assign(target[i], source[i]);
169 template <
typename TValue>
171 EqualValues(
const TValue & lhs,
const TValue & rhs) ->
decltype(lhs == rhs)
177 template <
typename TValue,
size_t VNumberOfElements>
179 EqualValues(
const TValue (&lhs)[VNumberOfElements],
const TValue (&rhs)[VNumberOfElements])
181 for (
size_t i = 0; i < VNumberOfElements; ++i)
183 if (!Self::EqualValues(lhs[i], rhs[i]))
197 const auto metaDataObject =
dynamic_cast<const Self *
>(&metaDataObjectBase);
198 return (metaDataObject !=
nullptr) && (*
this == *metaDataObject);
206 MetaDataObjectType m_MetaDataObjectValue{};
221 temp->SetMetaDataObjectValue(invalue);
222 Dictionary[key] = temp;
246 auto keyIter = Dictionary.
Find(key);
247 if (keyIter == Dictionary.
End())
253 auto const *
const TempMetaDataObject =
dynamic_cast<MetaDataObject<T> const *
>(keyIter->second.GetPointer());
254 if (TempMetaDataObject ==
nullptr)
265#ifndef ITK_MANUAL_INSTANTIATION
266# include "itkMetaDataObject.hxx"
272#ifndef ITK_TEMPLATE_EXPLICIT_MetaDataObject
281#if defined(ITKCommon_EXPORTS)
283# define ITKCommon_EXPORT_EXPLICIT ITK_TEMPLATE_EXPORT
286# define ITKCommon_EXPORT_EXPLICIT ITKCommon_EXPORT
291ITK_GCC_PRAGMA_DIAG_PUSH()
292ITK_GCC_PRAGMA_DIAG(ignored
"-Wattributes")
320ITK_GCC_PRAGMA_DIAG_POP()
323#undef ITKCommon_EXPORT_EXPLICIT
Light weight base class for most itk classes.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
void EncapsulateMetaData(MetaDataDictionary &Dictionary, const std::string &key, const T &invalue)
bool ExposeMetaData(const MetaDataDictionary &Dictionary, const std::string key, T &outval)