ATLAS Offline Software
Loading...
Searching...
No Matches
LArVectorProxy Class Reference

Proxy for accessing a range of float values like a vector. More...

#include <LArVectorProxy.h>

Inheritance diagram for LArVectorProxy:
Collaboration diagram for LArVectorProxy:

Public Member Functions

 LArVectorProxy ()
 Default constructor.
 LArVectorProxy (const std::vector< value_type > &vec)
 Construct a proxy referencing an existing vector.
 LArVectorProxy (const value_type *beg, const value_type *end)
 Construct a proxy referencing a range of vectors in memory.
bool valid () const
 Test to see if the proxy has been initialized.
value_type at (size_t i) const
 Vector indexing with bounds check.
std::vector< value_typeasVector () const
 Convert back to a vector.

Public Attributes

elements
 STL member.

Detailed Description

Proxy for accessing a range of float values like a vector.

For the shape and OFC conditions data, the data for many channels is flattened into a single vector. But we still want to provide a vector-like interface for the data for an individual channel.

We can do that with this proxy object, based on std::span. On top of std::span's interface, we implement methods that are used by existing clients.

Definition at line 37 of file LArVectorProxy.h.

Constructor & Destructor Documentation

◆ LArVectorProxy() [1/3]

LArVectorProxy::LArVectorProxy ( )

Default constructor.

Creates the proxy in an invalid state.

◆ LArVectorProxy() [2/3]

LArVectorProxy::LArVectorProxy ( const std::vector< value_type > & vec)

Construct a proxy referencing an existing vector.

Parameters
vecThe existing vector to reference.

◆ LArVectorProxy() [3/3]

LArVectorProxy::LArVectorProxy ( const value_type * beg,
const value_type * end )

Construct a proxy referencing a range of vectors in memory.

Parameters
begPointer to the start of the range.
endPointer to the (exclusive) end of the range.

Member Function Documentation

◆ asVector()

std::vector< value_type > LArVectorProxy::asVector ( ) const

Convert back to a vector.

◆ at()

value_type LArVectorProxy::at ( size_t i) const

Vector indexing with bounds check.

◆ valid()

bool LArVectorProxy::valid ( ) const

Test to see if the proxy has been initialized.

Member Data Documentation

◆ elements

T std::span< T >::elements
inherited

STL member.


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