source: src/Potentials/Specifics/PotentialTypes.hpp@ 9eb71b3

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 Disabling_MemDebug 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 9eb71b3 was aa91de0, checked in by Frederik Heber <frederik.heber@…>, 8 years ago

FIX: size_t definition missing and other fixes.

  • cstddef defines both size_t and NULL.
  • also string include missing.
  • this is in preparation for removing MemDebug include.
  • Property mode set to 100644
File size: 1.6 KB
Line 
1/** \file PotentialTypes.hpp
2 *
3 * This is a enhanced enumeration to make it usable within a loop.
4 *
5 * date: Apr, 09 2013
6 * author: heber
7 *
8 */
9
10#ifndef POTENTIALTYPES_HPP_
11#define POTENTIALTYPES_HPP_
12
13// include config.h
14#ifdef HAVE_CONFIG_H
15#include <config.h>
16#endif
17
18#include <cstddef>
19
20#include <boost/preprocessor/seq/elem.hpp>
21#include <boost/preprocessor/seq/seq.hpp>
22#include <boost/preprocessor/seq/size.hpp>
23#include <boost/preprocessor/iteration/local.hpp>
24
25
26#include "PotentialTypes.def"
27
28//!> function to print each member of the sequence in the enumeration
29#define sequence_print(z,n,seq) \
30 BOOST_PP_SEQ_ELEM(n, seq) ,
31
32 //!> enumeration of all known and createable potentials
33enum PotentialTypes {
34// some proprocessor magic to generate the body from the above sequence
35#if defined PotentialTypes_END // do we have parameters at all?
36#define BOOST_PP_LOCAL_MACRO(n) sequence_print(~, n, POTENTIALSEQUENCE)
37#define BOOST_PP_LOCAL_LIMITS (0, PotentialTypes_END-1)
38#include BOOST_PP_LOCAL_ITERATE()
39#undef BOOST_PP_LOCAL_MACRO
40#undef BOOST_PP_LOCAL_LIMITS
41#endif
42 PotentialTypes_end = PotentialTypes_END,
43 PotentialTypes_begin = BOOST_PP_SEQ_HEAD(POTENTIALSEQUENCE)
44};
45
46#undef sequence_print
47
48//!> Number of known PotentialTypes
49const size_t PotentialTypesMax = PotentialTypes_END;
50
51#include "PotentialTypes.undef"
52
53//!> Typedef for enumeration to ease its use
54typedef enum PotentialTypes PotentialTypes;
55
56/** Increment operator for the enumeration PotentialTypes to allow loops.
57 * \param &type value
58 * \return value incremented by one
59 */
60PotentialTypes &operator++(PotentialTypes &type);
61
62#endif /* POTENTIALTYPES_HPP_ */
63
Note: See TracBrowser for help on using the repository browser.