source: src/Fragmentation/Homology/FragmentNode.hpp@ 33a694

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes
Last change on this file since 33a694 was 824bba, checked in by Frederik Heber <heber@…>, 8 years ago

FIX: FragmentNode lacked a header file from boost/serialization.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*
2 * FragmentNode.hpp
3 *
4 * Created on: Sep 24, 2012
5 * Author: heber
6 */
7
8#ifndef FRAGMENTNODE_HPP_
9#define FRAGMENTNODE_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include <boost/serialization/access.hpp>
17#include <boost/serialization/export.hpp>
18
19#include <iosfwd>
20
21/** FragmentNode contains all information important to homology considerations
22 * between fragments.
23 *
24 * This is important to answer whether to fragments have the same structure or
25 * not. Basically, the node simply represents an atom but without any index to
26 * make it indistinguishable from another atom having same number of bonds and
27 * same atomic number.
28 *
29 * Namely, we need:
30 * -# charge/atomic number of the node
31 * -# number of edges connected to this node
32 *
33 * Central is have this class be sortable by having comparison operators defined.
34 */
35class FragmentNode
36{
37 //!> grant output operator access to internals
38 friend std::ostream& operator<<(std::ostream &out, const FragmentNode &node);
39public:
40 /** Default constructor for class FragmentNode.
41 *
42 * Is required to allow placement in STL containers.
43 */
44 FragmentNode() :
45 AtomicNumber(0),
46 ConnectedEdges(0)
47 {}
48
49 /** Constructor for class FragmentNode.
50 *
51 * @param _AtomicNumber atomic number of represented atom
52 * @param _ConnectedEdges number of "bonds" of represented atom
53 */
54 FragmentNode(const size_t _AtomicNumber, const size_t _ConnectedEdges) :
55 AtomicNumber(_AtomicNumber),
56 ConnectedEdges(_ConnectedEdges)
57 {}
58 ~FragmentNode()
59 {}
60
61 FragmentNode& operator=(const FragmentNode &node);
62
63 // comparison operators to allow for sorting
64 bool operator<(const FragmentNode &node) const;
65 bool operator>(const FragmentNode &node) const;
66 bool operator==(const FragmentNode &node) const;
67 bool operator!=(const FragmentNode &node) const {
68 return (!(*this == node));
69 }
70
71 const size_t getAtomicNumber() const {
72 return AtomicNumber;
73 }
74
75 const size_t getConnectedEdges() const {
76 return ConnectedEdges;
77 }
78
79private:
80 //!> the atomic number
81 const size_t AtomicNumber;
82 //!> number of connecting edges
83 const size_t ConnectedEdges;
84
85private:
86 friend class boost::serialization::access;
87 // serialization
88 template <typename Archive>
89 void serialize(Archive& ar, const unsigned int version)
90 {
91 ar & const_cast<size_t &>(AtomicNumber);
92 ar & const_cast<size_t &>(ConnectedEdges);
93 }
94};
95
96// we need to give this class a unique key for serialization
97BOOST_CLASS_EXPORT_KEY(FragmentNode)
98
99std::ostream& operator<<(std::ostream &out, const FragmentNode &node);
100
101#endif /* FRAGMENTNODE_HPP_ */
Note: See TracBrowser for help on using the repository browser.