From 5348f4eafe4daea2e110a19cab1c1fb4cbfedda6 Mon Sep 17 00:00:00 2001 From: curt Date: Sun, 25 Mar 2001 12:45:13 +0000 Subject: [PATCH] Doxygen. --- simgear/misc/props.hxx | 43 ++++++++++++++++---------------- simgear/misc/stopwatch.hxx | 50 +++++++++++++++++++++---------------- simgear/misc/strutils.hxx | 21 ++++++++++------ simgear/misc/texcoord.hxx | 18 +++++++++++--- simgear/misc/zfstream.hxx | 51 ++++++++++++++++++++++++++++---------- 5 files changed, 115 insertions(+), 68 deletions(-) diff --git a/simgear/misc/props.hxx b/simgear/misc/props.hxx index 1e059090..b67dcc3b 100644 --- a/simgear/misc/props.hxx +++ b/simgear/misc/props.hxx @@ -1,10 +1,13 @@ -// props.hxx - interface definition for a property list. -// Started Fall 2000 by David Megginson, david@megginson.com -// This code is released into the Public Domain. -// -// See props.html for documentation [replace with URL when available]. -// -// $Id$ +/** + * \file props.hxx + * Interface definition for a property list. + * Started Fall 2000 by David Megginson, david@megginson.com + * This code is released into the Public Domain. + * + * See props.html for documentation [replace with URL when available]. + * + * $Id$ + */ #ifndef __PROPS_HXX #define __PROPS_HXX @@ -288,16 +291,15 @@ private: -//////////////////////////////////////////////////////////////////////// -// A cooked value. -// -// This is the value that property-list clients see. It is a -// persistent layer over the possibly-changing raw value; once a -// client gets an SGValue from the property manager, the pointer -// will be good for the life of the property manager itself, no -// matter how often the pointer is tied or untied. -//////////////////////////////////////////////////////////////////////// - +/** + * A cooked value. + * + * This is the value that property-list clients see. It is a + * persistent layer over the possibly-changing raw value; once a + * client gets an SGValue from the property manager, the pointer + * will be good for the life of the property manager itself, no + * matter how often the pointer is tied or untied. + */ class SGValue { public: @@ -374,10 +376,9 @@ private: -//////////////////////////////////////////////////////////////////////// -// A node in a property tree. -//////////////////////////////////////////////////////////////////////// - +/** + * A node in a property tree. + */ class SGPropertyNode { diff --git a/simgear/misc/stopwatch.hxx b/simgear/misc/stopwatch.hxx index 4431d92e..bb8ebc4f 100644 --- a/simgear/misc/stopwatch.hxx +++ b/simgear/misc/stopwatch.hxx @@ -1,12 +1,20 @@ -/*************************************************************************** - * stopwatch.hxx Timer class, for use in benchmarking - * +/** + * \file stopwatch.hxx + * Timer class, for use in benchmarking * Based on blitz/Timer.h * - * $Id$ - * * Copyright (C) 1997,1998 Todd Veldhuizen * + * Suggestions: blitz-suggest@cybervision.com + * Bugs: blitz-bugs@cybervision.com + * + * For more information, please see the Blitz++ Home Page: + * http://seurat.uwaterloo.ca/blitz/ + */ + +/* + * $Id$ + * * 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 @@ -22,12 +30,6 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * - * Suggestions: blitz-suggest@cybervision.com - * Bugs: blitz-bugs@cybervision.com - * - * For more information, please see the Blitz++ Home Page: - * http://seurat.uwaterloo.ca/blitz/ - * */ // This class is not portable to non System V platforms. @@ -66,30 +68,34 @@ # include #endif +/** + * A high resolutions timing class + */ class StopWatch { public: - StopWatch() - { -// state_ = uninitialized; + /** Constructor */ + StopWatch() { + // state_ = uninitialized; } - void start() - { -// state_ = running; + /** Start counting time */ + void start() { + // state_ = running; t1_ = systemTime(); } - void stop() - { + /** Stop counting time */ + void stop() { t2_ = systemTime(); -// BZPRECONDITION(state_ == running); -// state_ = stopped; + // BZPRECONDITION(state_ == running); + // state_ = stopped; } + /** @return the elapsed time between start and stop */ double elapsedSeconds() { -// BZPRECONDITION(state_ == stopped); + // BZPRECONDITION(state_ == stopped); return t2_ - t1_; } diff --git a/simgear/misc/strutils.hxx b/simgear/misc/strutils.hxx index baf19f8b..1288f7de 100644 --- a/simgear/misc/strutils.hxx +++ b/simgear/misc/strutils.hxx @@ -1,5 +1,8 @@ -// String utilities. -// +/** + * \file strutils.hxx + * String utilities. + */ + // Written by Bernie Bright, 1998 // // Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au @@ -21,6 +24,7 @@ // // $Id$ + #ifndef STRUTILS_H #define STRUTILS_H @@ -36,26 +40,27 @@ SG_USING_STD(string); -// Default characters to remove. + +/** Default characters to remove. */ extern const string whitespace; -// Returns a string with trailing characters removed. +/** Returns a string with trailing characters removed. */ string trimleft( const string& s, const string& trimmings = whitespace ); -// Returns a string with leading characters removed. +/** Returns a string with leading characters removed. */ string trimright( const string& s, const string& trimmings = whitespace ); -// Returns a string with leading and trailing characters removed. +/** Returns a string with leading and trailing characters removed. */ string trim( const string& s, const string& trimmings = whitespace ); -//----------------------------------------------------------------------------- - +/** atof() wrapper for "string" type */ inline double atof( const string& str ) { return ::atof( str.c_str() ); } +/** atoi() wrapper for "string" type */ inline int atoi( const string& str ) { diff --git a/simgear/misc/texcoord.hxx b/simgear/misc/texcoord.hxx index 42657e37..a5c13f70 100644 --- a/simgear/misc/texcoord.hxx +++ b/simgear/misc/texcoord.hxx @@ -1,5 +1,8 @@ -// texcoord.hxx -- routine(s) to handle texture coordinate generation -// +/** + * \file texcoord.hxx + * Routine to handle texture coordinate generation. + */ + // Written by Curtis Olson, started March 1999. // // Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org @@ -35,8 +38,15 @@ #include -// traverse the specified fan/strip/list of vertices and attempt to -// calculate "none stretching" texture coordinates +/** + * Traverse the specified fan/strip/list of vertices and attempt to + * calculate "none stretching" texture coordinates. + * @param b the bucket containing the structure + * @param geod_nodes vertices in geodetic coordinates + * @param fan integer list of indices pointing into the vertex list + * @param scale (default = 1.0) scaling factor + * @return list of texture coordinates + */ point_list calc_tex_coords( const SGBucket& b, const point_list& geod_nodes, const int_list& fan, double scale = 1.0 ); diff --git a/simgear/misc/zfstream.hxx b/simgear/misc/zfstream.hxx index ddd63011..0b281456 100644 --- a/simgear/misc/zfstream.hxx +++ b/simgear/misc/zfstream.hxx @@ -1,5 +1,8 @@ -// A C++ I/O streams interface to the zlib gz* functions -// +/** + * \file zfstream.hxx + * A C++ I/O streams interface to the zlib gz* functions. + */ + // Written by Bernie Bright, 1998 // Based on zlib/contrib/iostream/ by Kevin Ruland // @@ -96,10 +99,9 @@ SG_USING_STD(streamoff); #endif // SG_HAVE_STD_INCLUDES -//----------------------------------------------------------------------------- -// -// -// +/** + * A C++ I/O streams interface to the zlib gz* functions. + */ class gzfilebuf : public streambuf { public: @@ -111,17 +113,41 @@ public: // typedef char_traits::off_type off_type; #endif + /** Constructor */ gzfilebuf(); + + /** Destructor */ virtual ~gzfilebuf(); + /** + * Open a stream + * @param name file name + * @param io_mode mdoe flags + * @return file stream + */ gzfilebuf* open( const char* name, ios_openmode io_mode ); + + /** + * Attach to an existing file descriptor + * @param file_descriptor file descriptor + * @param io_mode mode flags + * @return file stream + */ gzfilebuf* attach( int file_descriptor, ios_openmode io_mode ); + + /** Close stream */ gzfilebuf* close(); -// int setcompressionlevel( int comp_level ); -// int setcompressionstrategy( int comp_strategy ); + // int setcompressionlevel( int comp_level ); + // int setcompressionstrategy( int comp_strategy ); + + /** @return true if open, false otherwise */ bool is_open() const { return (file != NULL); } + + /** @return stream position */ virtual streampos seekoff( streamoff off, ios_seekdir way, int which ); + + /** sync the stream */ virtual int sync(); protected: @@ -155,15 +181,14 @@ private: void operator= ( const gzfilebuf& ); }; -//----------------------------------------------------------------------------- -// -// -// +/** + * document me + */ struct gzifstream_base { gzifstream_base() {} - gzfilebuf gzbuf; + Gzfilebuf gzbuf; }; #endif // _zfstream_hxx -- 2.39.5