Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 6, 2010, 3:51:29 PM (14 years ago)
Author:
rgrieder
Message:

Added Doxygen documentation for ExprParser, MathConvert, OrxEnum, OrxAssert and TriBool.
Adjusted Doxygen documentation for Clock and Exception.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/doc/src/libraries/util/OrxEnum.h

    r5738 r7367  
    2727 */
    2828
    29 /**
    30 @file
    31 @brief
    32     Declaration of the OrxEnum class.
    33 */
    34 
    3529#ifndef _OrxEnum_H__
    3630#define _OrxEnum_H__
     
    4034namespace orxonox
    4135{
     36    /** Lightweight enumeration class that can be extended at run time.
     37    @details
     38        The class accepts type int and also defines operator int(). Therefore
     39        int and OrxEnum can be used interchangeably so you can extend the content
     40        of the enumeration at run time by adding ints.
     41    @par Declaring an OrxEnum
     42        Write a struct that inherits OrxEnum and use some macros:
     43        @code
     44        struct MyEnum : OrxEnum<MyEnum>
     45        {
     46            OrxEnumConstructors(MyEnum);
     47
     48            static const int Value1 = -1;
     49            static const int Value2 = 0;
     50            static const int Value3 = Value2 + 10;
     51        };
     52        @endcode
     53    */
    4254    template <class T>
    4355    struct OrxEnum
     
    4557        public:
    4658            OrxEnum() { }
    47             OrxEnum(int type)                  { type_ = type; }
     59            OrxEnum(int type)            { type_ = type; }
    4860            OrxEnum(const T& instance)   { type_ = instance.type_; }
    4961
    50             operator int()                     { return type_; }
     62            operator int()               { return type_; }
    5163            T& operator =(int type)      { type_ = type; return *this; }
    5264            bool operator <(const T& right) const { return (type_ < right.type_); }
     
    5971}
    6072
     73/// See orxonox::OrxEnum for more info
    6174#define OrxEnumConstructors(enumName)                        \
    6275enumName() { }                                               \
Note: See TracChangeset for help on using the changeset viewer.