Commit fd8e23929a0cd6fd29cba671b9f70815df17ae10
1 parent
e821ba0f
Adjust class documentation.
Showing
9 changed files
with
128 additions
and
36 deletions
include/GEvent.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * GEvent.hpp - Event abstract base class * | |
| 2 | + * GEvent.hpp - Abstract event base class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | 4 | * copyright (C) 2009-2013 by Juergen Knoedlseder * |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | 22 | * @file GEvent.hpp |
| 23 | - * @brief GEvent abstract base class interface definition. | |
| 23 | + * @brief Abstract event base class definition | |
| 24 | 24 | * @author Juergen Knoedlseder |
| 25 | 25 | */ |
| 26 | 26 | |
| ... | ... | @@ -77,7 +77,7 @@ public: |
| 77 | 77 | virtual ~GEvent(void); |
| 78 | 78 | |
| 79 | 79 | // Operators |
| 80 | - virtual GEvent& operator= (const GEvent& event); | |
| 80 | + virtual GEvent& operator=(const GEvent& event); | |
| 81 | 81 | |
| 82 | 82 | // Pure virtual methods |
| 83 | 83 | virtual void clear(void) = 0; | ... | ... |
include/GEventAtom.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * GEventAtom.hpp - Event atom abstract base class * | |
| 2 | + * GEventAtom.hpp - Abstract event atom base class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | 4 | * copyright (C) 2009-2013 by Jurgen Knodlseder * |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | 22 | * @file GEventAtom.hpp |
| 23 | - * @brief GEventAtom abstract base class interface definition. | |
| 23 | + * @brief Abstract event atom base class definition | |
| 24 | 24 | * @author Juergen Knoedlseder |
| 25 | 25 | */ |
| 26 | 26 | |
| ... | ... | @@ -71,22 +71,22 @@ public: |
| 71 | 71 | virtual ~GEventAtom(void); |
| 72 | 72 | |
| 73 | 73 | // Operators |
| 74 | - virtual GEventAtom& operator= (const GEventAtom& atom); | |
| 74 | + virtual GEventAtom& operator=(const GEventAtom& atom); | |
| 75 | 75 | |
| 76 | 76 | // Pure virtual methods |
| 77 | 77 | virtual void clear(void) = 0; |
| 78 | 78 | virtual GEvent* clone(void) const = 0; |
| 79 | - virtual double size(void) const { return 1.0; } | |
| 79 | + virtual double size(void) const; | |
| 80 | 80 | virtual const GInstDir& dir(void) const = 0; |
| 81 | 81 | virtual const GEnergy& energy(void) const = 0; |
| 82 | 82 | virtual const GTime& time(void) const = 0; |
| 83 | - virtual double counts(void) const { return 1.0; } | |
| 84 | - virtual double error(void) const { return 0.0; } | |
| 83 | + virtual double counts(void) const; | |
| 84 | + virtual double error(void) const; | |
| 85 | 85 | virtual std::string print(const GChatter& chatter = NORMAL) const = 0; |
| 86 | 86 | |
| 87 | 87 | // Other methods |
| 88 | - bool isatom(void) const { return true; } | |
| 89 | - bool isbin(void) const { return false; } | |
| 88 | + bool isatom(void) const; | |
| 89 | + bool isbin(void) const; | |
| 90 | 90 | |
| 91 | 91 | protected: |
| 92 | 92 | // Protected methods |
| ... | ... | @@ -95,4 +95,69 @@ protected: |
| 95 | 95 | void free_members(void); |
| 96 | 96 | }; |
| 97 | 97 | |
| 98 | + | |
| 99 | +/***********************************************************************//** | |
| 100 | + * @brief Return size of an event atom | |
| 101 | + * | |
| 102 | + * @return Event size, fixed to 1.0 for an event atom. | |
| 103 | + * | |
| 104 | + * Returns the size of an event atom. The size is only useful for event bins, | |
| 105 | + * for which it is defined as the quantity that needs to be multiplied by the | |
| 106 | + * event probability to give the predicted number of events in a bin. For | |
| 107 | + * event atoms, the size is fixed to 1.0. | |
| 108 | + ***************************************************************************/ | |
| 109 | +inline | |
| 110 | +double GEventAtom::size(void) const | |
| 111 | +{ | |
| 112 | + return (1.0); | |
| 113 | +} | |
| 114 | + | |
| 115 | + | |
| 116 | +/***********************************************************************//** | |
| 117 | + * @brief Return number of counts in event atom | |
| 118 | + * | |
| 119 | + * @return Number of counts, fixed to 1.0 for an event atom. | |
| 120 | + ***************************************************************************/ | |
| 121 | +inline | |
| 122 | +double GEventAtom::counts(void) const | |
| 123 | +{ | |
| 124 | + return (1.0); | |
| 125 | +} | |
| 126 | + | |
| 127 | + | |
| 128 | +/***********************************************************************//** | |
| 129 | + * @brief Return error in number of counts in event atom | |
| 130 | + * | |
| 131 | + * @return Error in number of counts, fixed to 0.0 for an event atom. | |
| 132 | + ***************************************************************************/ | |
| 133 | +inline | |
| 134 | +double GEventAtom::error(void) const | |
| 135 | +{ | |
| 136 | + return (0.0); | |
| 137 | +} | |
| 138 | + | |
| 139 | + | |
| 140 | +/***********************************************************************//** | |
| 141 | + * @brief Signal if event is an atom | |
| 142 | + * | |
| 143 | + * @return True. | |
| 144 | + ***************************************************************************/ | |
| 145 | +inline | |
| 146 | +bool GEventAtom::isatom(void) const | |
| 147 | +{ | |
| 148 | + return (true); | |
| 149 | +} | |
| 150 | + | |
| 151 | + | |
| 152 | +/***********************************************************************//** | |
| 153 | + * @brief Signal if event is a bin | |
| 154 | + * | |
| 155 | + * @return False. | |
| 156 | + ***************************************************************************/ | |
| 157 | +inline | |
| 158 | +bool GEventAtom::isbin(void) const | |
| 159 | +{ | |
| 160 | + return (false); | |
| 161 | +} | |
| 162 | + | |
| 98 | 163 | #endif /* GEVENTATOM_HPP */ | ... | ... |
include/GEventBin.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * GEventBin.hpp - Event bin abstract base class * | |
| 2 | + * GEventBin.hpp - Abstract event bin base class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | 4 | * copyright (C) 2009-2013 by Jurgen Knodlseder * |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | 22 | * @file GEventBin.hpp |
| 23 | - * @brief GEventBin abstract base class interface definition. | |
| 23 | + * @brief Abstract event bin base class definition | |
| 24 | 24 | * @author Juergen Knoedlseder |
| 25 | 25 | */ |
| 26 | 26 | |
| ... | ... | @@ -73,7 +73,7 @@ public: |
| 73 | 73 | virtual ~GEventBin(void); |
| 74 | 74 | |
| 75 | 75 | // Operators |
| 76 | - virtual GEventBin& operator= (const GEventBin& bin); | |
| 76 | + virtual GEventBin& operator=(const GEventBin& bin); | |
| 77 | 77 | |
| 78 | 78 | // Pure virtual methods |
| 79 | 79 | virtual void clear(void) = 0; |
| ... | ... | @@ -88,8 +88,8 @@ public: |
| 88 | 88 | virtual std::string print(const GChatter& chatter = NORMAL) const = 0; |
| 89 | 89 | |
| 90 | 90 | // Other methods |
| 91 | - bool isatom(void) const { return false; } | |
| 92 | - bool isbin(void) const { return true; } | |
| 91 | + bool isatom(void) const; | |
| 92 | + bool isbin(void) const; | |
| 93 | 93 | |
| 94 | 94 | protected: |
| 95 | 95 | // Protected methods |
| ... | ... | @@ -98,4 +98,28 @@ protected: |
| 98 | 98 | void free_members(void); |
| 99 | 99 | }; |
| 100 | 100 | |
| 101 | + | |
| 102 | +/***********************************************************************//** | |
| 103 | + * @brief Signal if event is an atom | |
| 104 | + * | |
| 105 | + * @return False. | |
| 106 | + ***************************************************************************/ | |
| 107 | +inline | |
| 108 | +bool GEventBin::isatom(void) const | |
| 109 | +{ | |
| 110 | + return (false); | |
| 111 | +} | |
| 112 | + | |
| 113 | + | |
| 114 | +/***********************************************************************//** | |
| 115 | + * @brief Signal if event is a bin | |
| 116 | + * | |
| 117 | + * @return True. | |
| 118 | + ***************************************************************************/ | |
| 119 | +inline | |
| 120 | +bool GEventBin::isbin(void) const | |
| 121 | +{ | |
| 122 | + return (true); | |
| 123 | +} | |
| 124 | + | |
| 101 | 125 | #endif /* GEVENTBIN_HPP */ | ... | ... |
pyext/GEvent.i
| 1 | 1 | /*************************************************************************** |
| 2 | - * GEvent.i - Abstract event class * | |
| 2 | + * GEvent.i - Abstract event base class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | 4 | * copyright (C) 2010-2013 by Juergen Knoedlseder * |
| 5 | 5 | * ----------------------------------------------------------------------- * | ... | ... |
pyext/GEventAtom.i
| 1 | 1 | /*************************************************************************** |
| 2 | - * GEventAtom.i - Abstract event atom class * | |
| 2 | + * GEventAtom.i - Abstract event atom base class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2010-2012 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2010-2013 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | 22 | * @file GEventAtom.i |
| 23 | - * @brief Abstract event atom class interface definition | |
| 23 | + * @brief Abstract event atom base class definition | |
| 24 | 24 | * @author Juergen Knoedlseder |
| 25 | 25 | */ |
| 26 | 26 | %{ | ... | ... |
pyext/GEventBin.i
| 1 | 1 | /*************************************************************************** |
| 2 | - * GEventBin.i - Abstract event bin class * | |
| 2 | + * GEventBin.i - Abstract event bin base class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2010-2012 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2009-2013 by Jurgen Knodlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | 22 | * @file GEventBin.i |
| 23 | - * @brief Abstract event bin class python interface definition | |
| 23 | + * @brief Abstract event bin base class definition | |
| 24 | 24 | * @author Juergen Knoedlseder |
| 25 | 25 | */ |
| 26 | 26 | %{ | ... | ... |
src/obs/GEvent.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * GEvent.cpp - Event abstract base class * | |
| 2 | + * GEvent.cpp - Abstract event base class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2009-2012 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2009-2013 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | 22 | * @file GEvent.cpp |
| 23 | - * @brief GEvent abstract base class implementation. | |
| 23 | + * @brief Abstract event base class implementation | |
| 24 | 24 | * @author Juergen Knoedlseder |
| 25 | 25 | */ |
| 26 | 26 | |
| ... | ... | @@ -100,8 +100,9 @@ GEvent::~GEvent(void) |
| 100 | 100 | * @brief Assignment operator |
| 101 | 101 | * |
| 102 | 102 | * @param[in] event Event. |
| 103 | + * @return Event. | |
| 103 | 104 | ***************************************************************************/ |
| 104 | -GEvent& GEvent::operator= (const GEvent& event) | |
| 105 | +GEvent& GEvent::operator=(const GEvent& event) | |
| 105 | 106 | { |
| 106 | 107 | // Execute only if object is not identical |
| 107 | 108 | if (this != &event) { | ... | ... |
src/obs/GEventAtom.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * GEventAtom.cpp - Event atom abstract base class * | |
| 2 | + * GEventAtom.cpp - Abstract event atom base class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2009-2011 by Jurgen Knodlseder * | |
| 4 | + * copyright (C) 2009-2013 by Jurgen Knodlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -20,8 +20,8 @@ |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | 22 | * @file GEventAtom.cpp |
| 23 | - * @brief GEvent atom abstract base class implementation. | |
| 24 | - * @author J. Knodlseder | |
| 23 | + * @brief Abstract event atom base class implementation | |
| 24 | + * @author Juergen Knoedlseder | |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | 27 | /* __ Includes ___________________________________________________________ */ |
| ... | ... | @@ -99,8 +99,9 @@ GEventAtom::~GEventAtom(void) |
| 99 | 99 | * @brief Assignment operator |
| 100 | 100 | * |
| 101 | 101 | * @param[in] atom Event atom. |
| 102 | + * @return Event atom. | |
| 102 | 103 | ***************************************************************************/ |
| 103 | -GEventAtom& GEventAtom::operator= (const GEventAtom& atom) | |
| 104 | +GEventAtom& GEventAtom::operator=(const GEventAtom& atom) | |
| 104 | 105 | { |
| 105 | 106 | // Execute only if object is not identical |
| 106 | 107 | if (this != &atom) { | ... | ... |
src/obs/GEventBin.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * GEventBin.cpp - Event bin abstract base class * | |
| 2 | + * GEventBin.cpp - Abstract event bin base class * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2009-2011 by Jurgen Knodlseder * | |
| 4 | + * copyright (C) 2009-2013 by Jurgen Knodlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | /** |
| 22 | 22 | * @file GEventBin.cpp |
| 23 | 23 | * @brief Abstract event bin base class implementation |
| 24 | - * @author J. Knodlseder | |
| 24 | + * @author Juergen Knoedlseder | |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | 27 | /* __ Includes ___________________________________________________________ */ |
| ... | ... | @@ -100,8 +100,9 @@ GEventBin::~GEventBin(void) |
| 100 | 100 | * @brief Assignment operator |
| 101 | 101 | * |
| 102 | 102 | * @param[in] bin Event bin. |
| 103 | + * @return Event bin. | |
| 103 | 104 | ***************************************************************************/ |
| 104 | -GEventBin& GEventBin::operator= (const GEventBin& bin) | |
| 105 | +GEventBin& GEventBin::operator=(const GEventBin& bin) | |
| 105 | 106 | { |
| 106 | 107 | // Execute only if object is not identical |
| 107 | 108 | if (this != &bin) { | ... | ... |