Public Types | Public Member Functions | Protected Types | Protected Member Functions | Private Attributes | List of all members
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 40 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 43 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 46 of file MainCollectionProxy.h.

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

This type.

Definition at line 63 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 49 of file MainCollectionProxy.h.

49 : 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 72 of file MainCollectionProxy.h.

73  { 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 52 of file MainCollectionProxy.h.

52 { 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 66 of file MainCollectionProxy.h.

66 { 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 69 of file MainCollectionProxy.h.

69 { 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 58 of file MainCollectionProxy.h.

58 { 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 55 of file MainCollectionProxy.h.

55 { return *fMain; }

Member Data Documentation

template<typename MainColl >
main_collection_t const* proxy::details::MainCollectionProxy< MainColl >::fMain
private

Definition at line 76 of file MainCollectionProxy.h.


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