ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::BoundFactory< BoundsType_t > Class Template Reference

Factory helper class to construct volume or surface bounds where the constructed bounds are cached inside the factory and if the same bound parameters are requested at a later stage the factory automatically returns the cached bounds. More...

#include <Acts/Utilities/BoundFactory.hpp>

Inheritance diagram for Acts::BoundFactory< BoundsType_t >:
[legend]

Public Types

template<typename T>
using BoundsRet_t
 Abbreviation of the class return type.

Public Member Functions

 BoundFactory ()=default
 Empty default constructor.
 BoundFactory (const BoundFactory &other)=delete
 Delete the copy constructor.
template<typename BoundsImpl_t>
requires (std::is_base_of_v<BoundsType_t, BoundsImpl_t>)
std::shared_ptr< BoundsRet_t< BoundsImpl_t > > insert (const std::shared_ptr< BoundsImpl_t > &bounds)
 Pass externally constructed bounds to the factory and run the deduplication mechanism on them.
template<typename BoundsImpl_t, class... argList>
requires (std::is_base_of_v<BoundsType_t, BoundsImpl_t>)
std::shared_ptr< BoundsRet_t< BoundsImpl_t > > makeBounds (argList... args)
 Factory method to construct new bounds from the passed arguments.
BoundFactoryoperator= (const BoundFactory &other)=delete
 Delete copy assignment.
std::size_t size () const
 Returns the number of cached objects inside the bound factory.

Detailed Description

template<detail::ComparableBoundConcept BoundsType_t>
class Acts::BoundFactory< BoundsType_t >

Factory helper class to construct volume or surface bounds where the constructed bounds are cached inside the factory and if the same bound parameters are requested at a later stage the factory automatically returns the cached bounds.

This provides a simple sharing mechanism of the same bounds across multiple surfaces / volumes

Member Typedef Documentation

◆ BoundsRet_t

template<detail::ComparableBoundConcept BoundsType_t>
template<typename T>
using Acts::BoundFactory< BoundsType_t >::BoundsRet_t
Initial value:
std::conditional_t<std::is_const_v<BoundsType_t>, const T, T>

Abbreviation of the class return type.

If the set is over const objects, the return type is const as well and non-const otherwise

Constructor & Destructor Documentation

◆ BoundFactory() [1/2]

template<detail::ComparableBoundConcept BoundsType_t>
Acts::BoundFactory< BoundsType_t >::BoundFactory ( )
default

Empty default constructor.

◆ BoundFactory() [2/2]

template<detail::ComparableBoundConcept BoundsType_t>
Acts::BoundFactory< BoundsType_t >::BoundFactory ( const BoundFactory< BoundsType_t > & other)
delete

Delete the copy constructor.

Member Function Documentation

◆ insert()

template<detail::ComparableBoundConcept BoundsType_t>
template<typename BoundsImpl_t>
requires (std::is_base_of_v<BoundsType_t, BoundsImpl_t>)
std::shared_ptr< BoundsRet_t< BoundsImpl_t > > Acts::BoundFactory< BoundsType_t >::insert ( const std::shared_ptr< BoundsImpl_t > & bounds)

Pass externally constructed bounds to the factory and run the deduplication mechanism on them.

Template Parameters
BoundsImpl_tTemplate specification of the bounds to deduplicate
Parameters
boundsPointer to the bounds to deduplicated
Returns
Pointer to an equivalent bound object

◆ makeBounds()

template<detail::ComparableBoundConcept BoundsType_t>
template<typename BoundsImpl_t, class... argList>
requires (std::is_base_of_v<BoundsType_t, BoundsImpl_t>)
std::shared_ptr< BoundsRet_t< BoundsImpl_t > > Acts::BoundFactory< BoundsType_t >::makeBounds ( argList... args)

Factory method to construct new bounds from the passed arguments.

Template Parameters
BoundsImpl_tExplicit template specification of the bounds to construct
Parameters
argsList of defining bound parameters
Returns
A pointer to the newly constructed bounds or to an already existing equivalent bound object

◆ operator=()

template<detail::ComparableBoundConcept BoundsType_t>
BoundFactory & Acts::BoundFactory< BoundsType_t >::operator= ( const BoundFactory< BoundsType_t > & other)
delete

Delete copy assignment.

◆ size()

template<detail::ComparableBoundConcept BoundsType_t>
std::size_t Acts::BoundFactory< BoundsType_t >::size ( ) const

Returns the number of cached objects inside the bound factory.

Returns
Number of cached bounds objects in the factory