LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
proxy::details::MainCollectionProxy< MainColl > Struct Template Reference

Wrapper for the main collection of a proxy. More...

#include "MainCollectionProxy.h"

Inheritance diagram for proxy::details::MainCollectionProxy< MainColl >:
proxy::CollectionProxyBase< SpacePointWithCharge, MainColl, AuxColl... > proxy::CollectionProxyBase< Element, MainColl, AuxColls > proxy::ChargedSpacePointsCollectionProxy< MainColl, AuxColl >

Public Types

using main_collection_t = MainColl
 Type of the original collection. More...
 
using main_element_t = util::collection_value_t< MainColl >
 Type of the elements in the original collection. More...
 

Public Member Functions

 MainCollectionProxy (main_collection_t const &main)
 Constructor: wraps the specified collection. More...
 
main_collection_t const & main () const
 Returns the wrapped collection. More...
 
main_collection_t const & mainRef () const
 Returns a reference to the wrapped collection. More...
 
main_collection_t const * mainPtr () const
 Returns a pointer to the wrapped collection. More...
 

Protected Types

using this_t = MainCollectionProxy< main_collection_t >
 This type. More...
 

Protected Member Functions

this_tmainProxy ()
 Return this object as main collection proxy. More...
 
this_t const & mainProxy () const
 Return this object as main collection proxy. More...
 
auto getMainAt (std::size_t i) const -> decltype(auto)
 Returns the specified item in the original collection. More...
 

Private Attributes

main_collection_t const * fMain
 

Detailed Description

template<typename MainColl>
struct proxy::details::MainCollectionProxy< MainColl >

Wrapper for the main collection of a proxy.

Template Parameters
MainColltype of the collection being wrapped

The wrapper contains a pointer to the original collection, which must persist. The original collection is not modified.

The MainColl type must expose a random access container interface.

Definition at line 38 of file MainCollectionProxy.h.

Member Typedef Documentation

template<typename MainColl >
using proxy::details::MainCollectionProxy< MainColl >::main_collection_t = MainColl

Type of the original collection.

Definition at line 41 of file MainCollectionProxy.h.

template<typename MainColl >
using proxy::details::MainCollectionProxy< MainColl >::main_element_t = util::collection_value_t<MainColl>

Type of the elements in the original collection.

Definition at line 44 of file MainCollectionProxy.h.

template<typename MainColl >
using proxy::details::MainCollectionProxy< MainColl >::this_t = MainCollectionProxy<main_collection_t>
protected

This type.

Definition at line 60 of file MainCollectionProxy.h.

Constructor & Destructor Documentation

template<typename MainColl >
proxy::details::MainCollectionProxy< MainColl >::MainCollectionProxy ( main_collection_t const &  main)
inline

Constructor: wraps the specified collection.

Definition at line 47 of file MainCollectionProxy.h.

47 : fMain(&main) {}
main_collection_t const & main() const
Returns the wrapped collection.

Member Function Documentation

template<typename MainColl >
auto proxy::details::MainCollectionProxy< MainColl >::getMainAt ( std::size_t  i) const -> decltype(auto)
inlineprotected

Returns the specified item in the original collection.

Definition at line 69 of file MainCollectionProxy.h.

References proxy::details::MainCollectionProxy< MainColl >::fMain.

69 { return fMain->operator[](i); }
template<typename MainColl >
main_collection_t const& proxy::details::MainCollectionProxy< MainColl >::main ( ) const
inline

Returns the wrapped collection.

Definition at line 50 of file MainCollectionProxy.h.

References proxy::details::MainCollectionProxy< MainColl >::mainRef().

50 { return mainRef(); }
main_collection_t const & mainRef() const
Returns a reference to the wrapped collection.
template<typename MainColl >
this_t& proxy::details::MainCollectionProxy< MainColl >::mainProxy ( )
inlineprotected

Return this object as main collection proxy.

Definition at line 63 of file MainCollectionProxy.h.

63 { return *this; }
template<typename MainColl >
this_t const& proxy::details::MainCollectionProxy< MainColl >::mainProxy ( ) const
inlineprotected

Return this object as main collection proxy.

Definition at line 66 of file MainCollectionProxy.h.

66 { return *this; }
template<typename MainColl >
main_collection_t const* proxy::details::MainCollectionProxy< MainColl >::mainPtr ( ) const
inline

Returns a pointer to the wrapped collection.

Definition at line 56 of file MainCollectionProxy.h.

References proxy::details::MainCollectionProxy< MainColl >::fMain.

56 { return fMain; }
template<typename MainColl >
main_collection_t const& proxy::details::MainCollectionProxy< MainColl >::mainRef ( ) const
inline

Returns a reference to the wrapped collection.

Definition at line 53 of file MainCollectionProxy.h.

References proxy::details::MainCollectionProxy< MainColl >::fMain.

Referenced by proxy::details::MainCollectionProxy< MainColl >::main().

53 { return *fMain; }

Member Data Documentation


The documentation for this struct was generated from the following file: