BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends
BDSTwoVector< T > Class Template Reference

Simple two vector that's templated so the right type can be used. More...

#include <BDSTwoVector.hh>

Collaboration diagram for BDSTwoVector< T >:
Collaboration graph

Public Member Functions

 BDSTwoVector ()
 Default constructor.
 
 BDSTwoVector (T x, T y)
 Alternate constructor.
 
 BDSTwoVector (const BDSTwoVector &other)
 Copy constructor.
 
BDSTwoVectoroperator= (const BDSTwoVector &rhs)
 Assignment operator.
 
T & operator[] (const G4int index)
 Access / set a single element.
 
const T & operator[] (const G4int index) const
 
const T & x () const
 Accessor by name.
 
const T & y () const
 Accessor by name.
 

Private Attributes

values [2]
 Member data - x,y.
 

Friends

std::ostream & operator<< (std::ostream &out, BDSTwoVector const &v)
 Output stream.
 

Detailed Description

template<typename T>
class BDSTwoVector< T >

Simple two vector that's templated so the right type can be used.

Only the assigment operator is provided, other than that it's simple access and setting only.

Author
Laurie Nevay

Definition at line 37 of file BDSTwoVector.hh.

Constructor & Destructor Documentation

◆ BDSTwoVector() [1/3]

template<typename T >
BDSTwoVector< T >::BDSTwoVector ( )
inline

Default constructor.

Definition at line 41 of file BDSTwoVector.hh.

References BDSTwoVector< T >::values.

◆ BDSTwoVector() [2/3]

template<typename T >
BDSTwoVector< T >::BDSTwoVector ( x,
y 
)
inline

Alternate constructor.

Definition at line 45 of file BDSTwoVector.hh.

References BDSTwoVector< T >::values, BDSTwoVector< T >::x(), and BDSTwoVector< T >::y().

Here is the call graph for this function:

◆ BDSTwoVector() [3/3]

template<typename T >
BDSTwoVector< T >::BDSTwoVector ( const BDSTwoVector< T > &  other)
inline

Copy constructor.

Definition at line 49 of file BDSTwoVector.hh.

References BDSTwoVector< T >::values.

Member Function Documentation

◆ operator=()

template<typename T >
BDSTwoVector & BDSTwoVector< T >::operator= ( const BDSTwoVector< T > &  rhs)
inline

Assignment operator.

Definition at line 56 of file BDSTwoVector.hh.

References BDSTwoVector< T >::values.

◆ operator[]() [1/2]

template<typename T >
T & BDSTwoVector< T >::operator[] ( const G4int  index)
inline

Access / set a single element.

Definition at line 66 of file BDSTwoVector.hh.

References BDSTwoVector< T >::values.

◆ operator[]() [2/2]

template<typename T >
const T & BDSTwoVector< T >::operator[] ( const G4int  index) const
inline

Definition at line 74 of file BDSTwoVector.hh.

◆ x()

template<typename T >
const T & BDSTwoVector< T >::x ( ) const
inline

Accessor by name.

Definition at line 82 of file BDSTwoVector.hh.

References BDSTwoVector< T >::values.

Referenced by BDSTwoVector< T >::BDSTwoVector().

Here is the caller graph for this function:

◆ y()

template<typename T >
const T & BDSTwoVector< T >::y ( ) const
inline

Accessor by name.

Definition at line 83 of file BDSTwoVector.hh.

References BDSTwoVector< T >::values.

Referenced by BDSTwoVector< T >::BDSTwoVector().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

template<typename T >
std::ostream & operator<< ( std::ostream &  out,
BDSTwoVector< T > const &  v 
)
friend

Output stream.

Definition at line 87 of file BDSTwoVector.hh.

Field Documentation

◆ values

template<typename T >
T BDSTwoVector< T >::values[2]
private

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