From 3bcd0bafd5fba1eebadfd1cb8a7294d665cf1932 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Fri, 1 Aug 2014 00:13:25 +0200 Subject: [PATCH] Lots of (mostly) doxygen fixes/cleanup. --- Doxyfile | 25 +-- simgear/bucket/newbucket.hxx | 11 +- simgear/canvas/Canvas.hxx | 6 +- simgear/canvas/elements/CanvasElement.hxx | 7 +- simgear/canvas/events/CustomEvent.hxx | 12 +- simgear/canvas/events/KeyboardEvent.hxx | 10 +- simgear/canvas/events/MouseEvent.hxx | 12 +- simgear/canvas/layout/BoxLayout.hxx | 4 +- simgear/canvas/layout/Layout.hxx | 20 +- simgear/io/sg_file.cxx | 3 +- simgear/io/sg_file.hxx | 37 ++-- simgear/math/interpolater.cxx | 4 +- simgear/misc/sgstream.cxx | 11 +- simgear/nasal/cppbind/NasalHash.hxx | 1 - simgear/nasal/cppbind/NasalString.hxx | 2 +- simgear/nasal/data.h | 2 +- simgear/props/PropertyBasedElement.hxx | 4 +- simgear/props/props.cxx | 41 ++--- simgear/props/props.hxx | 40 ++-- simgear/props/propsfwd.hxx | 8 +- simgear/scene/material/EffectBuilder.hxx | 14 +- simgear/scene/material/mat.cxx | 30 +-- simgear/scene/model/ConditionNode.cxx | 2 +- simgear/scene/model/model.cxx | 2 +- simgear/scene/sky/cloud.cxx | 8 +- simgear/scene/sky/cloud.hxx | 10 +- simgear/scene/sky/sky.cxx | 9 +- simgear/scene/sky/sky.hxx | 171 ++++++++---------- simgear/scene/tgdb/SGOceanTile.cxx | 3 - simgear/scene/util/NodeAndDrawableVisitor.cxx | 20 +- simgear/scene/util/OsgDebug.hxx | 3 +- simgear/scene/util/SplicingVisitor.cxx | 19 +- simgear/sound/sample_group.cxx | 28 +-- simgear/sound/sample_group.hxx | 36 ++-- simgear/sound/sample_openal.hxx | 43 ++--- simgear/sound/sample_queue.hxx | 49 +++-- simgear/sound/soundmgr_openal.cxx | 26 +-- simgear/sound/soundmgr_openal.hxx | 61 ++++--- simgear/sound/xmlsound.cxx | 10 +- simgear/sound/xmlsound.hxx | 55 +++--- simgear/structure/SGBinding.hxx | 8 +- simgear/structure/SGSharedPtr.hxx | 39 ++-- simgear/structure/commands.hxx | 10 +- simgear/structure/exception.cxx | 45 ++--- simgear/threads/SGGuard.hxx | 9 +- simgear/threads/SGQueue.hxx | 42 ++--- simgear/threads/SGThread.hxx | 12 +- simgear/timing/sg_time.hxx | 36 ++-- 48 files changed, 521 insertions(+), 539 deletions(-) diff --git a/Doxyfile b/Doxyfile index f4aa9c6c..ef222c3e 100644 --- a/Doxyfile +++ b/Doxyfile @@ -744,30 +744,7 @@ WARN_LOGFILE = # Note: If this tag is empty the current directory is searched. INPUT = DoxygenMain.cxx \ - simgear/bucket \ - simgear/canvas \ - simgear/compiler.h \ - simgear/constants.h \ - simgear/debug \ - simgear/environment \ - simgear/ephemeris \ - simgear/io \ - simgear/magvar \ - simgear/math \ - simgear/misc \ - simgear/nasal \ - simgear/props \ - simgear/route \ - simgear/scene \ - simgear/screen \ - simgear/serial \ - simgear/structure \ - simgear/sg_inlines.h \ - simgear/sg_traits.hxx \ - simgear/sound \ - simgear/threads \ - simgear/timing \ - simgear/xml + simgear # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/simgear/bucket/newbucket.hxx b/simgear/bucket/newbucket.hxx index b21f1ff0..fe0bbbc4 100644 --- a/simgear/bucket/newbucket.hxx +++ b/simgear/bucket/newbucket.hxx @@ -127,21 +127,22 @@ public: /** * Construct a bucket given a specific location. - * @param dlon longitude specified in degrees - * @param dlat latitude specified in degrees + * + * @param geod Geodetic location */ SGBucket(const SGGeod& geod); /** Construct a bucket given a unique bucket index number. + * * @param bindex unique bucket index */ SGBucket(const long int bindex); #ifndef NO_DEPRECATED_API /** - * Reset a bucket to represent a new lat and lon - * @param dlon longitude specified in degrees - * @param dlat latitude specified in degrees + * Reset a bucket to represent a new location. + * + * @param geod New geodetic location */ void set_bucket(const SGGeod& geod); diff --git a/simgear/canvas/Canvas.hxx b/simgear/canvas/Canvas.hxx index 42c28632..7473139b 100644 --- a/simgear/canvas/Canvas.hxx +++ b/simgear/canvas/Canvas.hxx @@ -228,12 +228,12 @@ namespace canvas ElementWeakPtr _focus_element; CullCallbackPtr _cull_callback; - bool _render_always; // _dirty_placements; std::vector _placements; - std::set _parent_canvases, // _parent_canvases, //!< Canvases showing this canvas + _child_canvases; //!< Canvases displayed within // this canvas typedef std::map PlacementFactoryMap; diff --git a/simgear/canvas/elements/CanvasElement.hxx b/simgear/canvas/elements/CanvasElement.hxx index a0d2bb18..8f178b58 100644 --- a/simgear/canvas/elements/CanvasElement.hxx +++ b/simgear/canvas/elements/CanvasElement.hxx @@ -279,9 +279,10 @@ namespace canvas /** * Register a function for setting a style specified by the given property * - * @param name Property name - * @param type Interpolation type - * @param setter Setter function + * @param name Property name + * @param type Interpolation type + * @param setter Setter function + * @param inheritable If this style propagates to child elements * * @tparam T1 Type of value used to retrieve value from property * node diff --git a/simgear/canvas/events/CustomEvent.hxx b/simgear/canvas/events/CustomEvent.hxx index 524f4e67..50f5ff5a 100644 --- a/simgear/canvas/events/CustomEvent.hxx +++ b/simgear/canvas/events/CustomEvent.hxx @@ -41,6 +41,7 @@ namespace canvas * * @param type_str Event type name (if name does not exist yet it will * be registered as new event type) + * @param bubbles If this event should take part in the bubbling phase * @param data Optional user data stored in event */ CustomEvent( std::string const& type_str, @@ -50,6 +51,7 @@ namespace canvas /** * * @param type_id Event type id + * @param bubbles If this event should take part in the bubbling phase * @param data Optional user data stored in event */ CustomEvent( int type_id, @@ -66,10 +68,16 @@ namespace canvas */ StringMap const& getDetail() const { return detail; } + /** + * Get whether this event supports bubbling. + * + * @see #bubbles + * @see CustomEvent() + */ virtual bool canBubble() const { return bubbles; } - StringMap detail; // - -#include - #include "iochannel.hxx" +#include /** * A file I/O class based on SGIOChannel. @@ -91,7 +85,4 @@ public: virtual bool eof() const { return eof_flag; }; }; - #endif // _SG_FILE_HXX - - diff --git a/simgear/math/interpolater.cxx b/simgear/math/interpolater.cxx index 7b956c95..c594e59c 100644 --- a/simgear/math/interpolater.cxx +++ b/simgear/math/interpolater.cxx @@ -36,8 +36,6 @@ #include "interpolater.hxx" -using std::string; - // Constructor -- starts with an empty table. SGInterpTable::SGInterpTable() { @@ -55,7 +53,7 @@ SGInterpTable::SGInterpTable(const SGPropertyNode* interpolation) // Constructor -- loads the interpolation table from the specified // file -SGInterpTable::SGInterpTable( const string& file ) +SGInterpTable::SGInterpTable( const std::string& file ) { SG_LOG( SG_MATH, SG_INFO, "Initializing Interpolator for " << file ); diff --git a/simgear/misc/sgstream.cxx b/simgear/misc/sgstream.cxx index c2ed93b5..27ebff8e 100644 --- a/simgear/misc/sgstream.cxx +++ b/simgear/misc/sgstream.cxx @@ -27,7 +27,6 @@ #include "sgstream.hxx" -using std::string; using std::istream; using std::ostream; @@ -40,7 +39,7 @@ sg_gzifstream::sg_gzifstream() // // Open a possibly gzipped file for reading. // -sg_gzifstream::sg_gzifstream( const string& name, ios_openmode io_mode ) +sg_gzifstream::sg_gzifstream( const std::string& name, ios_openmode io_mode ) : istream(&gzbuf) { this->open( name, io_mode ); @@ -65,12 +64,12 @@ sg_gzifstream::sg_gzifstream( int fd, ios_openmode io_mode ) // then append ".gz" and try again. // void -sg_gzifstream::open( const string& name, ios_openmode io_mode ) +sg_gzifstream::open( const std::string& name, ios_openmode io_mode ) { gzbuf.open( name.c_str(), io_mode ); if ( ! gzbuf.is_open() ) { - string s = name; + std::string s = name; if ( s.substr( s.length() - 3, 3 ) == ".gz" ) { // remove ".gz" suffix @@ -160,7 +159,7 @@ sg_gzofstream::sg_gzofstream() // // Open a file for gzipped writing. // -sg_gzofstream::sg_gzofstream( const string& name, ios_openmode io_mode ) +sg_gzofstream::sg_gzofstream( const std::string& name, ios_openmode io_mode ) : ostream(&gzbuf) { this->open( name, io_mode ); @@ -181,7 +180,7 @@ sg_gzofstream::sg_gzofstream( int fd, ios_openmode io_mode ) // Open a file for gzipped writing. // void -sg_gzofstream::open( const string& name, ios_openmode io_mode ) +sg_gzofstream::open( const std::string& name, ios_openmode io_mode ) { gzbuf.open( name.c_str(), io_mode ); } diff --git a/simgear/nasal/cppbind/NasalHash.hxx b/simgear/nasal/cppbind/NasalHash.hxx index a5ce4769..aac672fd 100644 --- a/simgear/nasal/cppbind/NasalHash.hxx +++ b/simgear/nasal/cppbind/NasalHash.hxx @@ -118,7 +118,6 @@ namespace nasal * * @tparam Sig Function signature * @param name Member name - * @param key Member key */ template typename boost::enable_if< boost::is_function, diff --git a/simgear/nasal/cppbind/NasalString.hxx b/simgear/nasal/cppbind/NasalString.hxx index e94dab7d..81153f23 100644 --- a/simgear/nasal/cppbind/NasalString.hxx +++ b/simgear/nasal/cppbind/NasalString.hxx @@ -47,7 +47,7 @@ namespace nasal * * @param str Existing Nasal String */ - String(naRef string); + String(naRef str); const char* c_str() const; const char* begin() const; diff --git a/simgear/nasal/data.h b/simgear/nasal/data.h index 5453d391..25f7008e 100644 --- a/simgear/nasal/data.h +++ b/simgear/nasal/data.h @@ -161,7 +161,7 @@ struct naFunc { struct naCCode { GC_HEADER; union { - naCFunction fptr; //getNameString()+"'"); err.append("\nname may contain only ._- and alphanumeric characters"); @@ -129,7 +128,7 @@ parse_name (const SGPropertyNode *node, const Range &path) else { if (path.begin() == i) { - string err = "'"; + std::string err = "'"; err.push_back(*i); err.append("' found in propertyname after '"+node->getNameString()+"'"); err.append("\nname must begin with alpha or '_'"); @@ -140,7 +139,7 @@ parse_name (const SGPropertyNode *node, const Range &path) } // Validate the name of a single node -inline bool validateName(const string& name) +inline bool validateName(const std::string& name) { using namespace boost; if (name.empty()) @@ -287,7 +286,7 @@ find_node_aux(SGPropertyNode * current, SplitItr& itr, bool create, if (equals(name, "..")) { SGPropertyNode * parent = current->getParent(); if (parent == 0) - throw string("attempt to move past root with '..'"); + throw std::string("attempt to move past root with '..'"); return find_node_aux(parent, ++itr, create, last_index); } int index = -1; @@ -320,10 +319,10 @@ find_node_aux(SGPropertyNode * current, SplitItr& itr, bool create, } } if (i == token.end() || *i != ']') - throw string("unterminated index (looking for ']')"); + throw std::string("unterminated index (looking for ']')"); } else { - throw string("illegal characters in token: ") - + string(name.begin(), name.end()); + throw std::string("illegal characters in token: ") + + std::string(name.begin(), name.end()); } } } @@ -733,12 +732,12 @@ SGPropertyNode::SGPropertyNode (Itr begin, Itr end, _local_val.string_val = 0; _value.val = 0; if (!validateName(_name)) - throw string("plain name expected instead of '") + _name + '\''; + throw std::string("plain name expected instead of '") + _name + '\''; } -SGPropertyNode::SGPropertyNode (const string& name, - int index, - SGPropertyNode * parent) +SGPropertyNode::SGPropertyNode( const std::string& name, + int index, + SGPropertyNode * parent) : _index(index), _name(name), _parent(parent), @@ -750,7 +749,7 @@ SGPropertyNode::SGPropertyNode (const string& name, _local_val.string_val = 0; _value.val = 0; if (!validateName(name)) - throw string("plain name expected instead of '") + _name + '\''; + throw std::string("plain name expected instead of '") + _name + '\''; } /** @@ -956,7 +955,7 @@ SGPropertyNode::getChild (const char * name, int index, bool create) } SGPropertyNode * -SGPropertyNode::getChild (const string& name, int index, bool create) +SGPropertyNode::getChild (const std::string& name, int index, bool create) { SGPropertyNode* node = getExistingChild(name.begin(), name.end(), index); if (node) { @@ -1072,10 +1071,10 @@ SGPropertyNode::removeAllChildren() _children.clear(); } -string +std::string SGPropertyNode::getDisplayName (bool simplify) const { - string display_name = _name; + std::string display_name = _name; if (_index != 0 || !simplify) { stringstream sstr; sstr << '[' << _index << ']'; @@ -1084,14 +1083,14 @@ SGPropertyNode::getDisplayName (bool simplify) const return display_name; } -string +std::string SGPropertyNode::getPath (bool simplify) const { typedef std::vector PList; PList pathList; for (const SGPropertyNode* node = this; node->_parent; node = node->_parent) pathList.push_back(node); - string result; + std::string result; for (PList::reverse_iterator itr = pathList.rbegin(), rend = pathList.rend(); itr != rend; @@ -1672,7 +1671,7 @@ bool SGPropertyNode::interpolate( const std::string& type, //------------------------------------------------------------------------------ bool SGPropertyNode::interpolate( const std::string& type, - const PropertyList& values, + const simgear::PropertyList& values, const double_list& deltas, const std::string& easing ) { @@ -1810,7 +1809,7 @@ SGPropertyNode::untie () } case props::STRING: case props::UNSPECIFIED: { - string val = getStringValue(); + std::string val = getStringValue(); clearValue(); _type = props::STRING; _local_val.string_val = copy_string(val.c_str()); diff --git a/simgear/props/props.hxx b/simgear/props/props.hxx index 8e17cc49..52a2bf91 100644 --- a/simgear/props/props.hxx +++ b/simgear/props/props.hxx @@ -252,15 +252,14 @@ class SGRawBase : public SGRawExtended /** * Abstract base class for a raw value. * - *

