From f9573210a51811f939d9e9bc14f12124f7d3a306 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de> Date: Thu, 18 Dec 2014 12:00:42 +0100 Subject: [PATCH] Further cleanup/doxygen. --- pub/lib/jsel.cpp | 5 ++--- pub/lib/jsel.hpp | 7 ++----- pub/lib/slice.cpp | 22 +++++++++++++++------- pub/lib/slice.hpp | 6 +++--- pub/lib/toplevel.cpp | 15 +++++++++------ pub/lib/toplevel.hpp | 8 ++++---- pub/lib/var.cpp | 14 ++++++++------ pub/lib/var.hpp | 6 +++--- pub/src/frida2.cpp | 6 ++++-- 9 files changed, 50 insertions(+), 39 deletions(-) diff --git a/pub/lib/jsel.cpp b/pub/lib/jsel.cpp index e5766a88..bbb54eb6 100644 --- a/pub/lib/jsel.cpp +++ b/pub/lib/jsel.cpp @@ -5,7 +5,8 @@ //***************************************************************************// //! \file jsel.cpp -//! \brief selection of spec/curve index j +//! \brief Selection of spec/curve index j. + #include <algorithm> @@ -32,5 +33,3 @@ void JSelAsk( string quest, string *jSel, ::CList *jLis ) *jLis = ::CList ( *jSel, 0, nJmax-1 ); } } - - diff --git a/pub/lib/jsel.hpp b/pub/lib/jsel.hpp index 2a0d5636..c5129ef3 100644 --- a/pub/lib/jsel.hpp +++ b/pub/lib/jsel.hpp @@ -5,10 +5,7 @@ //***************************************************************************// //! \file jsel.hpp -//! \brief selection of spec/curve index j - -//! Spectrum selection: -void JSelAsk( string quest, string *jSel, class CList *JSel ); - +//! \brief Selection of spec/curve index j. +void JSelAsk( string quest, string *jSel, class CList *JSel ); diff --git a/pub/lib/slice.cpp b/pub/lib/slice.cpp index a5175641..379a298b 100644 --- a/pub/lib/slice.cpp +++ b/pub/lib/slice.cpp @@ -5,7 +5,8 @@ //***************************************************************************// //! \file slice.cpp -//! \brief z-dependent entries CSlice, base class for CCurve, CSpec +//! \brief CSlice handles z dependent data, is base class for CSpec, CCurve. + #include <vector> #include <string> @@ -23,20 +24,24 @@ //* class Slice *// //***************************************************************************// + +//! Creates empty CSlice. + CSlice::CSlice() : frozen(false) {} -//! Partial copy, to initialize a new Slice from an existing one. -void CSlice::copy_z_base( PSlice ein ) +//! Sets z and dz to values from other CSlice. + +void CSlice::copy_z_base( PSlice other ) { - z = ein->z; - dz = ein->dz; + z = other->z; + dz = other->dz; } -//! Compare z vectors of two zentries, for use within sort routine. +//! Compares z vectors of two CSlice', for use in sort routine. bool CompareZ( const PSlice& E1, const PSlice& E2 ) { @@ -57,6 +62,7 @@ bool CompareZ( const PSlice& E1, const PSlice& E2 ) //* class CSpec *// //***************************************************************************// + //! Append given data point. void CSpec::push_xy( double _x, double _y ) @@ -265,10 +271,12 @@ string CSpec::infoLine() const return out; } + //***************************************************************************// //* class CCurve *// //***************************************************************************// + //! Initialize curve. Used when creating or loading a curve file. void CCurve::clear(void) @@ -280,6 +288,7 @@ void CCurve::clear(void) fitR2 = 0; } + //! Return line containing z and p values. string CCurve::infoLine() const @@ -307,4 +316,3 @@ string CCurve::infoLine() const out += wrd; return out; } - diff --git a/pub/lib/slice.hpp b/pub/lib/slice.hpp index 4144eb94..76904a80 100644 --- a/pub/lib/slice.hpp +++ b/pub/lib/slice.hpp @@ -5,9 +5,10 @@ //***************************************************************************// //! \file slice.hpp -//! \brief z-dependent entries CSlice, base class for CCurve, CSpec. +//! \brief CSlice handles z dependent data, is base class for CSpec, CCurve. -//! Virtual base class for CCurve and CSpec, holds a z vector and more. + +//! Virtual base class for CSPec and CCurve. Holds z dependent data. class CSlice { public: @@ -65,4 +66,3 @@ class CSpec: public CSlice { //! at global scope, for use in sorting. bool CompareZ( const PSlice& E1, const PSlice& E2 ); - diff --git a/pub/lib/toplevel.cpp b/pub/lib/toplevel.cpp index a2dda48f..3e1a35a0 100644 --- a/pub/lib/toplevel.cpp +++ b/pub/lib/toplevel.cpp @@ -5,7 +5,8 @@ //**************************************************************************// //! \file toplevel.cpp -//! \brief initializations, and command parser for direct use in main program +//! \brief Execution context CFrida. + //! \mainpage FRIDA: fast reliable interactive data analysis @@ -28,6 +29,7 @@ //! - Dialogue interface: //! <a href="../frida-libs/readplus/index.html">libreadplus</a> + #include <cstdlib> #include <iostream> #include <string> @@ -52,6 +54,7 @@ using namespace std; + //! Error handler for C code from the GNU Scientific Library. void my_gsl_error_handler ( @@ -65,7 +68,7 @@ void my_gsl_error_handler ( //! Prepare interactive Frida session. -Frida::Frida() +CFrida::CFrida() { // External setup file: #ifdef CONFDIR @@ -92,9 +95,9 @@ Frida::Frida() } -//! Get one command from the user. +//! Prompts user for a command, and returns it. -string Frida::prompt() +string CFrida::prompt() { try{ return wask( NOlm::sel_str() + " > " ); @@ -112,9 +115,9 @@ string Frida::prompt() } -//! Execute one Frida command. +//! CExecutes one Frida command. -void Frida::execute( const string cmd ) +void CFrida::execute( const string cmd ) { try{ // Empty input, comment lines. diff --git a/pub/lib/toplevel.hpp b/pub/lib/toplevel.hpp index b84a1e55..60489fbc 100644 --- a/pub/lib/toplevel.hpp +++ b/pub/lib/toplevel.hpp @@ -5,14 +5,14 @@ //**************************************************************************// //! \file toplevel.hpp -//! \brief initializations, and command parser for direct use in main program +//! \brief Execution context CFrida. #include <time.h> -class Frida { +class CFrida { public: - Frida(); - std::string prompt(); + CFrida(); + static std::string prompt(); void execute( const std::string cmd ); private: // Time spent in frida, for optimizing numerical routines: diff --git a/pub/lib/var.cpp b/pub/lib/var.cpp index 8e317d1c..8f9655bb 100644 --- a/pub/lib/var.cpp +++ b/pub/lib/var.cpp @@ -5,20 +5,23 @@ //***************************************************************************// //! \file var.cpp -//! \brief variable reference CVar +//! \brief Variable reference CVar. + #include <string> #include "defs.hpp" #include "var.hpp" + //***************************************************************************// //* class CVar *// //***************************************************************************// // Variables may be unnumbered (x,y,i,j,k,f,...) or numbered (z0,p0,...). -//! Auxilary routine for decoding the number withing the parameter label. + +//! Returns number contained in parameter label s, starting at index pos. int CVar::requestNum( string s, int pos ) { @@ -31,7 +34,7 @@ int CVar::requestNum( string s, int pos ) } -//! Decode string containing parameter label (like "x" or "p3"). +//! Creates instance according to given parameter label. CVar::CVar( string s ) { @@ -83,7 +86,7 @@ CVar::CVar( string s ) } -//! Return associated error variable. +//! Returns associated error variable. CVar CVar::errvar() const { @@ -96,7 +99,7 @@ CVar CVar::errvar() const } -//! Convert to text. +//! Returns string representation of this variable. string CVar::var_info() const { @@ -128,4 +131,3 @@ string CVar::var_info() const } return ret; } - diff --git a/pub/lib/var.hpp b/pub/lib/var.hpp index b61e7d8b..918dfbc1 100644 --- a/pub/lib/var.hpp +++ b/pub/lib/var.hpp @@ -5,7 +5,8 @@ //***************************************************************************// //! \file var.hpp -//! \brief variable reference CVar +//! \brief Variable reference CVar. + //! Variable type (and number, if applicable). @@ -39,6 +40,5 @@ class CVar { string var_info() const; private: - int requestNum( string s, int pos ); + static int requestNum( string s, int pos ); }; - diff --git a/pub/src/frida2.cpp b/pub/src/frida2.cpp index 84684795..3723d051 100644 --- a/pub/src/frida2.cpp +++ b/pub/src/frida2.cpp @@ -5,7 +5,8 @@ //**************************************************************************// //! \file frida2.cpp -//! \brief main program +//! \brief Main program: initialize, then run interactive endless loop. + #include <iostream> #include <fstream> @@ -14,12 +15,13 @@ using namespace std; + //! Frida main program. int main(int argc, char* argv[]) { // cout << "initializing\n"; - Frida frida; + CFrida frida; for( int iarg=1; iarg<argc; ++iarg ){ ifstream script(argv[iarg]); -- GitLab