11 #ifndef LARSIM_PHOTONPROPAGATION_LIBRARYMAPPINGTOOLS_OPDETVISIBILITYDATA_H 12 #define LARSIM_PHOTONPROPAGATION_LIBRARYMAPPINGTOOLS_OPDETVISIBILITYDATA_H 20 #include <type_traits> 59 template <
typename Cont,
typename Enable =
void>
73 template <
typename Cont>
119 template <
typename Cont,
typename Mapping>
243 template <
typename Cont>
254 template <
typename Cont,
typename =
void>
257 template <
typename Cont>
259 <Cont,
std::enable_if_t<util::always_true_v<decltype(
260 generic_size(std::declval<Cont>())
269 template <
typename Cont,
typename =
void>
274 template <
typename Cont>
276 <Cont,
std::enable_if_t<util::always_true_v<decltype(
277 std::declval<Cont const>().empty()
281 static bool isValid(Cont
const& cont) {
return !cont.empty(); }
286 template <
typename Cont,
typename =
void>
291 template <
typename Cont>
293 <Cont,
std::enable_if_t<util::always_true_v<decltype(
294 std::declval<Cont const>().is_valid()
298 static bool isValid(Cont
const& cont) {
return cont.is_valid(); }
303 template <
typename Cont,
typename =
void>
308 template <
typename Cont>
310 <Cont,
std::enable_if_t<util::always_true_v<decltype(
311 std::declval<Cont const>().isValid()
315 static bool isValid(Cont
const& cont) {
return cont.isValid(); }
320 template <
typename Cont,
typename =
void>
325 template <
typename Cont>
327 <Cont,
std::enable_if_t<util::is_unique_ptr_v<Cont>>>
334 template <
typename T>
338 template <
typename T>
343 template <
typename T>
348 template <
typename T, std::
size_t N>
353 template <
typename Cont,
typename =
void>
358 template <
typename Cont>
360 <Cont,
std::enable_if_t<std::is_pointer_v<std::decay_t<Cont>>>>
367 template <
typename Cont>
380 template <
typename Cont,
typename >
383 <std::remove_reference_t<Cont>>
388 template <
typename Cont>
396 template <
typename Cont,
typename Mapping>
402 template <
typename Cont,
typename Mapping>
418 #endif // LARSIM_PHOTONPROPAGATION_LIBRARYMAPPINGTOOLS_OPDETVISIBILITYDATA_H
Provides MappedContainer class.
auto generic_size(Cont &&cont)
static bool isValid(Cont const &cont)
A meta-container providing transparent mapping on top of another.
Mapping Mapping_t
Type of the mapping object.
size_type minimal_size() const
Returns the minimum size to include all mapped values.
static bool isValid(T *ptr)
OpDetVisibilityData(DataContainer_t const &cont, Mapping_t const &mapping)
Constructor: acquires data and mapping.
size_type size() const
Returns the nominal size of the container (after mapping).
OpDetVisibilityData(DataContainer_t const &cont, Mapping_t const &mapping, size_type size, value_type defValue)
Constructor: acquires data, mapping and a default value.
static bool isValid(T(&)[N])
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
util::MappedContainer< Cont, Mapping > ContainerBase_t
static bool isValid(Cont const &cont)
static bool isValid(Cont const &cont)
static size_type effectiveSize(DataContainer_t const &cont, size_type allegedSize)
Determines whether the current content should be considered valid.
bool operator!() const
Returns whether the container has no valid data.
Cont DataContainer_t
Type of the original container.
bool isValidLibraryData(Cont &&cont)
Returns the validity of content of library data in the container.
General LArSoft Utilities.
A container for photon visibility mapping data.
bool isValid() const
Returns whether the contained data is valid or not.
bool empty() const
Returns whether the container has no elements.
static bool isValid(Cont const &cont)
OpDetVisibilityData()=default
static bool isValid(Cont const &cont)
Trait for determining the validity of library data in a container.