The property manager is implemented in two layers. The {@link - * SGPropertyNode} is the highest and most abstract layer, - * representing an LValue/RValue pair: it records the position of the - * property in the property tree and contains facilities for - * navigation to other nodes. It is guaranteed to be persistent: the - * {@link SGPropertyNode} will not change during a session, even if - * the property is bound and unbound multiple times.

+ * The property manager is implemented in two layers. The SGPropertyNode is the + * highest and most abstract layer, representing an LValue/RValue pair: it + * records the position of the property in the property tree and contains + * facilities for navigation to other nodes. It is guaranteed to be persistent: + * the SGPropertyNode will not change during a session, even if the property is + * bound and unbound multiple times. * - *

When the property value is not managed internally in the + * When the property value is not managed internally in the * SGPropertyNode, the SGPropertyNode will contain a reference to an * SGRawValue (this class), which provides an abstract way to get, * set, and clone the underlying value. The SGRawValue may change @@ -268,13 +267,12 @@ class SGRawBase : public SGRawExtended * unbound to various data source, but the abstract SGPropertyNode * layer insulates the application from those changes. * - *

The SGPropertyNode class always keeps a *copy* of a raw value, - * not the original one passed to it; if you override a derived class - * but do not replace the {@link #clone} method, strange things will - * happen.

+ * The SGPropertyNode class always keeps a *copy* of a raw value, not the + * original one passed to it; if you override a derived class but do not replace + * the {@link SGRaw::clone clone()} method, strange things will happen. * - *

All derived SGRawValue classes must implement {@link #getValue}, - * {@link #setValue}, and {@link #clone} for the appropriate type.

+ * All derived SGRawValue classes must implement getValue(), setValue(), and + * {@link SGRaw::clone clone()} for the appropriate type. * * @see SGPropertyNode * @see SGRawValuePointer @@ -696,9 +694,15 @@ class SGPropertyChangeListener { public: virtual ~SGPropertyChangeListener (); - virtual void valueChanged (SGPropertyNode * node); - virtual void childAdded (SGPropertyNode * parent, SGPropertyNode * child); - virtual void childRemoved (SGPropertyNode * parent, SGPropertyNode * child); + + /// Called if value of \a node has changed. + virtual void valueChanged(SGPropertyNode * node); + + /// Called if \a child has been added to the given \a parent. + virtual void childAdded(SGPropertyNode * parent, SGPropertyNode * child); + + /// Called if \a child has been removed from its \a parent. + virtual void childRemoved(SGPropertyNode * parent, SGPropertyNode * child); protected: friend class SGPropertyNode; @@ -1289,7 +1293,7 @@ public: * * @param type Type of interpolation ("numeric", "color", etc.) * @param values Nodes containing intermediate and target values - * @param duration Durations for each interpolation step (in seconds) + * @param deltas Durations for each interpolation step (in seconds) * @param easing Easing function (http://easings.net/) */ bool interpolate( const std::string& type, diff --git a/simgear/props/propsfwd.hxx b/simgear/props/propsfwd.hxx index 00e3697f..87998b59 100644 --- a/simgear/props/propsfwd.hxx +++ b/simgear/props/propsfwd.hxx @@ -1,5 +1,5 @@ -/** - * \file propsfwwd.hxx +/** \file + * * Forward declarations for properties (and related structures) */ @@ -9,10 +9,10 @@ #include class SGPropertyNode; - + typedef SGSharedPtr SGPropertyNode_ptr; typedef SGSharedPtr SGConstPropertyNode_ptr; - + class SGCondition; #endif // of SG_PROPS_FWD_HXX diff --git a/simgear/scene/material/EffectBuilder.hxx b/simgear/scene/material/EffectBuilder.hxx index 06b8ba9f..a919f10b 100644 --- a/simgear/scene/material/EffectBuilder.hxx +++ b/simgear/scene/material/EffectBuilder.hxx @@ -295,9 +295,9 @@ const SGPropertyNode* getEffectPropertyChild(Effect* effect, const char* name); /** - * Get the name of a node mentioned in a clause from the global property + * Get the name of a node mentioned in a \ clause from the global property * tree. - * @return empty if prop doesn't contain a clause; otherwise the + * @return empty if prop doesn't contain a \ clause; otherwise the * mentioned node name. */ std::string getGlobalProperty(const SGPropertyNode* prop, @@ -597,9 +597,9 @@ inline void setDynamicVariance(osg::Object* obj) /** * Initialize the value and the possible updating of an effect * attribute. If the value is specified directly, set it. Otherwise, - * use the tag to look at the parameters. Again, if there is a + * use the \ tag to look at the parameters. Again, if there is a * value there set it directly. Otherwise, the parameter contains its - * own tag referring to a property in the global property tree; + * own \ tag referring to a property in the global property tree; * install a change listener that will set the attribute when the * property changes. * @@ -641,12 +641,12 @@ initFromParameters(Effect* effect, const SGPropertyNode* prop, ObjType* obj, * The parameter may be updated at runtime. * * If the value is specified directly, set it. Otherwise, use the - * tag to look at the parameters. Again, if there is a value + * \ tag to look at the parameters. Again, if there is a value * there set it directly. Otherwise, the parameter contains one or several - * tags. If there is one tag, it is a property that is the root + * \ tags. If there is one tag, it is a property that is the root * for the values needed to update the parameter; nameIter holds the * names of the properties relative to the root. If there are several - * tags, they each hold the name of the property holding the + * \ tags, they each hold the name of the property holding the * value for the corresponding vector member. * * Install a change listener that will set the attribute when the diff --git a/simgear/scene/material/mat.cxx b/simgear/scene/material/mat.cxx index 2fe25104..7d661dbb 100644 --- a/simgear/scene/material/mat.cxx +++ b/simgear/scene/material/mat.cxx @@ -68,10 +68,8 @@ #include "Pass.hxx" using std::map; -using std::string; using namespace simgear; - //////////////////////////////////////////////////////////////////////// // Constructors and destructor. //////////////////////////////////////////////////////////////////////// @@ -82,8 +80,10 @@ SGMaterial::_internal_state::_internal_state(Effect *e, bool l, { } -SGMaterial::_internal_state::_internal_state(Effect *e, const string &t, bool l, - const SGReaderWriterOptions* o) +SGMaterial::_internal_state::_internal_state( Effect *e, + const std::string &t, + bool l, + const SGReaderWriterOptions* o ) : effect(e), effect_realized(l), options(o) { texture_paths.push_back(std::make_pair(t,0)); @@ -132,7 +132,7 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options, std::vector textures = props->getChildren("texture"); for (unsigned int i = 0; i < textures.size(); i++) { - string tname = textures[i]->getStringValue(); + std::string tname = textures[i]->getStringValue(); if (tname.empty()) { tname = "unknown.rgb"; @@ -140,7 +140,7 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options, SGPath tpath("Textures.high"); tpath.append(tname); - string fullTexPath = SGModelLib::findDataFile(tpath.str(), options); + std::string fullTexPath = SGModelLib::findDataFile(tpath.str(), options); if (fullTexPath.empty()) { tpath.set("Textures"); tpath.append(tname); @@ -170,14 +170,14 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options, std::vector textures = texturesets[i]->getChildren("texture"); for (unsigned int j = 0; j < textures.size(); j++) { - string tname = textures[j]->getStringValue(); + std::string tname = textures[j]->getStringValue(); if (tname.empty()) { tname = "unknown.rgb"; } SGPath tpath("Textures.high"); tpath.append(tname); - string fullTexPath = SGModelLib::findDataFile(tpath.str(), options); + std::string fullTexPath = SGModelLib::findDataFile(tpath.str(), options); if (fullTexPath.empty()) { tpath.set("Textures"); tpath.append(tname); @@ -215,12 +215,13 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options, std::vector masks = props->getChildren("object-mask"); for (unsigned int i = 0; i < masks.size(); i++) { - string omname = masks[i]->getStringValue(); + std::string omname = masks[i]->getStringValue(); if (! omname.empty()) { SGPath ompath("Textures.high"); ompath.append(omname); - string fullMaskPath = SGModelLib::findDataFile(ompath.str(), options); + std::string fullMaskPath = + SGModelLib::findDataFile(ompath.str(), options); if (fullMaskPath.empty()) { ompath.set("Textures"); @@ -279,7 +280,8 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options, building_coverage = props->getDoubleValue("building-coverage", 0.0); building_spacing = props->getDoubleValue("building-spacing-m", 5.0); - string bt = props->getStringValue("building-texture", "Textures/buildings.png"); + std::string bt = props->getStringValue( "building-texture", + "Textures/buildings.png" ); building_texture = SGModelLib::findDataFile(bt, options); if (building_texture.empty()) { @@ -340,7 +342,7 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options, const SGPropertyNode* treeTexNode = props->getChild("tree-texture"); if (treeTexNode) { - string treeTexPath = props->getStringValue("tree-texture"); + std::string treeTexPath = props->getStringValue("tree-texture"); if (! treeTexPath.empty()) { SGPath treePath("Textures.high"); @@ -540,9 +542,9 @@ void SGMaterial::buildEffectProperties(const SGReaderWriterOptions* options) } } -SGMaterialGlyph* SGMaterial::get_glyph (const string& name) const +SGMaterialGlyph* SGMaterial::get_glyph (const std::string& name) const { - map >::const_iterator it; + map >::const_iterator it; it = glyphs.find(name); if (it == glyphs.end()) return 0; diff --git a/simgear/scene/model/ConditionNode.cxx b/simgear/scene/model/ConditionNode.cxx index 93a28cd1..7144ebab 100644 --- a/simgear/scene/model/ConditionNode.cxx +++ b/simgear/scene/model/ConditionNode.cxx @@ -32,7 +32,7 @@ ConditionNode::ConditionNode() { } -ConditionNode::ConditionNode(const ConditionNode& rhs, const CopyOp& op) +ConditionNode::ConditionNode(const ConditionNode& rhs, const osg::CopyOp& op) : Group(rhs, op), _condition(rhs._condition) { } diff --git a/simgear/scene/model/model.cxx b/simgear/scene/model/model.cxx index 47a7a0dc..a7deb4a4 100644 --- a/simgear/scene/model/model.cxx +++ b/simgear/scene/model/model.cxx @@ -100,7 +100,7 @@ TextureUpdateVisitor::TextureUpdateVisitor(const osgDB::FilePathList& pathList) { } -void TextureUpdateVisitor::apply(Node& node) +void TextureUpdateVisitor::apply(osg::Node& node) { StateSet* stateSet = cloneStateSet(node.getStateSet()); if (stateSet) diff --git a/simgear/scene/sky/cloud.cxx b/simgear/scene/sky/cloud.cxx index e41d170b..db5bd09d 100644 --- a/simgear/scene/sky/cloud.cxx +++ b/simgear/scene/sky/cloud.cxx @@ -500,8 +500,12 @@ bool SGCloudLayer::repaint( const SGVec3f& fog_color ) { // lat specifies a rotation about the new Y axis // spin specifies a rotation about the new Z axis (and orients the // sunrise/set effects -bool SGCloudLayer::reposition( const SGVec3f& p, const SGVec3f& up, double lon, double lat, - double alt, double dt ) +bool SGCloudLayer::reposition( const SGVec3f& p, + const SGVec3f& up, + double lon, + double lat, + double alt, + double dt ) { if (getCoverage() != SGCloudLayer::SG_CLOUD_CLEAR) diff --git a/simgear/scene/sky/cloud.hxx b/simgear/scene/sky/cloud.hxx index c79481af..fb4cf3c5 100644 --- a/simgear/scene/sky/cloud.hxx +++ b/simgear/scene/sky/cloud.hxx @@ -214,13 +214,13 @@ public: * orientation. * @param p position vector * @param up the local up vector - * @param lon specifies a rotation about the Z axis - * @param lat specifies a rotation about the new Y axis - * @param spin specifies a rotation about the new Z axis - * (and orients the sunrise/set effects) + * @param lon TODO + * @param lat TODO + * @param alt TODO * @param dt the time elapsed since the last call */ - bool reposition( const SGVec3f& p, const SGVec3f& up, + bool reposition( const SGVec3f& p, + const SGVec3f& up, double lon, double lat, double alt, double dt = 0.0 ); diff --git a/simgear/scene/sky/sky.cxx b/simgear/scene/sky/sky.cxx index 71160207..389d8bf4 100644 --- a/simgear/scene/sky/sky.cxx +++ b/simgear/scene/sky/sky.cxx @@ -79,9 +79,12 @@ SGSky::~SGSky( void ) // initialize the sky and connect the components to the scene graph at // the provided branch -void SGSky::build( double h_radius_m, double v_radius_m, - double sun_size, double moon_size, - const SGEphemeris& eph, SGPropertyNode *property_tree_node, +void SGSky::build( double h_radius_m, + double v_radius_m, + double sun_size, + double moon_size, + const SGEphemeris& eph, + SGPropertyNode *property_tree_node, simgear::SGReaderWriterOptions* options ) { dome = new SGSkyDome; diff --git a/simgear/scene/sky/sky.hxx b/simgear/scene/sky/sky.hxx index 6b99d4ac..a824b74a 100644 --- a/simgear/scene/sky/sky.hxx +++ b/simgear/scene/sky/sky.hxx @@ -29,10 +29,6 @@ #define _SG_SKY_HXX -#ifndef __cplusplus -# error This library requires C++ -#endif - #include #include #include @@ -57,29 +53,36 @@ namespace simgear { class SGReaderWriterOptions; } -typedef struct { - SGVec3d pos; - SGGeod pos_geod; - SGQuatd ori; - double spin; - double gst; - double sun_dist; - double moon_dist; - double sun_angle; -} SGSkyState; - -typedef struct { - SGVec3f sky_color; - SGVec3f adj_sky_color; - SGVec3f fog_color; - SGVec3f cloud_color; - double sun_angle, moon_angle; -} SGSkyColor; +struct SGSkyState +{ + SGVec3d pos; //!< View position in world Cartesian coordinates. + SGGeod pos_geod; + SGQuatd ori; + double spin; //!< An offset angle for orienting the sky effects with the + // sun position so sunset and sunrise effects look correct. + double gst; //!< GMT side real time. + double sun_dist; //!< the sun's distance from the current view point + // (to keep it inside your view volume). + double moon_dist;//!< The moon's distance from the current view point. + double sun_angle; +}; + +struct SGSkyColor +{ + SGVec3f sky_color; + SGVec3f adj_sky_color; + SGVec3f fog_color; + SGVec3f cloud_color; + double sun_angle, + moon_angle; +}; /** + * \anchor SGSky-details + * * A class to model a realistic (time/date/position) based sky. * - * Introduction + * Introduction * * The SGSky class models a blended sky dome, a haloed sun, a textured * moon with phase that properly matches the date, stars and planets, @@ -164,10 +167,10 @@ typedef struct { * A typical application might do the following: - *
  • thesky->preDraw( my_altitude ); - *
  • thesky->drawUpperClouds(); - *
  • ssgCullAndDraw ( myscene ) ; - *
  • thesky->drawLowerClouds(); + * \li thesky->preDraw( my_altitude ); + * \li thesky->drawUpperClouds(); + * \li ssgCullAndDraw ( myscene ) ; + * \li thesky->drawLowerClouds(); * The current altitude in meters is passed to the preDraw() method * so the clouds layers can be rendered correction from most distant @@ -261,84 +264,54 @@ public: /** * Initialize the sky and connect the components to the scene - * graph at the provided branch. See discussion in detailed class - * description. - * @param h_radius_m horizontal radius of sky dome - * @param v_radius_m vertical radius of sky dome - * @param sun_size size of sun - * @param moon_size size of moon - * @param nplanets number of planets - * @param planet_data an array of planet right ascensions, declinations, - * and magnitudes - * @param nstars number of stars - * @param star_data an array of star right ascensions, declinations, - * and magnitudes + * graph at the provided branch. + * + * @note See discussion in \ref SGSky-details "detailed class description". + * + * @param h_radius_m Horizontal radius of sky dome + * @param v_radius_m Vertical radius of sky dome + * @param sun_size Size of sun + * @param moon_size Size of moon + * @param eph Current positions of planets and stars + * @param node Property node connecting sun with environment + * @param options */ - void build( double h_radius_m, double v_radius_m, - double sun_size, double moon_size, - const SGEphemeris& eph, SGPropertyNode *property_tree_node, - simgear::SGReaderWriterOptions* options); + void build( double h_radius_m, + double v_radius_m, + double sun_size, + double moon_size, + const SGEphemeris& eph, + SGPropertyNode *node, + simgear::SGReaderWriterOptions* options ); /** - * Repaint the sky components based on current value of sun_angle, - * sky, and fog colors. You can also specify new star and planet - * data so that we can optionally change the magnitude of these - * (for day/night transitions.) See discussion in detailed - * class description. + * Repaint the sky components based on current sun angle, and sky and fog + * colors. + * + * @note See discussion in \ref SGSky-details "detailed class description". * - * Sun and moon angles are specified in degrees relative to local up - *
  • 0 degrees = high noon - *
  • 90 degrees = sun rise/set - *
  • 180 degrees = darkest midnight - * @param sky_color the base sky color (for the top of the dome) - * @param fog_color the fog color (for the horizon) - * @param sun_angle the sun angle with the horizon (for sunrise/sunset - * effects) - * @param moon_angle the moon angle (so we can make it more yellow - * at the horizon) - * @param nplanets number of planets - * @param planet_data an array of planet right ascensions, declinations, - * and magnitudes - * @param nstars number of stars - * @param star_data an array of star right ascensions, declinations, - * and magnitudes + * @param sky_color The base sky color (for the top of the dome) + * @param eph Current positions of planets and stars */ - bool repaint( const SGSkyColor &sc, const SGEphemeris& eph ); + bool repaint( const SGSkyColor &sky_color, + const SGEphemeris& eph ); /** - * Reposition the sky at the specified origin and orientation + * Reposition the sky at the specified origin and orientation. + * + * @note See discussion in \ref SGSky-details "detailed class description". * - * lon specifies a rotation about the Z axis - * lat specifies a rotation about the new Y axis - * spin specifies a rotation about the new Z axis (this allows - * additional orientation for the sunrise/set effects and is used - * by the skydome and perhaps clouds. See discussion in detailed - * class description. - * @param view_pos specify your view position in world Cartesian - * coordinates - * @param zero_elev the zero elevation position in world Cartesian - * coordinates - * @param view_up the up vector in world Cartesian coordinates - * @param lon current longitude - * @param lat current latitude - * @param alt current altitude - * @param spin an offset angle for orienting the sky effects with the - * sun position so sunset and sunrise effects look correct. - * @param gst GMT side real time - * @param sun_ra the sun's current right ascension - * @param sun_dec the sun's current declination - * @param sun_dist the sun's distance from the current view point - * (to keep it inside your view volume.) - * @param moon_ra the moon's current right ascension - * @param moon_dec the moon's current declination - * @param moon_dist the moon's distance from the current view point. */ - bool reposition( const SGSkyState &st, const SGEphemeris& eph, double dt = 0.0 ); + bool reposition( const SGSkyState& sky_state, + const SGEphemeris& eph, + double dt = 0.0 ); /** * Modify the given visibility based on cloud layers, thickness, - * transition range, and simulated "puffs". See discussion in detailed - * class description. + * transition range, and simulated "puffs". + * + * @note See discussion in \ref SGSky-details "detailed class description". + * * @param alt current altitude * @param time_factor amount of time since modify_vis() last called so * we can scale effect rates properly despite variable frame rates. @@ -350,7 +323,8 @@ public: /** * Specify the texture path (optional, defaults to current directory) - * @param path base path to texture locations + * + * @param path Base path to texture locations */ void texture_path( const std::string& path ); @@ -424,7 +398,8 @@ public: float get_3dCloudVisRange() const; /** Set 3D cloud visibility range - * @param density 3D cloud visibility range + * + * @param vis 3D cloud visibility range */ void set_3dCloudVisRange(float vis); @@ -432,7 +407,8 @@ public: float get_3dCloudImpostorDistance() const; /** Set 3D cloud impostor distance - * @param density 3D cloud impostor distance + * + * @param vis 3D cloud impostor distance */ void set_3dCloudImpostorDistance(float vis); @@ -456,7 +432,8 @@ public: bool get_3dCloudUseImpostors() const; /** Set 3D cloud impostor usage - * @param wrap whether use impostors for 3D clouds + * + * @param imp whether use impostors for 3D clouds */ void set_3dCloudUseImpostors(bool imp); diff --git a/simgear/scene/tgdb/SGOceanTile.cxx b/simgear/scene/tgdb/SGOceanTile.cxx index f990f946..c550280c 100644 --- a/simgear/scene/tgdb/SGOceanTile.cxx +++ b/simgear/scene/tgdb/SGOceanTile.cxx @@ -111,7 +111,6 @@ public: void calcApronPts(double tex_width); }; -} void OceanMesh::calcMesh(const SGVec3d& cartCenter, const SGQuatd& orient, double clon, double clat, @@ -238,8 +237,6 @@ void OceanMesh::calcApronPts(double tex_width) } } -namespace -{ // Enter the vertices of triangles that fill one row of the // mesh. The vertices are entered in counter-clockwise order. void fillDrawElementsRow(int width, short row0Start, short row1Start, diff --git a/simgear/scene/util/NodeAndDrawableVisitor.cxx b/simgear/scene/util/NodeAndDrawableVisitor.cxx index 257171c7..22e7595e 100644 --- a/simgear/scene/util/NodeAndDrawableVisitor.cxx +++ b/simgear/scene/util/NodeAndDrawableVisitor.cxx @@ -28,14 +28,18 @@ namespace simgear { using namespace osg; -NodeAndDrawableVisitor::NodeAndDrawableVisitor(NodeVisitor::TraversalMode tm) : - NodeVisitor(tm) +NodeAndDrawableVisitor::NodeAndDrawableVisitor( + osg::NodeVisitor::TraversalMode tm +): + NodeVisitor(tm) { } -NodeAndDrawableVisitor::NodeAndDrawableVisitor(NodeVisitor::VisitorType type, - NodeVisitor::TraversalMode tm) : - NodeVisitor(type, tm) +NodeAndDrawableVisitor::NodeAndDrawableVisitor( + osg::NodeVisitor::VisitorType type, + osg::NodeVisitor::TraversalMode tm +): + NodeVisitor(type, tm) { } @@ -43,16 +47,16 @@ NodeAndDrawableVisitor::~NodeAndDrawableVisitor() { } -void NodeAndDrawableVisitor::apply(Node& node) +void NodeAndDrawableVisitor::apply(osg::Node& node) { traverse(node); } -void NodeAndDrawableVisitor::apply(Drawable& Drawable) +void NodeAndDrawableVisitor::apply(osg::Drawable& Drawable) { } -void NodeAndDrawableVisitor::traverse(Node& node) +void NodeAndDrawableVisitor::traverse(osg::Node& node) { TraversalMode tm = getTraversalMode(); if (tm == TRAVERSE_NONE) { diff --git a/simgear/scene/util/OsgDebug.hxx b/simgear/scene/util/OsgDebug.hxx index 290d407c..89930898 100644 --- a/simgear/scene/util/OsgDebug.hxx +++ b/simgear/scene/util/OsgDebug.hxx @@ -1,4 +1,5 @@ -///@file Helper for OSG related debugging +///@file +/// Helper for OSG related debugging // // Copyright (C) 2013 Thomas Geymayer // diff --git a/simgear/scene/util/SplicingVisitor.cxx b/simgear/scene/util/SplicingVisitor.cxx index 1f285949..5421d873 100644 --- a/simgear/scene/util/SplicingVisitor.cxx +++ b/simgear/scene/util/SplicingVisitor.cxx @@ -16,7 +16,7 @@ void SplicingVisitor::reset() NodeVisitor::reset(); } -NodeList SplicingVisitor::traverse(Node& node) +NodeList SplicingVisitor::traverse(osg::Node& node) { NodeList result; _childStack.push_back(NodeList()); @@ -25,21 +25,22 @@ NodeList SplicingVisitor::traverse(Node& node) _childStack.pop_back(); return result; } -void SplicingVisitor::apply(Node& node) +void SplicingVisitor::apply(osg::Node& node) { NodeVisitor::traverse(node); pushNode(&node); } -void SplicingVisitor::apply(Group& node) +void SplicingVisitor::apply(osg::Group& node) { if (pushNode(getNewNode(node))) return; pushResultNode(&node, &node, traverse(node)); } -Group* SplicingVisitor::pushResultNode(Group* node, Group* newNode, - const NodeList& children) +osg::Group* SplicingVisitor::pushResultNode( osg::Group* node, + osg::Group* newNode, + const osg::NodeList& children ) { ref_ptr result; if (node == newNode) { @@ -56,21 +57,21 @@ Group* SplicingVisitor::pushResultNode(Group* node, Group* newNode, return result.get(); } -Node* SplicingVisitor::pushResultNode(Node* node, Node* newNode) +osg::Node* SplicingVisitor::pushResultNode(osg::Node* node, osg::Node* newNode) { _childStack.back().push_back(newNode); recordNewNode(node, newNode); return newNode; } -Node* SplicingVisitor::pushNode(Node* node) +osg::Node* SplicingVisitor::pushNode(osg::Node* node) { if (node) _childStack.back().push_back(node); return node; } -Node* SplicingVisitor::getResult() +osg::Node* SplicingVisitor::getResult() { NodeList& top = _childStack.at(0); if (top.empty()) { @@ -87,7 +88,7 @@ Node* SplicingVisitor::getResult() } } -Node* SplicingVisitor::getNewNode(osg::Node* node) +osg::Node* SplicingVisitor::getNewNode(osg::Node* node) { ref_ptr tmpPtr(node); NodeMap::iterator itr; diff --git a/simgear/sound/sample_group.cxx b/simgear/sound/sample_group.cxx index 78efd167..f4c64d46 100644 --- a/simgear/sound/sample_group.cxx +++ b/simgear/sound/sample_group.cxx @@ -33,8 +33,6 @@ #include "soundmgr_openal_private.hxx" #include "sample_group.hxx" -using std::string; - #ifdef HAVE_STD_ISNAN using std::isnan; #endif @@ -57,7 +55,8 @@ SGSampleGroup::SGSampleGroup () : _samples.clear(); } -SGSampleGroup::SGSampleGroup ( SGSoundMgr *smgr, const string &refname ) : +SGSampleGroup::SGSampleGroup ( SGSoundMgr *smgr, + const std::string &refname ): _smgr(smgr), _refname(refname), _active(false), @@ -227,8 +226,9 @@ void SGSampleGroup::update( double dt ) { } // add a sound effect, return true if successful -bool SGSampleGroup::add( SGSharedPtr sound, const string& refname ) { - +bool SGSampleGroup::add( SGSharedPtr sound, + const std::string& refname ) +{ sample_map_iterator sample_it = _samples.find( refname ); if ( sample_it != _samples.end() ) { // sample name already exists @@ -241,7 +241,7 @@ bool SGSampleGroup::add( SGSharedPtr sound, const string& refname // remove a sound effect, return true if successful -bool SGSampleGroup::remove( const string &refname ) { +bool SGSampleGroup::remove( const std::string &refname ) { sample_map_iterator sample_it = _samples.find( refname ); if ( sample_it == _samples.end() ) { @@ -259,7 +259,7 @@ bool SGSampleGroup::remove( const string &refname ) { // return true of the specified sound exists in the sound manager system -bool SGSampleGroup::exists( const string &refname ) { +bool SGSampleGroup::exists( const std::string &refname ) { sample_map_iterator sample_it = _samples.find( refname ); if ( sample_it == _samples.end() ) { // sample was not found @@ -272,7 +272,7 @@ bool SGSampleGroup::exists( const string &refname ) { // return a pointer to the SGSoundSample if the specified sound exists // in the sound manager system, otherwise return NULL -SGSoundSample *SGSampleGroup::find( const string &refname ) { +SGSoundSample *SGSampleGroup::find( const std::string &refname ) { sample_map_iterator sample_it = _samples.find( refname ); if ( sample_it == _samples.end() ) { // sample was not found @@ -353,7 +353,9 @@ SGSampleGroup::resume () // tell the scheduler to play the indexed sample in a continuous loop -bool SGSampleGroup::play( const string &refname, bool looping = false ) { +bool SGSampleGroup::play( const std::string &refname, + bool looping ) +{ SGSoundSample *sample = find( refname ); if ( sample == NULL ) { @@ -366,7 +368,7 @@ bool SGSampleGroup::play( const string &refname, bool looping = false ) { // return true of the specified sound is currently being played -bool SGSampleGroup::is_playing( const string& refname ) { +bool SGSampleGroup::is_playing( const std::string& refname ) { SGSoundSample *sample = find( refname ); if ( sample == NULL ) { @@ -377,7 +379,7 @@ bool SGSampleGroup::is_playing( const string& refname ) { } // immediate stop playing the sound -bool SGSampleGroup::stop( const string& refname ) { +bool SGSampleGroup::stop( const std::string& refname ) { SGSoundSample *sample = find( refname ); if ( sample == NULL ) { @@ -488,7 +490,7 @@ void SGSampleGroup::update_sample_config( SGSoundSample *sample ) #endif } -bool SGSampleGroup::testForError(void *p, string s) +bool SGSampleGroup::testForError(void *p, std::string s) { if (p == NULL) { SG_LOG( SG_SOUND, SG_ALERT, "Error (sample group): " << s); @@ -497,7 +499,7 @@ bool SGSampleGroup::testForError(void *p, string s) return false; } -bool SGSampleGroup::testForALError(string s) +bool SGSampleGroup::testForALError(std::string s) { #ifdef SG_C ALenum error = alGetError(); diff --git a/simgear/sound/sample_group.hxx b/simgear/sound/sample_group.hxx index eb850b3b..f87cb1dc 100644 --- a/simgear/sound/sample_group.hxx +++ b/simgear/sound/sample_group.hxx @@ -1,30 +1,26 @@ -// sample_group.hxx -- Manage a group of samples relative to a base position +///@file +/// Manage a group of samples relative to a base position +/// +/// Sample groups contain all sounds related to one specific object and +/// have to be added to the sound manager, otherwise they won't get processed. // // Written for the new SoundSystem by Erik Hofman, October 2009 // // Copyright (C) 2009 Erik Hofman // -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. // -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. +// Library General Public License for more details. // -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// $Id$ - -/** - * \file sample_group.hxx - * sample groups contain all sounds related to one specific object and - * have to be added to the sound manager, otherwise they won't get processed. - */ +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef _SG_SAMPLE_GROUP_OPENAL_HXX #define _SG_SAMPLE_GROUP_OPENAL_HXX 1 @@ -137,7 +133,7 @@ public: * @param looping Define if the sound should loop continuously * @return true if the audio sample exsists and is scheduled for playing */ - bool play( const std::string& refname, bool looping ); + bool play( const std::string& refname, bool looping = false ); /** * Request to start playing the referred audio sample looping. diff --git a/simgear/sound/sample_openal.hxx b/simgear/sound/sample_openal.hxx index ba3fef3d..fd9216d8 100644 --- a/simgear/sound/sample_openal.hxx +++ b/simgear/sound/sample_openal.hxx @@ -1,4 +1,5 @@ -// sample_openal.hxx -- Audio sample encapsulation class +///@file +/// Provides an audio sample encapsulation class. // // Written by Curtis Olson, started April 2004. // Modified to match the new SoundSystem by Erik Hofman, October 2009 @@ -6,26 +7,19 @@ // Copyright (C) 2004 Curtis L. Olson - http://www.flightgear.org/~curt // Copyright (C) 2009 Erik Hofman // -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. // -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. +// Library General Public License for more details. // -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// $Id$ - -/** - * \file audio sample.hxx - * Provides a audio sample encapsulation - */ +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef _SG_SAMPLE_HXX #define _SG_SAMPLE_HXX 1 @@ -45,7 +39,9 @@ class SGPath; /** - * manages everything we need to know for an individual audio sample + * Encapsulate and audio sample. + * + * Manages everything we need to know for an individual audio sample. */ class SGSoundSample : public SGReferenced { @@ -95,6 +91,7 @@ public: * Test if this audio sample configuration has changed since the last call. * Calling this function will reset the flag so calling it a second * time in a row will return false. + * * @return Return true is the configuration has changed in the mean time. */ bool has_changed() { @@ -105,6 +102,7 @@ public: * Test if static data of audio sample configuration has changed. * Calling this function will reset the flag so calling it a second * time in a row will return false. + * * @return Return true is the static data has changed in the mean time. */ bool has_static_data_changed() { @@ -114,7 +112,8 @@ public: /** * Schedule this audio sample for playing. Actual playing will only start * at the next call op SoundGroup::update() - * @param _loop Define whether this sound should be played in a loop. + * + * @param loop Whether this sound should be played in a loop. */ void play( bool loop = false ) { _playing = true; _loop = loop; _changed = true; _static_changed = true; @@ -122,6 +121,7 @@ public: /** * Check if this audio sample is set to be continuous looping. + * * @return Return true if this audio sample is set to looping. */ inline bool is_looping() { return _loop; } @@ -405,7 +405,8 @@ public: /** * Set the velocity vector (in meters per second) of this sound. * This is in the local frame coordinate system; x=north, y=east, z=down - * @param Velocity vector + * + * @param vel Velocity vector */ inline void set_velocity( const SGVec3f& vel ) { _velocity = vel; _changed = true; diff --git a/simgear/sound/sample_queue.hxx b/simgear/sound/sample_queue.hxx index 2b11393a..e3725702 100644 --- a/simgear/sound/sample_queue.hxx +++ b/simgear/sound/sample_queue.hxx @@ -1,37 +1,27 @@ -// queue.hxx -- Sample Queue encapsulation class -// +///@file +/// Provides a sample queue encapsulation +// // based on sample.hxx // // Copyright (C) 2010 Erik Hofman // -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. // -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. +// Library General Public License for more details. // -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// $Id$ - -/** - * \file audio sample.hxx - * Provides a sample queue encapsulation - */ +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef _SG_QUEUE_HXX #define _SG_QUEUE_HXX 1 -#ifndef __cplusplus -# error This library requires C++ -#endif - #include #include @@ -68,20 +58,23 @@ public: virtual void stop(); /** - * Queue new data for this audio sample - * @param data Pointer to a memory block containg this audio sample data. - * @param len length of the sample buffer in bytes + * Queue new data for this audio sample. + * + * @param data Pointer to a memory block containg this audio sample data. + * @param len Length of the sample buffer in bytes. */ - void add( const void* smp_data, size_t len ); + void add( const void* data, size_t len ); /** - * Set the source id of this source + * Set the source id of this source. + * * @param sid OpenAL source-id */ virtual void set_source(unsigned int sid); /** * Test if the buffer-id of this audio sample may be passed to OpenAL. + * * @return false for sample queue */ inline bool is_valid_buffer() const { return false; } diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index 910653b1..a3e1d3d7 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -45,7 +45,6 @@ #include #include -using std::string; using std::vector; @@ -408,7 +407,7 @@ if (isNaN(_velocity.data())) printf("NaN in listener velocity\n"); } // add a sample group, return true if successful -bool SGSoundMgr::add( SGSampleGroup *sgrp, const string& refname ) +bool SGSoundMgr::add( SGSampleGroup *sgrp, const std::string& refname ) { sample_group_map_iterator sample_grp_it = d->_sample_groups.find( refname ); if ( sample_grp_it != d->_sample_groups.end() ) { @@ -424,7 +423,7 @@ bool SGSoundMgr::add( SGSampleGroup *sgrp, const string& refname ) // remove a sound effect, return true if successful -bool SGSoundMgr::remove( const string &refname ) +bool SGSoundMgr::remove( const std::string &refname ) { sample_group_map_iterator sample_grp_it = d->_sample_groups.find( refname ); if ( sample_grp_it == d->_sample_groups.end() ) { @@ -439,7 +438,7 @@ bool SGSoundMgr::remove( const string &refname ) // return true of the specified sound exists in the sound manager system -bool SGSoundMgr::exists( const string &refname ) { +bool SGSoundMgr::exists( const std::string &refname ) { sample_group_map_iterator sample_grp_it = d->_sample_groups.find( refname ); return ( sample_grp_it != d->_sample_groups.end() ); } @@ -447,7 +446,7 @@ bool SGSoundMgr::exists( const string &refname ) { // return a pointer to the SGSampleGroup if the specified sound exists // in the sound manager system, otherwise return NULL -SGSampleGroup *SGSoundMgr::find( const string &refname, bool create ) { +SGSampleGroup *SGSoundMgr::find( const std::string &refname, bool create ) { sample_group_map_iterator sample_grp_it = d->_sample_groups.find( refname ); if ( sample_grp_it == d->_sample_groups.end() ) { // sample group was not found. @@ -524,7 +523,7 @@ unsigned int SGSoundMgr::request_buffer(SGSoundSample *sample) #ifdef ENABLE_SOUND if ( !sample->is_valid_buffer() ) { // sample was not yet loaded or removed again - string sample_name = sample->get_sample_name(); + std::string sample_name = sample->get_sample_name(); void *sample_data = NULL; // see if the sample name is already cached @@ -588,7 +587,7 @@ void SGSoundMgr::release_buffer(SGSoundSample *sample) { if ( !sample->is_queue() ) { - string sample_name = sample->get_sample_name(); + std::string sample_name = sample->get_sample_name(); buffer_map_iterator buffer_it = d->_buffers.find( sample_name ); if ( buffer_it == d->_buffers.end() ) { // buffer was not found @@ -608,8 +607,11 @@ void SGSoundMgr::release_buffer(SGSoundSample *sample) } } -bool SGSoundMgr::load(const string &samplepath, void **dbuf, int *fmt, - size_t *sz, int *frq ) +bool SGSoundMgr::load( const std::string &samplepath, + void **dbuf, + int *fmt, + size_t *sz, + int *frq ) { if ( !is_working() ) return false; @@ -668,7 +670,7 @@ vector SGSoundMgr::get_available_devices() } -bool SGSoundMgr::testForError(void *p, string s) +bool SGSoundMgr::testForError(void *p, std::string s) { if (p == NULL) { SG_LOG( SG_SOUND, SG_ALERT, "Error: " << s); @@ -678,7 +680,7 @@ bool SGSoundMgr::testForError(void *p, string s) } -bool SGSoundMgr::testForALError(string s) +bool SGSoundMgr::testForALError(std::string s) { #ifdef ENABLE_SOUND ALenum error = alGetError(); @@ -691,7 +693,7 @@ bool SGSoundMgr::testForALError(string s) return false; } -bool SGSoundMgr::testForALCError(string s) +bool SGSoundMgr::testForALCError(std::string s) { #ifdef ENABLE_SOUND ALCenum error; diff --git a/simgear/sound/soundmgr_openal.hxx b/simgear/sound/soundmgr_openal.hxx index d8c2c19a..58168fc8 100644 --- a/simgear/sound/soundmgr_openal.hxx +++ b/simgear/sound/soundmgr_openal.hxx @@ -1,4 +1,8 @@ -// soundmgr.hxx -- Sound effect management class +///@file +/// Sound effect management class +/// +/// Provides a sound manager class to keep track of multiple sounds and manage +/// playing them with different effects and timings. // // Sound manager initially written by David Findlay // 2001 @@ -9,28 +13,19 @@ // Copyright (C) 2001 Curtis L. Olson - http://www.flightgear.org/~curt // Copyright (C) 2009 Erik Hofman // -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. // -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. +// Library General Public License for more details. // -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// $Id$ - -/** - * \file soundmgr.hxx - * Provides a sound manager class to keep track of - * multiple sounds and manage playing them with different effects and - * timings. - */ +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef _SG_SOUNDMGR_OPENAL_HXX #define _SG_SOUNDMGR_OPENAL_HXX 1 @@ -114,13 +109,16 @@ public: /** * Find a specified sample group in the sound manager + * * @param refname Reference name of the sample group to find + * @param create If the group should be create if it does not exist * @return A pointer to the SGSampleGroup */ SGSampleGroup *find( const std::string& refname, bool create = false ); /** * Set the Cartesian position of the sound manager. + * * @param pos OpenAL listener position */ void set_position( const SGVec3d& pos, const SGGeod& pos_geod ); @@ -132,6 +130,7 @@ public: /** * Get the position of the sound manager. * This is in the same coordinate system as OpenGL; y=up, z=back, x=right + * * @return OpenAL listener position */ const SGVec3d& get_position() const; @@ -139,7 +138,8 @@ public: /** * Set the velocity vector (in meters per second) of the sound manager * This is the horizontal local frame; x=north, y=east, z=down - * @param Velocity vector + * + * @param vel Velocity vector */ void set_velocity( const SGVec3d& vel ) { _velocity = vel; _changed = true; @@ -148,18 +148,21 @@ public: /** * Get the velocity vector of the sound manager * This is in the same coordinate system as OpenGL; y=up, z=back, x=right. + * * @return Velocity vector of the OpenAL listener */ inline SGVec3f get_velocity() { return toVec3f(_velocity); } /** * Set the orientation of the sound manager + * * @param ori Quaternation containing the orientation information */ void set_orientation( const SGQuatd& ori ); /** * Get the orientation of the sound manager + * * @return Quaternation containing the orientation information */ const SGQuatd& get_orientation() const; @@ -167,6 +170,7 @@ public: /** * Get the direction vector of the sound manager * This is in the same coordinate system as OpenGL; y=up, z=back, x=right. + * * @return Look-at direction of the OpenAL listener */ SGVec3f get_direction() const; @@ -179,24 +183,28 @@ public: /** * Set the master volume. + * * @param vol Volume (must be between 0.0 and 1.0) */ void set_volume( float vol ); /** * Get the master volume. + * * @return Volume (must be between 0.0 and 1.0) */ inline float get_volume() { return _volume; } /** * Get a free OpenAL source-id + * * @return NO_SOURCE if no source is available */ unsigned int request_source(); /** * Free an OpenAL source-id for future use + * * @param source OpenAL source-id to free */ void release_source( unsigned int source ); @@ -204,6 +212,7 @@ public: /** * Get a free OpenAL buffer-id * The buffer-id will be assigned to the sample by calling this function. + * * @param sample Pointer to an audio sample to assign the buffer-id to * @return NO_BUFFER if loading of the buffer failed. */ @@ -211,6 +220,7 @@ public: /** * Free an OpenAL buffer-id for this sample + * * @param sample Pointer to an audio sample for which to free the buffer */ void release_buffer( SGSoundSample *sample ); @@ -218,6 +228,7 @@ public: /** * Test if the position of the sound manager has changed. * The value will be set to false upon the next call to update_late() + * * @return true if the position has changed */ inline bool has_changed() { return _changed; } @@ -232,6 +243,7 @@ public: /** * Load a sample file and return it's configuration and data. + * * @param samplepath Path to the file to load * @param data Pointer to a variable that points to the allocated data * @param format Pointer to a vairable that gets the OpenAL format @@ -239,8 +251,11 @@ public: * @param freq Pointer to a vairable that gets the sample frequency in Herz * @return true if succesful, false on error */ - bool load(const std::string &samplepath, void **data, int *format, - size_t *size, int *freq ); + bool load( const std::string &samplepath, + void **data, + int *format, + size_t *size, + int *freq ); /** * Get a list of available playback devices. diff --git a/simgear/sound/xmlsound.cxx b/simgear/sound/xmlsound.cxx index 2629c29d..7891bf78 100644 --- a/simgear/sound/xmlsound.cxx +++ b/simgear/sound/xmlsound.cxx @@ -88,9 +88,11 @@ SGXmlSound::~SGXmlSound() } void -SGXmlSound::init(SGPropertyNode *root, SGPropertyNode *node, - SGSampleGroup *sgrp, SGSampleGroup *avionics, - const SGPath& currentDir) +SGXmlSound::init( SGPropertyNode *root, + SGPropertyNode *node, + SGSampleGroup *sgrp, + SGSampleGroup *avionics, + const SGPath& path ) { // @@ -279,7 +281,7 @@ SGXmlSound::init(SGPropertyNode *root, SGPropertyNode *node, _sgrp = sgrp; } string soundFileStr = node->getStringValue("path", ""); - _sample = new SGSoundSample(soundFileStr.c_str(), currentDir); + _sample = new SGSoundSample(soundFileStr.c_str(), path); if (!_sample->file_path().exists()) { throw sg_io_exception("XML sound: couldn't find file: '" + soundFileStr + "'"); } diff --git a/simgear/sound/xmlsound.hxx b/simgear/sound/xmlsound.hxx index 34761df0..576ead7b 100644 --- a/simgear/sound/xmlsound.hxx +++ b/simgear/sound/xmlsound.hxx @@ -1,30 +1,26 @@ -// sound.hxx -- Sound class implementation +///@file +/// Sound class implementation +/// +/// Provides a class to manage a single sound event including things like +/// looping, volume and pitch changes. // // Started by Erik Hofman, February 2002 // // Copyright (C) 2002 Erik Hofman - erik@ehofman.com // -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. // -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. +// Library General Public License for more details. // -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// $Id$ - -/** - * \file sound.hxx - * Provides a class to manage a single sound event including things - * like looping, volume and pitch changes. - */ +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef _SG_SOUND_HXX #define _SG_SOUND_HXX 1 @@ -71,6 +67,7 @@ public: * and a sound manager class has to be defined. * * A sound configuration file would look like this: + * @code{xml} * * * Define the name of the event. For reference only. @@ -98,16 +95,20 @@ public: * * * + * @endcode * - * @param root The root node of the programs property tree. - * @param child A pointer to the location of the current event as defined - * in the configuration file. - * @param sgrp A pointer to a pre-initialized sample group class. - * @param avionics A pointer to the pre-initialized avionics sample group. - * @param path The path where the audio files remain. + * @param root The root node of the programs property tree. + * @param child A pointer to the location of the current event as + * defined in the configuration file. + * @param sgrp A pointer to a pre-initialized sample group class. + * @param avionics A pointer to the pre-initialized avionics sample group. + * @param path The path where the audio files remain. */ - virtual void init (SGPropertyNode *, SGPropertyNode *, SGSampleGroup *, - SGSampleGroup *, const SGPath& currentDir); + virtual void init( SGPropertyNode *root, + SGPropertyNode *child, + SGSampleGroup *sgrp, + SGSampleGroup *avionics, + const SGPath& path ); /** * Check whether an event has happened and if action has to be taken. diff --git a/simgear/structure/SGBinding.hxx b/simgear/structure/SGBinding.hxx index 15757fae..ef573a01 100644 --- a/simgear/structure/SGBinding.hxx +++ b/simgear/structure/SGBinding.hxx @@ -41,7 +41,7 @@ public: /** * Convenience constructor. * - * @param node The binding will be built from this node. + * @param commandName TODO */ SGBinding(const std::string& commandName); @@ -49,8 +49,10 @@ public: * Convenience constructor. * * @param node The binding will be built from this node. + * @param root Property root used while building binding. */ - SGBinding (const SGPropertyNode * node, SGPropertyNode* root); + SGBinding( const SGPropertyNode *node, + SGPropertyNode *root ); /** @@ -97,6 +99,8 @@ public: * Read a binding from a property node. * * @param node The property node containing the binding. + * @param root The property root node used while building the binding from + * \a node. */ void read (const SGPropertyNode * node, SGPropertyNode* root); diff --git a/simgear/structure/SGSharedPtr.hxx b/simgear/structure/SGSharedPtr.hxx index 9e92a7b0..3afcfc91 100644 --- a/simgear/structure/SGSharedPtr.hxx +++ b/simgear/structure/SGSharedPtr.hxx @@ -1,22 +1,21 @@ -/* -*-c++-*- - * - * Copyright (C) 2005-2012 Mathias Froehlich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ +///@file +/// Pointer proxy doing reference counting. +// +// Copyright (C) 2005-2012 Mathias Froehlich +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef SGSharedPtr_HXX #define SGSharedPtr_HXX @@ -31,7 +30,7 @@ class SGWeakPtr; /// it is pointing to. /// The SGSharedPtr class handles reference counting and possible /// destruction if no nore references are in use automatically. -/// Classes derived from @SGReferenced can be handled with SGSharedPtr. +/// Classes derived from SGReferenced can be handled with SGSharedPtr. /// Once you have a SGSharedPtr available you can use it just like /// a usual pointer with the exception that you don't need to delete it. /// Such a reference is initialized by zero if not initialized with a diff --git a/simgear/structure/commands.hxx b/simgear/structure/commands.hxx index 2ffabf0a..7f4185ec 100644 --- a/simgear/structure/commands.hxx +++ b/simgear/structure/commands.hxx @@ -101,11 +101,11 @@ public: /** * Register a new command with the manager. * - * @param name The command name. Any existing command with - * the same name will silently be overwritten. - * @param command A pointer to a one-arg function returning - * a bool result. The argument is always a const pointer to - * an SGPropertyNode (which may contain multiple values). + * @param name The command name. Any existing command with the same name + * will silently be overwritten. + * @param f A pointer to a one-arg function returning a bool result. The + * argument is always a const pointer to an SGPropertyNode + * (which may contain multiple values). */ void addCommand(const std::string& name, command_t f) { addCommandObject(name, new FunctionCommand(f)); } diff --git a/simgear/structure/exception.cxx b/simgear/structure/exception.cxx index 082d12e4..cac9cc95 100644 --- a/simgear/structure/exception.cxx +++ b/simgear/structure/exception.cxx @@ -13,8 +13,6 @@ #include -using std::string; - //////////////////////////////////////////////////////////////////////// // Implementation of sg_location class. //////////////////////////////////////////////////////////////////////// @@ -148,10 +146,10 @@ sg_throwable::getMessage () const return _message; } -const string +const std::string sg_throwable::getFormattedMessage () const { - return string(getMessage()); + return std::string(getMessage()); } void @@ -204,7 +202,7 @@ sg_error::sg_error (const char* message, const char *origin) { } -sg_error::sg_error (const string& message, const string& origin) +sg_error::sg_error(const std::string& message, const std::string& origin) : sg_throwable(message.c_str(), origin.c_str()) { } @@ -212,7 +210,7 @@ sg_error::sg_error (const string& message, const string& origin) sg_error::~sg_error () throw () { } - + //////////////////////////////////////////////////////////////////////// // Implementation of sg_exception class. //////////////////////////////////////////////////////////////////////// @@ -227,7 +225,8 @@ sg_exception::sg_exception (const char* message, const char* origin) { } -sg_exception::sg_exception (const string& message, const string& origin) +sg_exception::sg_exception( const std::string& message, + const std::string& origin ) : sg_throwable(message.c_str(), origin.c_str()) { } @@ -235,7 +234,7 @@ sg_exception::sg_exception (const string& message, const string& origin) sg_exception::~sg_exception () throw () { } - + //////////////////////////////////////////////////////////////////////// // Implementation of sg_io_exception. //////////////////////////////////////////////////////////////////////// @@ -258,34 +257,36 @@ sg_io_exception::sg_io_exception (const char* message, { } -sg_io_exception::sg_io_exception (const string& message, const string& origin) +sg_io_exception::sg_io_exception( const std::string& message, + const std::string& origin ) : sg_exception(message, origin) { } -sg_io_exception::sg_io_exception (const string& message, - const sg_location &location, - const string& origin) +sg_io_exception::sg_io_exception( const std::string& message, + const sg_location &location, + const std::string& origin ) : sg_exception(message, origin), _location(location) { } -sg_io_exception::sg_io_exception (const string &message, const SGPath& origin) +sg_io_exception::sg_io_exception( const std::string &message, + const SGPath& origin ) : sg_exception(message, origin.str()) { - + } sg_io_exception::~sg_io_exception () throw () { } -const string +const std::string sg_io_exception::getFormattedMessage () const { - string ret = getMessage(); - string loc = getLocation().asString(); + std::string ret = getMessage(); + std::string loc = getLocation().asString(); if (loc.length()) { ret += "\n at "; ret += loc; @@ -325,9 +326,9 @@ sg_format_exception::sg_format_exception (const char* message, setText(text); } -sg_format_exception::sg_format_exception (const string& message, - const string& text, - const string& origin) +sg_format_exception::sg_format_exception( const std::string& message, + const std::string& text, + const std::string& origin ) : sg_exception(message, origin) { setText(text.c_str()); @@ -371,8 +372,8 @@ sg_range_exception::sg_range_exception (const char* message, { } -sg_range_exception::sg_range_exception(const string& message, - const string& origin) +sg_range_exception::sg_range_exception(const std::string& message, + const std::string& origin) : sg_exception(message, origin) { } diff --git a/simgear/threads/SGGuard.hxx b/simgear/threads/SGGuard.hxx index 8aadebbc..93d664a2 100644 --- a/simgear/threads/SGGuard.hxx +++ b/simgear/threads/SGGuard.hxx @@ -13,21 +13,18 @@ public: /** * Create an SGGuard object and lock the passed lockable object. - * @param SGLOCK A lockable object. + * @param l A lockable object. */ inline SGGuard( SGLOCK& l ) : lock(l) { lock.lock(); } /** - * Destroy this object and unlock the locakable object. + * Destroy this object and unlock the lockable object. */ inline ~SGGuard() { lock.unlock(); } private: - /** - * A lockable object. - */ - SGLOCK& lock; + SGLOCK& lock; //!< A lockable object private: // Disable copying. diff --git a/simgear/threads/SGQueue.hxx b/simgear/threads/SGQueue.hxx index 7f49b5d9..41c2cf30 100644 --- a/simgear/threads/SGQueue.hxx +++ b/simgear/threads/SGQueue.hxx @@ -38,21 +38,21 @@ public: /** * Add an item to the end of the queue. * - * @param T object to add. + * @param item object to add. */ virtual void push( const T& item ) = 0; /** * View the item from the head of the queue. * - * @return T next available object. + * @return The next available object. */ virtual T front() = 0; /** * Get an item from the head of the queue. * - * @return T next available object. + * @return The next available object. */ virtual T pop() = 0; @@ -86,12 +86,12 @@ public: /** * Destroy this object. */ - ~SGLockedQueue() {} + virtual ~SGLockedQueue() {} /** * Returns whether this queue is empty (contains no elements). * - * @return bool True if queue is empty, otherwisr false. + * @return True if queue is empty, otherwise false. */ virtual bool empty() { SGGuard g(mutex); @@ -101,7 +101,7 @@ public: /** * Add an item to the end of the queue. * - * @param T object to add. + * @param item object to add. */ virtual void push( const T& item ) { SGGuard g(mutex); @@ -111,7 +111,7 @@ public: /** * View the item from the head of the queue. * - * @return T next available object. + * @return The next available object. */ virtual T front() { SGGuard g(mutex); @@ -123,7 +123,7 @@ public: /** * Get an item from the head of the queue. * - * @return T next available object. + * @return The next available object. */ virtual T pop() { SGGuard g(mutex); @@ -142,7 +142,7 @@ public: /** * Query the size of the queue * - * @return size_t size of queue. + * @return Size of queue. */ virtual size_t size() { SGGuard g(mutex); @@ -178,7 +178,7 @@ public: /** * Destroy this queue. */ - ~SGBlockingQueue() {} + virtual ~SGBlockingQueue() {} /** * @@ -191,7 +191,7 @@ public: /** * Add an item to the end of the queue. * - * @param T object to add. + * @param item The object to add. */ virtual void push( const T& item ) { SGGuard g(mutex); @@ -203,7 +203,7 @@ public: * View the item from the head of the queue. * Calling thread is not suspended * - * @return T next available object. + * @return The next available object. */ virtual T front() { SGGuard g(mutex); @@ -219,7 +219,7 @@ public: * Get an item from the head of the queue. * If no items are available then the calling thread is suspended * - * @return T next available object. + * @return The next available object. */ virtual T pop() { SGGuard g(mutex); @@ -238,7 +238,7 @@ public: /** * Query the size of the queue * - * @return size_t size of queue. + * @return Size of queue. */ virtual size_t size() { SGGuard g(mutex); @@ -280,7 +280,7 @@ public: /** * Destroy this dequeue. */ - ~SGBlockingDeque() {} + virtual ~SGBlockingDeque() {} /** * @@ -301,7 +301,7 @@ public: /** * Add an item to the front of the queue. * - * @param T object to add. + * @param item The object to add. */ virtual void push_front( const T& item ) { SGGuard g(mutex); @@ -312,7 +312,7 @@ public: /** * Add an item to the back of the queue. * - * @param T object to add. + * @param item The object to add. */ virtual void push_back( const T& item ) { SGGuard g(mutex); @@ -324,7 +324,7 @@ public: * View the item from the head of the queue. * Calling thread is not suspended * - * @return T next available object. + * @return The next available object. */ virtual T front() { SGGuard g(mutex); @@ -340,7 +340,7 @@ public: * Get an item from the head of the queue. * If no items are available then the calling thread is suspended * - * @return T next available object. + * @return The next available object. */ virtual T pop_front() { SGGuard g(mutex); @@ -360,7 +360,7 @@ public: * Get an item from the tail of the queue. * If no items are available then the calling thread is suspended * - * @return T next available object. + * @return The next available object. */ virtual T pop_back() { SGGuard g(mutex); @@ -379,7 +379,7 @@ public: /** * Query the size of the queue * - * @return size_t size of queue. + * @return Size of queue. */ virtual size_t size() { SGGuard g(mutex); diff --git a/simgear/threads/SGThread.hxx b/simgear/threads/SGThread.hxx index 94d5e405..d905c624 100644 --- a/simgear/threads/SGThread.hxx +++ b/simgear/threads/SGThread.hxx @@ -146,16 +146,16 @@ public: /** * Wait for this condition variable to be signaled. * - * @param SGMutex& reference to a locked mutex. + * @param mutex Reference to a locked mutex. */ - void wait(SGMutex&); + void wait(SGMutex& mutex); /** - * Wait for this condition variable to be signaled for at most - * 'ms' milliseconds. + * Wait for this condition variable to be signaled for at most \a 'msec' + * milliseconds. * - * @param mutex reference to a locked mutex. - * @param ms milliseconds to wait for a signal. + * @param mutex Reference to a locked mutex. + * @param msec Milliseconds to wait for a signal. * * @return */ diff --git a/simgear/timing/sg_time.hxx b/simgear/timing/sg_time.hxx index d59ee249..c4f3a36f 100644 --- a/simgear/timing/sg_time.hxx +++ b/simgear/timing/sg_time.hxx @@ -116,13 +116,15 @@ public: * If you don't know your position when you call the SGTime * constructor, you can just use the first form (which assumes 0, * 0). - * @param lon_rad current longitude (radians) - * @param lat_rad current latitude (radians) - * @param root root path point to data file location (timezone, etc.) - * @param init_time provide an initialization time, 0 means use - current clock time */ - SGTime( const SGGeod& location, const SGPath& root, - time_t init_time ); + * + * @param location Current geodetic location + * @param root Root path point to data file location (timezone, etc.) + * @param init_time Provide an initialization time, 0 means use current + * clock time + */ + SGTime( const SGGeod& location, + const SGPath& root, + time_t init_time ); /** * Create an instance given a data file path. @@ -140,12 +142,13 @@ public: * you to offset "sim" time relative to "real" time. The update() * method is designed to be called by the host application before * every frame. - * @param lon_rad current longitude (radians) - * @param lat_rad current latitude (radians) - * @param ct specify a unix time, otherwise specify 0 to use current - clock time - * @param warp an optional time offset specified in seconds. This - * allows us to advance or rewind "time" if we choose to. */ + * + * @param location Current geodetic location + * @param ct Specify a unix time, otherwise specify 0 to use current + * clock time + * @param warp Optional time offset in seconds. This allows to advance + * or rewind "time". + */ void update( const SGGeod& location, time_t ct, long int warp ); /** Deprecated method. To be removed after the next release... */ @@ -158,9 +161,10 @@ public: * enough that your timezone may have changed as well. In the * FlightGear project we call updateLocal() every few minutes from * our periodic event manager. - * @param lon_rad current longitude (radians) - * @param lat_rad current latitude (radians) - * @param root base path containing time zone directory */ + * + * @param location Current geodetic location + * @param root Bbase path containing time zone directory + */ void updateLocal( const SGGeod& location, const std::string& root ); /** @return current system/unix time in seconds */ -- 2.39.5