MARLEY (Model of Argon Reaction Low Energy Yields)  v1.1.0
A Monte Carlo event generator for tens-of-MeV neutrino-nucleus interactions in liquid argon
 All Classes Functions Variables Enumerations Pages
Public Member Functions | Protected Attributes | List of all members
marley::Parity Class Reference

Type-safe representation of a parity value (either +1 or -1) More...

#include <Parity.hh>

Public Member Functions

 Parity ()
 Default constructor chooses positive parity.
 
 Parity (bool is_positive)
 Create a Parity object from a boolean value. More...
 
 Parity (int i)
 Create a Parity object from an integer. More...
 
 operator bool () const
 Convert the Parity object to a bool (true for +1, false for -1)
 
 operator int () const
 
Parityoperator! ()
 Unary operator that flips a Parity value in place.
 
bool operator!= (const marley::Parity &p) const
 
marley::Parity operator* (const marley::Parity &p) const
 
int operator* (const int &i) const
 
marley::Parity operator- () const
 Creates a copy of the Parity object with a flipped value.
 
marley::Parityoperator= (const int &i)
 Assigns a parity value using an integer. More...
 
bool operator== (const marley::Parity &p) const
 
char to_char () const
 Convert the Parity object to a char.
 

Protected Attributes

bool is_positive_
 Boolean representation of the parity value that is true when the parity is +1 and false when it is -1.
 

Detailed Description

Type-safe representation of a parity value (either +1 or -1)

Constructor & Destructor Documentation

marley::Parity::Parity ( bool  is_positive)
inlineexplicit

Create a Parity object from a boolean value.

Parameters
is_positiveBoolean parameter that is true for +1, or false for -1.
marley::Parity::Parity ( int  i)
inlineexplicit

Create a Parity object from an integer.

If an int value other than +1 or -1 is passed to this constructor, a marley::Error will be thrown.

Member Function Documentation

marley::Parity& marley::Parity::operator= ( const int &  i)
inline

Assigns a parity value using an integer.

If an int value other than +1 or -1 is used, a marley::Error will be thrown.


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