13 #ifndef mitkIPropertyTransience_h
14 #define mitkIPropertyTransience_h
23 #include <type_traits>
54 template <
class TData,
typename = std::enable_if_t<std::is_base_of_v<BaseData, TData>>>
57 if constexpr (std::is_same_v<TData, BaseData>)
61 this->InternalAddTransient(propertyName, [](
const BaseData *) {
return true; });
65 this->InternalAddTransient(propertyName,
66 [](
const BaseData *data) {
return dynamic_cast<const TData *
>(data) !=
nullptr; });
90 std::function<
bool(
const BaseData *)> dataTypeMatcher) = 0;
Base class of all data objects.
Interface of the property transience service.
void AddTransient(const std::string &propertyName)
Declare a property transient for nodes whose data is-a TData.
virtual bool IsTransient(const BaseData *data, const std::string &propertyName) const =0
Check whether a property is transient for the given node data.
virtual void InternalAddTransient(const std::string &propertyName, std::function< bool(const BaseData *)> dataTypeMatcher)=0
Register a transient property with a data-type matcher.
virtual ~IPropertyTransience()
Provides the MITK_DECLARE_SERVICE_INTERFACE macro for registering C++ interfaces with both the CppMic...
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
Declare a C++ interface for use with CppMicroServices (Qt not available).
Find image slices visible on a given plane.