|
MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
|
Type-safe representation of a parity value (either +1 or -1) More...
#include <Parity.hh>
Public Member Functions | |
| constexpr | Parity () |
| Default constructor chooses positive parity. | |
| constexpr | Parity (bool is_positive) |
| Create a Parity object from a boolean value. | |
| Parity (int i) | |
| Create a Parity object from an integer. | |
| void | from_char (const char c) |
| Assign a value to this Parity object from a char. | |
| constexpr | operator bool () const |
| Convert the Parity object to a bool (true for +1, false for -1) | |
| operator int () const | |
| Parity & | operator! () |
| Unary operator that flips a Parity value in place. | |
| bool | operator!= (const marley::Parity &p) const |
| int | operator* (const int &i) const |
| marley::Parity | operator* (const marley::Parity &p) const |
| constexpr marley::Parity | operator- () const |
| Creates a copy of the Parity object with a flipped value. | |
| marley::Parity & | operator= (const int &i) |
| Assigns a parity value using an integer. | |
| 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. | |
Type-safe representation of a parity value (either +1 or -1)
|
inlineconstexpr |
Default constructor chooses positive parity.
Definition at line 30 of file Parity.hh.
References is_positive_.
Referenced by operator!().
|
inlineexplicitconstexpr |
Create a Parity object from a boolean value.
| is_positive | Boolean parameter that is true for +1, or false for -1. |
Definition at line 35 of file Parity.hh.
References is_positive_.
|
explicit |
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.
Definition at line 25 of file Parity.cc.
References is_positive_.
| void marley::Parity::from_char | ( | const char | c | ) |
Assign a value to this Parity object from a char.
Definition at line 46 of file Parity.cc.
References is_positive_.
|
inlineexplicitconstexpr |
Convert the Parity object to a bool (true for +1, false for -1)
Definition at line 44 of file Parity.hh.
References is_positive_.
|
inlineexplicit |
Definition at line 86 of file Parity.hh.
References is_positive_.
|
inline |
Unary operator that flips a Parity value in place.
Definition at line 52 of file Parity.hh.
References Parity(), and is_positive_.
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
Creates a copy of the Parity object with a flipped value.
Definition at line 47 of file Parity.hh.
References is_positive_.
| marley::Parity & marley::Parity::operator= | ( | const int & | i | ) |
Assigns a parity value using an integer.
If an int value other than +1 or -1 is used, a marley::Error will be thrown.
Definition at line 35 of file Parity.cc.
References is_positive_.
|
inline |
|
inline |
Convert the Parity object to a char.
Definition at line 92 of file Parity.hh.
References is_positive_.
|
protected |
Boolean representation of the parity value that is true when the parity is +1 and false when it is -1.
Definition at line 104 of file Parity.hh.
Referenced by Parity(), Parity(), Parity(), from_char(), operator bool(), operator int(), operator!(), operator-(), operator=(), and to_char().