Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JEquation_t.hh
Go to the documentation of this file.
1#ifndef __JLANG__JEQUATION_T__
2#define __JLANG__JEQUATION_T__
3
4#include <locale>
5
6#include "JLang/JEquation.hh"
9
10
11/**
12 * \author mdejong
13 */
14
15namespace JLANG {}
16namespace JPP { using namespace JLANG; }
17
18namespace JLANG {
19
20 /**
21 * Auxiliary data structure to read equations.
22 */
23 struct JEquation_t :
24 public JEquation
25 {
26 /**
27 * Get equation parameters.
28 *
29 * \return equation parameters
30 */
32 {
33 static JEquationParameters equation("=", ",", "./", "#");
34
35 return equation;
36 }
37
38
39 /**
40 * Set equation parameters.
41 *
42 * \param equation equation parameters
43 */
44 static inline void setEquationParameters(const JEquationParameters& equation)
45 {
46 getEquationParameters() = equation;
47 }
48
49
50 /**
51 * Read equation from input stream.
52 *
53 * \param in input stream
54 * \param equation equation
55 * \return input stream
56 */
57 friend inline std::istream& operator>>(std::istream& in, JEquation_t& equation)
58 {
59 using namespace std;
60 using namespace JPP;
61
62 const locale loc = in.imbue(locale(in.getloc(), new JEquationFacet(JEquationParameters())));
63
64 in >> static_cast<JEquation&>(equation);
65
66 //in.imbue(loc);
67
68 return in;
69 }
70 };
71}
72
73#endif
Facet class to specify parsing of equations in currect locale (see class JLANG::JEquation).
Simple data structure to support I/O of equations (see class JLANG::JEquation).
General purpose equation class.
Definition JEquation.hh:47
char * loc(char *orig)
Auxiliary classes and methods for language specific functionality.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure to read equations.
friend std::istream & operator>>(std::istream &in, JEquation_t &equation)
Read equation from input stream.
static JEquationParameters & getEquationParameters()
Get equation parameters.
static void setEquationParameters(const JEquationParameters &equation)
Set equation parameters.