CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
jsonClust.hh
Go to the documentation of this file.
1 #ifndef JSONCLUST_HH
2 #define JSONCLUST_HH
3 
5 
8 
9 namespace CASM {
10 
11  template<typename ValueType>
13  ValueType &m_value;
15  double m_tol;
16  public:
17  ClustJsonHelper(ValueType &_value, const Structure &_struc, double _tol = TOL) :
18  m_value(_value), m_struc(_struc), m_tol(TOL) {};
19 
20  ValueType &value() {
21  return m_value;
22  };
23  const ValueType &value()const {
24  return m_value;
25  }
26  const Structure &struc()const {
27  return m_struc;
28  }
29 
30  double tol() const {
31  return m_tol;
32  }
33 
36  };
37  };
38 
43 
48 
49  void from_json(SiteClusterJsonHelper clust_helper, const jsonParser &json);
50  jsonParser &to_json(const ConstSiteClusterJsonHelper &clust_helper, jsonParser &json);
51 
53  jsonParser &to_json(const ConstSiteOrbitJsonHelper &orbit_helper, jsonParser &json);
54 
55  void from_json(SiteOrbitBranchJsonHelper branch_helper, const jsonParser &json);
56  jsonParser &to_json(const ConstSiteOrbitBranchJsonHelper &branch_helper, jsonParser &json);
57 
58  void from_json(SiteOrbitreeJsonHelper tree_helper, const jsonParser &json);
59  jsonParser &to_json(const ConstSiteOrbitreeJsonHelper &tree_helper, jsonParser &json);
60 
61  template<typename ValueType>
62  ClustJsonHelper<ValueType> jsonHelper(ValueType &_value, const Structure &_struc, double tol = TOL) {
63  return ClustJsonHelper<ValueType>(_value, _struc, tol);
64  }
65 }
66 #endif
ClustJsonHelper< SiteOrbit > SiteOrbitJsonHelper
Definition: jsonClust.hh:40
ClustJsonHelper< ValueType > jsonHelper(ValueType &_value, const Structure &_struc, double tol=TOL)
Definition: jsonClust.hh:62
void from_json(ClexDescription &desc, const jsonParser &json)
ClustJsonHelper< SiteOrbitree > SiteOrbitreeJsonHelper
Definition: jsonClust.hh:42
Structure specifies the lattice and atomic basis of a crystal.
Definition: Structure.hh:29
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)
Main CASM namespace.
Definition: complete.cpp:8
const double TOL
double tol() const
Definition: jsonClust.hh:30
ClustJsonHelper< const SiteOrbitree > ConstSiteOrbitreeJsonHelper
Definition: jsonClust.hh:47
ClustJsonHelper< const SiteOrbitBranch > ConstSiteOrbitBranchJsonHelper
Definition: jsonClust.hh:46
double tol
ValueType & m_value
Definition: jsonClust.hh:13
ClustJsonHelper(ValueType &_value, const Structure &_struc, double _tol=TOL)
Definition: jsonClust.hh:17
ValueType & value()
Definition: jsonClust.hh:20
const Structure & struc() const
Definition: jsonClust.hh:26
ClustJsonHelper< SiteCluster > SiteClusterJsonHelper
Definition: jsonClust.hh:39
ClustJsonHelper< const SiteCluster > ConstSiteClusterJsonHelper
Definition: jsonClust.hh:44
const ValueType & value() const
Definition: jsonClust.hh:23
ClustJsonHelper< SiteOrbitBranch > SiteOrbitBranchJsonHelper
Definition: jsonClust.hh:41
const Structure & m_struc
Definition: jsonClust.hh:14
ClustJsonHelper< const SiteOrbit > ConstSiteOrbitJsonHelper
Definition: jsonClust.hh:45