Jpp  18.4.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
JOSCPROB::JOscParameter< T > Struct Template Referenceabstract

Abstract base class for oscillation parameter. More...

#include <JOscParameter.hh>

Inheritance diagram for JOSCPROB::JOscParameter< T >:
JLANG::JParameter< T > JLANG::JComparable< JParameter< T > > JOSCPROB::JComplexPhase< T > JOSCPROB::JMassSquaredDifference< T > JOSCPROB::JMixingAngle< T >

Public Types

typedef JParameter< TJParameter_t
 
typedef JParameter_t::argument_type argument_type
 

Public Member Functions

 JOscParameter ()
 Default constructor. More...
 
 JOscParameter (argument_type value)
 Constructor. More...
 
JOscParameter< T > & operator= (argument_type value)
 Assignment operator. More...
 
void setValue (argument_type value)
 Set parameter. More...
 
virtual bool is_valid () const =0
 Check validity of oscillation parameter. More...
 
const TgetValue () const
 Get value of parameter. More...
 
TgetValue ()
 Get value of parameter. More...
 
 operator const T & () const
 Type conversion operator. More...
 
 operator T & ()
 Type conversion operator. More...
 
const bool isDefined () const
 Get status of parameter. More...
 
bool less (const JParameter< T > &parameter) const
 Less than method. More...
 

Protected Attributes

T __value
 
bool is_defined
 

Friends

std::istream & operator>> (std::istream &in, JOscParameter< T > &parameter)
 Stream input. More...
 
std::ostream & operator<< (std::ostream &out, const JOscParameter< T > &parameter)
 Stream output. More...
 

Detailed Description

template<class T = double>
struct JOSCPROB::JOscParameter< T >

Abstract base class for oscillation parameter.

Definition at line 28 of file JOscParameter.hh.

Member Typedef Documentation

template<class T = double>
typedef JParameter<T> JOSCPROB::JOscParameter< T >::JParameter_t

Definition at line 31 of file JOscParameter.hh.

template<class T = double>
typedef JParameter_t::argument_type JOSCPROB::JOscParameter< T >::argument_type

Definition at line 33 of file JOscParameter.hh.

Constructor & Destructor Documentation

template<class T = double>
JOSCPROB::JOscParameter< T >::JOscParameter ( )
inline

Default constructor.

Definition at line 39 of file JOscParameter.hh.

39  :
40  JParameter_t()
41  {}
JParameter< T > JParameter_t
template<class T = double>
JOSCPROB::JOscParameter< T >::JOscParameter ( argument_type  value)
inlineexplicit

Constructor.

Parameters
valueoscillation parameter value

Definition at line 49 of file JOscParameter.hh.

49  :
50  JParameter_t(value)
51  {}
JParameter< T > JParameter_t

Member Function Documentation

template<class T = double>
JOscParameter<T>& JOSCPROB::JOscParameter< T >::operator= ( argument_type  value)
inline

Assignment operator.

Parameters
valueoscillation parameter value
Returns
oscillation parameter

Definition at line 60 of file JOscParameter.hh.

61  {
62  setValue(value);
63 
64  return *this;
65  }
void setValue(argument_type value)
Set parameter.
template<class T = double>
void JOSCPROB::JOscParameter< T >::setValue ( argument_type  value)
inline

Set parameter.

Parameters
valueoscillation parameter value

Definition at line 73 of file JOscParameter.hh.

74  {
75  using namespace JPP;
76 
78 
79  if (!this->is_valid()) {
80  THROW(JValueOutOfRange, "JOscParameter<T>::setValue(): Given oscillation parameter is invalid " << value);
81  }
82  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
void setValue(argument_type value)
Set value.
Definition: JParameter.hh:103
virtual bool is_valid() const =0
Check validity of oscillation parameter.
template<class T = double>
virtual bool JOSCPROB::JOscParameter< T >::is_valid ( ) const
pure virtual
template<class T>
const T& JLANG::JParameter< T >::getValue ( ) const
inlineinherited

Get value of parameter.

Returns
value

Definition at line 81 of file JParameter.hh.

82  {
83  return __value;
84  }
template<class T>
T& JLANG::JParameter< T >::getValue ( )
inlineinherited

Get value of parameter.

Returns
value

Definition at line 92 of file JParameter.hh.

93  {
94  return __value;
95  }
template<class T>
JLANG::JParameter< T >::operator const T & ( ) const
inlineinherited

Type conversion operator.

Returns
value

Definition at line 115 of file JParameter.hh.

116  {
117  return getValue();
118  }
const T & getValue() const
Get value of parameter.
Definition: JParameter.hh:81
template<class T>
JLANG::JParameter< T >::operator T & ( )
inlineinherited

Type conversion operator.

Returns
value

Definition at line 126 of file JParameter.hh.

127  {
128  return getValue();
129  }
const T & getValue() const
Get value of parameter.
Definition: JParameter.hh:81
template<class T>
const bool JLANG::JParameter< T >::isDefined ( ) const
inlineinherited

Get status of parameter.

Returns
true if value has been defined (by read or assignment); else false

Definition at line 137 of file JParameter.hh.

138  {
139  return is_defined;
140  }
template<class T>
bool JLANG::JParameter< T >::less ( const JParameter< T > &  parameter) const
inlineinherited

Less than method.

This method evaluates to true if both parameter values are defined and this value is less than the value of the given parameter object.

Parameters
parameterparameter
Returns
true if both defined and first value less than second value; else false

Definition at line 152 of file JParameter.hh.

153  {
154  return this->isDefined() && parameter.isDefined() && this->getValue() < parameter.getValue();
155  }
const bool isDefined() const
Get status of parameter.
Definition: JParameter.hh:137
const T & getValue() const
Get value of parameter.
Definition: JParameter.hh:81

Friends And Related Function Documentation

template<class T = double>
std::istream& operator>> ( std::istream &  in,
JOscParameter< T > &  parameter 
)
friend

Stream input.

Parameters
ininput stream
parameteroscillation parameter
Returns
input stream

Definition at line 100 of file JOscParameter.hh.

101  {
102  using namespace JPP;
103 
104  in >> static_cast<JParameter_t&>(parameter);
105 
106  if (!parameter.is_valid()) {
107  THROW(JValueOutOfRange, "JOscParameter<T>::operator>>(): Given oscillation parameter is invalid " << parameter);
108  }
109 
110  return in;
111  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
JParameter< T > JParameter_t
virtual bool is_valid() const =0
Check validity of oscillation parameter.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48
template<class T = double>
std::ostream& operator<< ( std::ostream &  out,
const JOscParameter< T > &  parameter 
)
friend

Stream output.

Parameters
outoutput stream
parameteroscillation parameter
Returns
output stream

Definition at line 121 of file JOscParameter.hh.

122  {
123  return out << static_cast<const JParameter_t&>(parameter);
124  }

Member Data Documentation

template<class T>
T JLANG::JParameter< T >::__value
protectedinherited

Definition at line 193 of file JParameter.hh.

template<class T>
bool JLANG::JParameter< T >::is_defined
protectedinherited

Definition at line 194 of file JParameter.hh.


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