From cc5e72a2b35f6419d0dfd827cf2812d6f2b243c2 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Tue, 10 Aug 2010 15:30:53 +0000 Subject: [PATCH] doxygen update --- Cantera/src/base/ctml.cpp | 17 ++++++++++------- Cantera/src/base/ctml.h | 7 +++++-- Cantera/src/base/misc.cpp | 19 ++++++++++++++----- Cantera/src/base/stringUtils.cpp | 16 ++++++++++++++++ 4 files changed, 45 insertions(+), 14 deletions(-) diff --git a/Cantera/src/base/ctml.cpp b/Cantera/src/base/ctml.cpp index d03ebc5ce..8d20215dc 100644 --- a/Cantera/src/base/ctml.cpp +++ b/Cantera/src/base/ctml.cpp @@ -559,7 +559,7 @@ namespace ctml { * @param v Output map of the results. * @param convert Turn on conversion to SI units */ - void getFloats(const Cantera::XML_Node& node, std::map& v, + void getFloats(const Cantera::XML_Node& node, std::map & v, const bool convert) { std::vector f; node.getChildren("float",f); @@ -629,8 +629,7 @@ namespace ctml { * and "" , for no conversion. The default value is "" * which implies that no conversion is allowed. */ - doublereal getFloat(const Cantera::XML_Node& parent, - const std::string &name, + doublereal getFloat(const Cantera::XML_Node& parent, const std::string &name, const std::string type) { if (!parent.hasChild(name)) throw CanteraError("getFloat (called from XML Node \"" + @@ -728,7 +727,7 @@ namespace ctml { return fctr*x; } - //==================================================================================================================== + //==================================================================================================================== bool getOptionalFloat(const Cantera::XML_Node& parent, const std::string &name, doublereal &fltRtn, @@ -957,11 +956,13 @@ namespace ctml { * The default value for the node name is floatArray * * @return Returns the number of floats read + * + * @note change the v to a std::vector to eliminate a doxygen error. No idea why doxygen needs this. */ - int getFloatArray(const Cantera::XML_Node& node, Cantera::vector_fp& v, + int getFloatArray(const Cantera::XML_Node& node, std::vector &v, const bool convert, const std::string unitsString, const std::string nodeName) { - string::size_type icom; + std::string::size_type icom; string numstr; doublereal dtmp; string nn = node.name(); @@ -1332,9 +1333,11 @@ namespace ctml { * units converter is used. * @param nodeName XML Name of the XML node to read. * The default value for the node name is floatArray + * + * @note change the coeffs to a std::vector to eliminate a doxygen error. No idea why doxygen needs this. */ void getFunction(const Cantera::XML_Node& node, std::string& type, doublereal& xmin, - doublereal& xmax, Cantera::vector_fp& coeffs) { + doublereal& xmax, std::vector< double > & coeffs) { const XML_Node& c = node.child("floatArray"); coeffs.clear(); getFloatArray(c,coeffs); diff --git a/Cantera/src/base/ctml.h b/Cantera/src/base/ctml.h index 5d065a96c..2febcfa31 100644 --- a/Cantera/src/base/ctml.h +++ b/Cantera/src/base/ctml.h @@ -22,6 +22,9 @@ //! The ctml namespace adds functionality to the XML object, by providing //! standard functions that read, write, and interpret XML files and //! object trees. +/*! + * Standardization of reads and write from Cantera files occur here. + */ namespace ctml { //! const Specifying the CTML version number @@ -367,7 +370,7 @@ namespace ctml { * The default value for the node name is floatArray * @return Returns the number of floats read into v. */ - int getFloatArray(const Cantera::XML_Node& node, Cantera::vector_fp& v, + int getFloatArray(const Cantera::XML_Node& node, Cantera::vector_fp & v, const bool convert=true, const std::string unitsString="", const std::string nodeName = "floatArray"); @@ -681,7 +684,7 @@ namespace ctml { * @param v Output map of the results. * @param convert Turn on conversion to SI units */ - void getFloats(const Cantera::XML_Node& node, std::map& v, + void getFloats(const Cantera::XML_Node& node, std::map& v, const bool convert=true); //! Get an integer value from a child element. diff --git a/Cantera/src/base/misc.cpp b/Cantera/src/base/misc.cpp index feba01606..7f493ed82 100644 --- a/Cantera/src/base/misc.cpp +++ b/Cantera/src/base/misc.cpp @@ -53,11 +53,20 @@ using namespace std; #include #include -static boost::mutex dir_mutex; // For input directory access -static boost::mutex msg_mutex; // For access to string messages -static boost::mutex app_mutex; // Application state including creating singleton -//static boost::mutex log_mutex; // Logger pointer -static boost::mutex xml_mutex; // XML file storage +//! Mutex for input directory access +static boost::mutex dir_mutex; + +//! Mutex for access to string messages +static boost::mutex msg_mutex; + +//! Mutex for creating singeltons within the application object +static boost::mutex app_mutex; + +// Mutex for controlling access to the log file +//static boost::mutex log_mutex; + +//! Mutex for controlling access to XML file storage +static boost::mutex xml_mutex; //! Macro for locking input directory access #define DIR_LOCK() boost::mutex::scoped_lock d_lock(dir_mutex) diff --git a/Cantera/src/base/stringUtils.cpp b/Cantera/src/base/stringUtils.cpp index 62bc8e8da..88d19251c 100644 --- a/Cantera/src/base/stringUtils.cpp +++ b/Cantera/src/base/stringUtils.cpp @@ -539,6 +539,14 @@ namespace Cantera { return (val * fp); } //================================================================================================ + //! Find the first white space in a string + /*! + * Returns the location of the first white space character in a string + * + * @param val Input string to be parsed + * @return In a size_type variable, return the location of the first white space character. + * Return npos if none is found + */ static std::string::size_type findFirstWS(const std::string& val) { std::string::size_type ibegin = std::string::npos; int j = 0; @@ -555,6 +563,14 @@ namespace Cantera { return ibegin; } //================================================================================================ + //! Find the first non-white space in a string + /*! + * Returns the location of the first non-white space character in a string + * + * @param val Input string to be parsed + * @return In a size_type variable, return the location of the first nonwhite space character. + * Return npos if none is found + */ static std::string::size_type findFirstNotOfWS(const std::string& val) { std::string::size_type ibegin = std::string::npos; int j = 0;