[Orxonox-commit 2586] r7291 - in code/branches/doc/src/libraries: core util
landauf at orxonox.net
landauf at orxonox.net
Tue Aug 31 17:19:36 CEST 2010
Author: landauf
Date: 2010-08-31 17:19:36 +0200 (Tue, 31 Aug 2010)
New Revision: 7291
Modified:
code/branches/doc/src/libraries/core/XMLPort.h
code/branches/doc/src/libraries/util/Debug.h
code/branches/doc/src/libraries/util/Math.cc
code/branches/doc/src/libraries/util/MultiType.h
code/branches/doc/src/libraries/util/SubString.h
Log:
the @example tag shouldn't be used in a documentation unless the whole file is an example implementation
Modified: code/branches/doc/src/libraries/core/XMLPort.h
===================================================================
--- code/branches/doc/src/libraries/core/XMLPort.h 2010-08-31 14:16:59 UTC (rev 7290)
+++ code/branches/doc/src/libraries/core/XMLPort.h 2010-08-31 15:19:36 UTC (rev 7291)
@@ -152,7 +152,7 @@
Sometimes you'll have a member object in your class, which has it's own load- and savefunctions.
With this macro, you can simply use them instead of writing your own functions.
- @example
+ Example:
Your class is called SpaceShip and this class has an object (myPilot_) of class Pilot. Pilot has a name
and two functions, setName(name) and getName(). Now you want an attribute "pilotname" in your
SpaceShip class. Instead of writing wrapper functions, you can simply use the XMLPortParamExtern
@@ -230,7 +230,7 @@
return 0;
}
- @example
+ Example:
Possible usage of the macro:
> XMLPortObject(SpaceShip, Weapon, "weapons", addWeapon, getWeapon, xmlelement, mode, false, true);
Modified: code/branches/doc/src/libraries/util/Debug.h
===================================================================
--- code/branches/doc/src/libraries/util/Debug.h 2010-08-31 14:16:59 UTC (rev 7290)
+++ code/branches/doc/src/libraries/util/Debug.h 2010-08-31 15:19:36 UTC (rev 7291)
@@ -51,12 +51,14 @@
5: More debug information
6: Crazy debug information
- at example
+ Example:
+ @code
COUT(0) << "Very important output" << std::endl;
COUT(1) << "Error: Something went wrong!" << std::endl;
COUT(2) << "Warning: There might be a problem." << std::endl;
COUT(3) << "Info: It's Monday" << std::endl;
COUT(4) << "Debug: x is 1.23456" << std::endl;
+ @endcode
*/
#ifndef _Util_Debug_H__
@@ -95,8 +97,11 @@
(a > b ? 0 : c << "text") is equivalent to (a > b ? 0 : (c << "text"))
where (a > b ? 0 : ) stands for COUT(x). This should explain how
this macro magic can possibly even work ;)
- at example
+
+ Example:
+ @code
COUT(3) << "Some info" << std::endl;
+ @endcode
@note
The ? : operator requires both possible results to have the type of
the first. This is achieved by the int conversion operator dummy
Modified: code/branches/doc/src/libraries/util/Math.cc
===================================================================
--- code/branches/doc/src/libraries/util/Math.cc 2010-08-31 14:16:59 UTC (rev 7290)
+++ code/branches/doc/src/libraries/util/Math.cc 2010-08-31 15:19:36 UTC (rev 7291)
@@ -92,7 +92,7 @@
@param otherposition The position of the other object
@return The angle
- @example
+ Examples:
If the other object is exactly in front of me, the function returns 0.
If the other object is exactly behind me, the function returns pi.
If the other object is exactly right/left to me (or above/below), the function returns pi/2.
@@ -115,7 +115,7 @@
@param otherposition The position of the other object
@return The viewing direction
- @example
+ Examples:
If the other object is exactly in front of me, the function returns Vector2(0, 0).
If the other object is exactly at my left, the function returns Vector2(-1, 0).
If the other object is exactly at my right, the function returns Vector2(1, 0).
@@ -155,7 +155,7 @@
@param otherposition The position of the other object
@return The viewing direction
- @example
+ Examples:
If the other object is exactly in front of me, the function returns Vector2(0, 0).
If the other object is exactly at my left, the function returns Vector2(-0.5, 0).
If the other object is exactly at my right, the function returns Vector2(0.5, 0).
Modified: code/branches/doc/src/libraries/util/MultiType.h
===================================================================
--- code/branches/doc/src/libraries/util/MultiType.h 2010-08-31 14:16:59 UTC (rev 7290)
+++ code/branches/doc/src/libraries/util/MultiType.h 2010-08-31 15:19:36 UTC (rev 7291)
@@ -51,12 +51,14 @@
- setType<T>() set's the type to T and resets the value
- setValue<T>(value) assigns a new value and changes the type to T.
- @example
+ Examples:
+ @code
MultiType a = 10;; // a has now the type int and the value 10
a.setValue("3.14"); // a has still the type int and "3.14" gets converted, therefore the value is now 3
a.setValue<float>("3.14"); // a has now the type float and "3.14" gets converted to 3.14
a.convert<bool>(); // converts 3.14 to bool, which is true
a = false; // assigns false, this is equivalent to a.setValue(false)
+ @endcode
@note
Whenever a value gets converted, there is a boolean return value telling you whether it was
Modified: code/branches/doc/src/libraries/util/SubString.h
===================================================================
--- code/branches/doc/src/libraries/util/SubString.h 2010-08-31 14:16:59 UTC (rev 7290)
+++ code/branches/doc/src/libraries/util/SubString.h 2010-08-31 15:19:36 UTC (rev 7291)
@@ -46,10 +46,10 @@
* Substring is Advanced, and it is possible, to split a string by ','
* but also removing leading and trailing spaces around the comma.
*
- * @example
+ * Example:
* Split the String std::string st = "1345, The new empire , is , orxonox"
* is splitted with:
- * SubString(st, ',', " \n\t")
+ * @code SubString(st, ',', " \n\t") @endcode
* into
* "1345", "The new empire", "is", "orxonox"
* As you can see, the useless spaces around ',' were removed.
More information about the Orxonox-commit
mailing list