Index: code/branches/doc/src/libraries/core/ConfigFileManager.cc
===================================================================
--- code/branches/doc/src/libraries/core/ConfigFileManager.cc	(revision 7372)
+++ code/branches/doc/src/libraries/core/ConfigFileManager.cc	(revision 7373)
@@ -27,4 +27,9 @@
  */
 
+/**
+    @file
+    @brief Implementation of ConfigFileManager and its helper classes.
+*/
+
 #include "ConfigFileManager.h"
 
@@ -43,5 +48,7 @@
     // ConfigFileEntryValue //
     //////////////////////////
-
+    /**
+        @brief Updates the string that will be stored in the file after one of it's components (name, value, comment) has changed.
+    */
     void ConfigFileEntryValue::update()
     {
@@ -63,4 +70,7 @@
     // ConfigFileEntryVectorValue //
     ////////////////////////////////
+    /**
+        @brief Updates the string that will be stored in the file after one of it's components (name, value, index, comment) has changed.
+    */
     void ConfigFileEntryVectorValue::update()
     {
@@ -73,4 +83,7 @@
     // ConfigFileSection //
     ///////////////////////
+    /**
+        @brief Destructor: Deletes all entries.
+    */
     ConfigFileSection::~ConfigFileSection()
     {
@@ -79,4 +92,10 @@
     }
 
+    /**
+        @brief Deletes all elements of a config vector if their index is greater or equal to @a startindex.
+
+        @param name         The name of the vector
+        @param startindex   The index of the first element that will be deleted
+    */
     void ConfigFileSection::deleteVectorEntries(const std::string& name, unsigned int startindex)
     {
@@ -95,4 +114,8 @@
     }
 
+    /**
+        @brief Returns the size of a config vector.
+        @param name     The name of the vector
+    */
     unsigned int ConfigFileSection::getVectorSize(const std::string& name) const
     {
@@ -108,4 +131,7 @@
     }
 
+    /**
+        @brief Returns the title and comment of the section as it will be stored in the file.
+    */
     std::string ConfigFileSection::getFileEntry() const
     {
@@ -116,4 +142,9 @@
     }
 
+    /**
+        @brief Returns the entry with given name (or NULL if it doesn't exist).
+
+        @param name     The name of the entry
+    */
     ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name) const
     {
@@ -126,4 +157,10 @@
     }
 
+    /**
+        @brief Returns the entry of a vector element with given name and index (or NULL if it doesn't exist).
+
+        @param name     The name of the vector
+        @param index    The index of the element in the vector
+    */
     ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name, unsigned int index) const
     {
@@ -136,4 +173,11 @@
     }
 
+    /**
+        @brief Returns the iterator to the entry with given name. If the entry doesn't exist, it is created using the fallback value.
+
+        @param name     The name of the entry
+        @param fallback The value that will be used if the entry doesn't exist
+        @param bString  If true, the value is treated as string which means some special treatment of special characters.
+    */
     std::list<ConfigFileEntry*>::iterator ConfigFileSection::getOrCreateEntryIterator(const std::string& name, const std::string& fallback, bool bString)
     {
@@ -152,4 +196,12 @@
     }
 
+    /**
+        @brief Returns the iterator to the entry of a vector element with given name and index. If the entry doesn't exist, it is created using the fallback value.
+
+        @param name     The name of the vector
+        @param index    The index of the element in the vector
+        @param fallback The value that will be used if the entry doesn't exist
+        @param bString  If true, the value is treated as string which means some special treatment of special characters.
+    */
     std::list<ConfigFileEntry*>::iterator ConfigFileSection::getOrCreateEntryIterator(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
     {
@@ -178,4 +230,9 @@
     const char* ConfigFile::DEFAULT_CONFIG_FOLDER = "defaultConfig";
 
+    /**
+        @brief Constructor: Initializes the config file.
+        @param filename The file-name of this config file
+        @param bCopyFallbackFile If true, the default config file is copied into the config-directory before loading the file
+    */
     ConfigFile::ConfigFile(const std::string& filename, bool bCopyFallbackFile)
         : filename_(filename)
@@ -185,4 +242,7 @@
     }
 
+    /**
+        @brief Destructor: Deletes all sections and entries.
+    */
     ConfigFile::~ConfigFile()
     {
@@ -190,4 +250,7 @@
     }
 
+    /**
+        @brief Loads the config file from the hard-disk and reads the sections and their values.
+    */
     void ConfigFile::load()
     {
@@ -318,4 +381,7 @@
     }
 
+    /**
+        @brief Writes the sections and values to the hard-disk.
+    */
     void ConfigFile::save() const
     {
@@ -323,4 +389,7 @@
     }
 
+    /**
+        @brief Writes the sections and values to a given file on the hard-disk.
+    */
     void ConfigFile::saveAs(const std::string& filename) const
     {
@@ -354,4 +423,7 @@
     }
 
+    /**
+        @brief Deletes all sections (which again delete all their values) and clears the list of sections.
+    */
     void ConfigFile::clear()
     {
@@ -361,18 +433,11 @@
     }
 
-    const std::string& ConfigFile::getOrCreateValue(const std::string& section, const std::string& name, const std::string& fallback, bool bString)
-    {
-        const std::string& output = this->getOrCreateSection(section)->getOrCreateValue(name, fallback, bString);
-        this->saveIfUpdated();
-        return output;
-    }
-
-    const std::string& ConfigFile::getOrCreateValue(const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString)
-    {
-        const std::string& output = this->getOrCreateSection(section)->getOrCreateValue(name, index, fallback, bString);
-        this->saveIfUpdated();
-        return output;
-    }
-
+    /**
+        @brief Deletes all elements of a config vector if their index is greater or equal to @a startindex.
+
+        @param section      The name of the section
+        @param name         The name of the vector
+        @param startindex   The index of the first element that will be deleted
+    */
     void ConfigFile::deleteVectorEntries(const std::string& section, const std::string& name, unsigned int startindex)
     {
@@ -384,4 +449,7 @@
     }
 
+    /**
+        @brief Returns a pointer to the section with given name (or NULL if the section doesn't exist).
+    */
     ConfigFileSection* ConfigFile::getSection(const std::string& section) const
     {
@@ -392,4 +460,7 @@
     }
 
+    /**
+        @brief Returns a pointer to the section with given name. If it doesn't exist, the section is created.
+    */
     ConfigFileSection* ConfigFile::getOrCreateSection(const std::string& section)
     {
@@ -403,4 +474,7 @@
     }
 
+    /**
+        @brief Saves the config file if it was updated (or if any of its sections were updated).
+    */
     void ConfigFile::saveIfUpdated()
     {
@@ -442,4 +516,7 @@
     SettingsConfigFile* SettingsConfigFile::singletonPtr_s = 0;
 
+    /**
+        @brief Constructor: Activates the console commands.
+    */
     SettingsConfigFile::SettingsConfigFile(const std::string& filename)
         : ConfigFile(filename)
@@ -452,4 +529,7 @@
     }
 
+    /**
+        @brief Destructor: Deactivates the console commands.
+    */
     SettingsConfigFile::~SettingsConfigFile()
     {
@@ -461,4 +541,7 @@
     }
 
+    /**
+        @brief Loads the config file and updates the @ref ConfigValueContainer "config value containers".
+    */
     void SettingsConfigFile::load()
     {
@@ -467,4 +550,7 @@
     }
 
+    /**
+        @brief Changes the file-name.
+    */
     void SettingsConfigFile::setFilename(const std::string& filename)
     {
@@ -472,4 +558,7 @@
     }
 
+    /**
+        @brief Registers a new @ref ConfigValueContainer "config value container".
+    */
     void SettingsConfigFile::addConfigValueContainer(ConfigValueContainer* container)
     {
@@ -481,4 +570,7 @@
     }
 
+    /**
+        @brief Unregisters a @ref ConfigValueContainer "config value container".
+    */
     void SettingsConfigFile::removeConfigValueContainer(ConfigValueContainer* container)
     {
@@ -500,6 +592,11 @@
     }
 
+    /**
+        @brief Updates all @ref ConfigValueContainer "config value containers".
+    */
     void SettingsConfigFile::updateConfigValues()
     {
+        // todo: can this be done more efficiently? looks like some identifiers will be updated multiple times.
+
         for (ContainerMap::const_iterator it = this->containers_.begin(); it != this->containers_.end(); ++it)
         {
@@ -509,4 +606,8 @@
     }
 
+    /**
+        @brief Removes entries and sections from the file that don't exist anymore (i.e. if there's no corresponding @ref ConfigValueContainer "config value container").
+        @param bCleanComments If true, comments are also removed from the file
+    */
     void SettingsConfigFile::clean(bool bCleanComments)
     {
@@ -558,4 +659,11 @@
     }
 
+    /**
+        @brief Console-command: Changes the value of an entry and stores it the file.
+
+        @param section  The section of the config value
+        @param entry    The name of the config value
+        @param value    The new value
+    */
     void SettingsConfigFile::config(const std::string& section, const std::string& entry, const std::string& value)
     {
@@ -564,4 +672,11 @@
     }
 
+    /**
+        @brief Console-command: Changes the value of an entry, but doesn't store it in the file (it's only a temporary change).
+
+        @param section  The section of the config value
+        @param entry    The name of the config value
+        @param value    The new value
+    */
     void SettingsConfigFile::tconfig(const std::string& section, const std::string& entry, const std::string& value)
     {
@@ -570,4 +685,12 @@
     }
 
+    /**
+        @brief Changes the value of an entry, depending on @a function, either by using "set" or "tset"
+
+        @param section  The section of the config value
+        @param entry    The name of the config value
+        @param value    The new value
+        @param function The function ("set" or "tset") that will be used to change the value.
+    */
     bool SettingsConfigFile::configImpl(const std::string& section, const std::string& entry, const std::string& value, bool (ConfigValueContainer::*function)(const MultiType&))
     {
@@ -586,4 +709,10 @@
     }
 
+    /**
+        @brief Console-command: Returns the value of a given entry.
+
+        @param section  The section of the config value
+        @param entry    The name of the config value
+    */
     std::string SettingsConfigFile::getConfig(const std::string& section, const std::string& entry)
     {
@@ -611,4 +740,5 @@
     ConfigFileManager* ConfigFileManager::singletonPtr_s = 0;
 
+    /// Constructor: Initializes the array of config files with NULL.
     ConfigFileManager::ConfigFileManager()
     {
@@ -616,4 +746,5 @@
     }
 
+    /// Destructor: Deletes the config files.
     ConfigFileManager::~ConfigFileManager()
     {
@@ -623,4 +754,5 @@
     }
 
+    /// Defines the file-name for the config file of a given type (settings, calibration, etc.).
     void ConfigFileManager::setFilename(ConfigFileType::Value type, const std::string& filename)
     {
Index: code/branches/doc/src/libraries/core/ConfigFileManager.h
===================================================================
--- code/branches/doc/src/libraries/core/ConfigFileManager.h	(revision 7372)
+++ code/branches/doc/src/libraries/core/ConfigFileManager.h	(revision 7373)
@@ -30,4 +30,5 @@
     @file
     @ingroup Config ConfigFile
+    @brief Declaration of ConfigFileManager and its helper classes.
 */
 
@@ -51,14 +52,33 @@
     // ConfigFileEntry //
     /////////////////////
+    /**
+        @brief This class represents an entry in the config file.
+
+        This class is pure virtual. Use one of the derived classes to define the type of the entry.
+    */
     class _CoreExport ConfigFileEntry
     {
         public:
+            /// Destructor
             virtual ~ConfigFileEntry() {};
+
+            /// Changes the value of the entry.
             virtual void setValue(const std::string& value) = 0;
+            /// Returns the value of the entry.
             virtual const std::string& getValue() const = 0;
+
+            /// Returns the name of the entry
             virtual const std::string& getName() const = 0;
+
+            /// Changes the comment of the entry (will be placed after the value)
             virtual void setComment(const std::string& comment) = 0;
+
+            /// Returns the index of the entry in a vector (used only if it is a vector)
             virtual unsigned int getIndex() const { return 0; }
+
+            /// Defines if this entry is treated as string which means some special treatment of special characters.
             virtual void setString(bool bString) = 0;
+
+            /// Returns the line as it will be stored in the config file.
             virtual const std::string& getFileEntry() const = 0;
     };
@@ -68,7 +88,18 @@
     // ConfigFileEntryValue //
     //////////////////////////
+    /**
+        @brief This class represents a normal value in the config file.
+    */
     class _CoreExport ConfigFileEntryValue : public ConfigFileEntry
     {
         public:
+            /**
+                @brief Constructor: Initializes the entry.
+
+                @param name                 The name of the entry
+                @param value                The value of the entry
+                @param bString              If true, the value is treated as string which means some special treatment of special characters.
+                @param additionalComment    An optional comment that will be placed behind the value in the config file
+            */
             inline ConfigFileEntryValue(const std::string& name, const std::string& value = "", bool bString = false, const std::string& additionalComment = "")
                 : name_(name)
@@ -78,4 +109,5 @@
                 { this->update(); }
 
+            /// Destructor
             inline virtual ~ConfigFileEntryValue() {}
 
@@ -97,4 +129,5 @@
                 { return this->fileEntry_; }
 
+            /// Returns the "key" of the value (in this case it's just the name of the entry, but for vectors it's different)
             inline virtual const std::string& getKeyString() const
                 { return this->name_; }
@@ -103,9 +136,9 @@
             virtual void update();
 
-            const std::string name_;
-            std::string value_;
-            std::string additionalComment_;
-            std::string fileEntry_;
-            bool bString_;
+            const std::string name_;            ///< The name of the value
+            std::string value_;                 ///< The value
+            std::string additionalComment_;     ///< The additional comment
+            std::string fileEntry_;             ///< The string as it will be stored in the config file
+            bool bString_;                      ///< If true, the value is treated as string which means some special treatment of special characters.
     };
 
@@ -114,7 +147,19 @@
     // ConfigFileEntryVectorValue //
     ////////////////////////////////
+    /**
+        @brief Subclass of ConfigFileEntryValue, represents an element of a vector.
+    */
     class _CoreExport ConfigFileEntryVectorValue : public ConfigFileEntryValue
     {
         public:
+            /**
+                @brief Constructor: Initializes the entry.
+
+                @param name                 The name of the vector
+                @param index                The index of the element in the vector
+                @param value                The value of the element
+                @param bString              If true, the value is treated as string which means some special treatment of special characters.
+                @param additionalComment    An optional comment that will be placed behind the value in the config file
+            */
             inline ConfigFileEntryVectorValue(const std::string& name, unsigned int index, const std::string& value = "", bool bString = false, const std::string& additionalComment = "")
                 : ConfigFileEntryValue(name, value, bString, additionalComment)
@@ -122,4 +167,5 @@
                 { this->update(); /*No virtual calls in base class ctor*/ }
 
+            /// Destructor
             inline ~ConfigFileEntryVectorValue() {}
 
@@ -127,4 +173,5 @@
                 { return this->index_; }
 
+            /// Returns the "key" of the value (the name of the vector plus the index of the element)
             inline const std::string& getKeyString() const
                 { return this->keyString_; }
@@ -133,6 +180,6 @@
             void update();
 
-            unsigned int index_;
-            std::string keyString_;
+            unsigned int index_;        ///< The index of the element in the vector
+            std::string keyString_;     ///< The full name of the entry (the name of the vector plus the index of the element)
     };
 
@@ -141,8 +188,14 @@
     // ConfigFileEntryComment //
     ////////////////////////////
+    /**
+        @brief This class represents a line in the config file which contains only a comment.
+    */
     class _CoreExport ConfigFileEntryComment : public ConfigFileEntry
     {
         public:
+            /// Constructor: Initializes the object.
             inline ConfigFileEntryComment(const std::string& comment) : comment_(comment) {}
+
+            /// Destructor
             inline virtual ~ConfigFileEntryComment() {}
 
@@ -164,9 +217,6 @@
                 { return this->comment_; }
 
-            inline virtual const std::string& getKeyString() const
-                { return BLANKSTRING; }
-
         private:
-            std::string comment_;
+            std::string comment_;   ///< The comment
     };
 
@@ -175,4 +225,9 @@
     // ConfigFileSection //
     ///////////////////////
+    /**
+        @brief Represents a section in a config file.
+
+        A section has a name and a list of config values.
+    */
     class _CoreExport ConfigFileSection
     {
@@ -181,4 +236,10 @@
 
         public:
+            /**
+                @brief Constructor: Initializes the section.
+
+                @param name The name of the section
+                @param additionalComment An additional comment placed after the title of the section in the config file
+            */
             inline ConfigFileSection(const std::string& name, const std::string& additionalComment = "")
                 : name_(name)
@@ -188,12 +249,27 @@
             ~ConfigFileSection();
 
+            /// Returns the name of the section.
             inline const std::string& getName() const
                 { return this->name_; }
 
+            /// Changes the comment which is placed after the title of the section in the config file.
             inline void setComment(const std::string& comment)
                 { this->additionalComment_ = comment; }
 
+            /**
+                @brief Stores a value in the section. If the entry doesn't exist, it's created.
+
+                @param name     The name of the entry
+                @param value    The new value
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
             inline void setValue(const std::string& name, const std::string& value, bool bString)
                 { this->getOrCreateEntry(name, value, bString)->setValue(value); }
+            /**
+                @brief Returns the value of a given entry in the section. Returns a blank string if the value doesn't exist.
+
+                @param name     The name of the entry
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
             inline const std::string& getValue(const std::string& name, bool bString)
             {
@@ -201,14 +277,36 @@
                 if (entry)
                 {
-                    entry->setString(bString);
+                    entry->setString(bString);  // if the entry was loaded from the config file, we have to tell it if it's a string
                     return entry->getValue();
                 }
                 return BLANKSTRING;
             }
+            /**
+                @brief Returns the value of a given entry in the section. If it doesn't exist, the entry is created using the fallback value.
+
+                @param name     The name of the entry
+                @param fallback The value that will be used if the entry doesn't exist
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
             inline const std::string& getOrCreateValue(const std::string& name, const std::string& fallback, bool bString)
                 { return this->getOrCreateEntry(name, fallback, bString)->getValue(); }
 
+            /**
+                @brief Stores the value of an element of a vector in the section. If the entry doesn't exist, it's created.
+
+                @param name     The name of the vector
+                @param index    The index of the element in the vector
+                @param value    The new value
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
             inline void setValue(const std::string& name, unsigned int index, const std::string& value, bool bString)
                 { this->getOrCreateEntry(name, index, value, bString)->setValue(value); }
+            /**
+                @brief Returns the value of a given element of a vector in the section. Returns a blank string if the value doesn't exist.
+
+                @param name     The name of the vector
+                @param index    The index of the element in the vector
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
             inline const std::string& getValue(const std::string& name, unsigned int index, bool bString)
             {
@@ -216,9 +314,17 @@
                 if (entry)
                 {
-                    entry->setString(bString);
+                    entry->setString(bString);  // if the entry was loaded from the config file, we have to tell it if it's a string
                     return entry->getValue();
                 }
                 return BLANKSTRING;
             }
+            /**
+                @brief Returns the value of a given element of a vector in the section. If it doesn't exist, the entry is created using the fallback value.
+
+                @param name     The name of the vector
+                @param index    The index of the element in the vector
+                @param fallback The value that will be used if the entry doesn't exist
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
             inline const std::string& getOrCreateValue(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
                 { return this->getOrCreateEntry(name, index, fallback, bString)->getValue(); }
@@ -230,8 +336,11 @@
 
         private:
+            /// Returns the list of entries in this section.
             std::list<ConfigFileEntry*>& getEntries()
                 { return this->entries_; }
+            /// Returns the begin-iterator of the list of entries in this section.
             std::list<ConfigFileEntry*>::const_iterator getEntriesBegin() const
                 { return this->entries_.begin(); }
+            /// Returns the end-iterator of the list of entries in this section.
             std::list<ConfigFileEntry*>::const_iterator getEntriesEnd() const
                 { return this->entries_.end(); }
@@ -241,14 +350,30 @@
 
             ConfigFileEntry* getEntry(const std::string& name) const;
+            /**
+                @brief Returns the entry with given name. If it doesn't exist, the entry is created using the fallback value.
+
+                @param name     The name of the entry
+                @param fallback The value that will be used if the entry doesn't exist
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
             inline ConfigFileEntry* getOrCreateEntry(const std::string& name, const std::string& fallback, bool bString)
                 { return (*this->getOrCreateEntryIterator(name, fallback, bString)); }
+
             ConfigFileEntry* getEntry(const std::string& name, unsigned int index) const;
+            /**
+                @brief Returns the entry that contains an element of a vector with given name. If it doesn't exist, the entry is created using the fallback value.
+
+                @param name     The name of the entry
+                @param index    The index of the element in the vector
+                @param fallback The value that will be used if the entry doesn't exist
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
             inline ConfigFileEntry* getOrCreateEntry(const std::string& name, unsigned int index, const std::string& fallback, bool bString)
                 { return (*this->getOrCreateEntryIterator(name, index, fallback, bString)); }
 
-            std::string name_;
-            std::string additionalComment_;
-            std::list<ConfigFileEntry*> entries_;
-            bool bUpdated_;
+            std::string name_;                      ///< The name of the section
+            std::string additionalComment_;         ///< The additional comment which is placed after the title of the section in the config file
+            std::list<ConfigFileEntry*> entries_;   ///< The list of entries in this section
+            bool bUpdated_;                         ///< True if an entry is created
     };
 
@@ -257,4 +382,9 @@
     // ConfigFile //
     ////////////////
+    /**
+        @brief This class represents a config file, which is stored on the hard-disk and contains config values in different sections.
+
+        It provides an interface to manipulate the sections and values.
+    */
     class _CoreExport ConfigFile
     {
@@ -268,7 +398,16 @@
             virtual void clear();
 
+            /// Returns the file-name of this config file
             inline const std::string& getFilename()
                 { return this->filename_; }
 
+            /**
+                @brief Stores a value in the config file. If the entry or its section doesn't exist, it's created.
+
+                @param section  The name of the section
+                @param name     The name of the entry
+                @param value    The new value
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
             inline void setValue(const std::string& section, const std::string& name, const std::string& value, bool bString)
             {
@@ -276,4 +415,11 @@
                 this->save();
             }
+            /**
+                @brief Returns the value of a given entry in the config file. Returns a blank string if the value doesn't exist.
+
+                @param section  The name of the section
+                @param name     The name of the entry
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
             inline const std::string& getValue(const std::string& section, const std::string& name, bool bString)
             {
@@ -281,6 +427,28 @@
                 return (sectionPtr ? sectionPtr->getValue(name, bString) : BLANKSTRING);
             }
-            const std::string& getOrCreateValue(const std::string& section, const std::string& name, const std::string& fallback, bool bString);
-
+            /**
+                @brief Returns the value of a given entry in the config file. If it doesn't exist, the entry is created using the fallback value.
+
+                @param section  The name of the section
+                @param name     The name of the entry
+                @param fallback The value that will be used if the entry doesn't exist
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            inline const std::string& getOrCreateValue(const std::string& section, const std::string& name, const std::string& fallback, bool bString)
+            {
+                const std::string& output = this->getOrCreateSection(section)->getOrCreateValue(name, fallback, bString);
+                this->saveIfUpdated();
+                return output;
+            }
+
+            /**
+                @brief Stores the value of an element of a vector in the config file. If the entry or its section doesn't exist, it's created.
+
+                @param section  The name of the section
+                @param name     The name of the vector
+                @param index    The index of the element in the vector
+                @param value    The new value
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
             inline void setValue(const std::string& section, const std::string& name, unsigned int index, const std::string& value, bool bString)
             {
@@ -288,4 +456,12 @@
                 this->save();
             }
+            /**
+                @brief Returns the value of a given element of a vector in the config file. Returns a blank string if the value doesn't exist.
+
+                @param section  The name of the section
+                @param name     The name of the vector
+                @param index    The index of the element in the vector
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
             inline const std::string& getValue(const std::string& section, const std::string& name, unsigned int index, bool bString)
             {
@@ -293,7 +469,26 @@
                 return (sectionPtr ? sectionPtr->getValue(name, index, bString) : BLANKSTRING);
             }
-            const std::string& getOrCreateValue(const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString);
+            /**
+                @brief Returns the value of a given element of a vector in the config file. If it doesn't exist, the entry is created using the fallback value.
+
+                @param section  The name of the section
+                @param name     The name of the vector
+                @param index    The index of the element in the vector
+                @param fallback The value that will be used if the entry doesn't exist
+                @param bString  If true, the value is treated as string which means some special treatment of special characters.
+            */
+            const std::string& getOrCreateValue(const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString)
+            {
+                const std::string& output = this->getOrCreateSection(section)->getOrCreateValue(name, index, fallback, bString);
+                this->saveIfUpdated();
+                return output;
+            }
 
             void deleteVectorEntries(const std::string& section, const std::string& name, unsigned int startindex = 0);
+            /**
+                @brief Returns the size of a config vector.
+                @param section  The section of the vector
+                @param name     The name of the vector
+            */
             inline unsigned int getVectorSize(const std::string& section, const std::string& name) const
             {
@@ -302,5 +497,5 @@
             }
 
-            static const char* DEFAULT_CONFIG_FOLDER;
+            static const char* DEFAULT_CONFIG_FOLDER;   ///< The folder where the default config files will be stored
 
         protected:
@@ -308,11 +503,12 @@
             ConfigFileSection* getOrCreateSection(const std::string& section);
 
-            std::list<ConfigFileSection*> sections_;
+            std::list<ConfigFileSection*> sections_;    ///< A list of sections in this config file
 
         private:
             void saveIfUpdated();
-            const std::string filename_;
-            const bool bCopyFallbackFile_;
-            bool bUpdated_;
+
+            const std::string filename_;                ///< The filename of this config file
+            const bool bCopyFallbackFile_;              ///< If true, the default config file is copied into the config-directory before loading the file
+            bool bUpdated_;                             ///< Becomes true if a section is added
     };
 
@@ -321,4 +517,13 @@
     // SettingsConfigFile //
     ////////////////////////
+    /**
+        @brief Child class of ConfigFile, used to store the settings of the game.
+
+        In addition to ConfigFile, this class provides an interface to manipulate the settings
+        with console commands and to cache entries in instances of ConfigValueContainer.
+
+        SettingsConfigFile is a Singleton, meaning there's only one instance of this class
+        (and thus only one config file that stores settings).
+    */
     class _CoreExport SettingsConfigFile // tolua_export
         : public ConfigFile, public Singleton<SettingsConfigFile>
@@ -343,8 +548,11 @@
             void removeConfigValueContainer(ConfigValueContainer* container);
 
+            /// Returns a set containing the names of all sections in this config file.
             inline const std::set<std::string>& getSectionNames()
                 { return this->sectionNames_; }
+            /// Returns the lower-bound-iterator of the @ref ConfigValueContainer "config value containers" for the given section.
             inline ContainerMap::const_iterator getContainerLowerBound(const std::string section)
                 { return this->containers_.lower_bound(section); }
+            /// Returns the upper-bound-iterator of the @ref ConfigValueContainer "config value containers" for the given section.
             inline ContainerMap::const_iterator getContainerUpperBound(const std::string section)
                 { return this->containers_.upper_bound(section); }
@@ -356,7 +564,7 @@
             bool configImpl(const std::string& section, const std::string& entry, const std::string& value, bool (ConfigValueContainer::*function)(const MultiType&));
 
-            ContainerMap containers_;
-            std::set<std::string> sectionNames_;
-            static SettingsConfigFile* singletonPtr_s;
+            ContainerMap containers_;                   ///< Stores all @ref ConfigValueContainer "config value containers"
+            std::set<std::string> sectionNames_;        ///< Stores all section names
+            static SettingsConfigFile* singletonPtr_s;  ///< The singleton pointer
     }; // tolua_export
 
@@ -365,4 +573,7 @@
     // ConfigFileManager //
     ///////////////////////
+    /**
+        @brief Manages the different config files (settings, calibration, etc). Implemented as Singleton.
+    */
     class _CoreExport ConfigFileManager : public Singleton<ConfigFileManager>
     {
@@ -374,4 +585,5 @@
             void setFilename(ConfigFileType::Value type, const std::string& filename);
 
+            /// Returns the config file of a given type (settings, calibration, etc.)
             inline ConfigFile* getConfigFile(ConfigFileType::Value type)
             {
@@ -381,8 +593,8 @@
 
         private:
-            ConfigFileManager(const ConfigFileManager&);
-
-            boost::array<ConfigFile*, 3> configFiles_;
-            static ConfigFileManager* singletonPtr_s;
+            ConfigFileManager(const ConfigFileManager&);    ///< Copy-constructor: not implemented
+
+            boost::array<ConfigFile*, 3> configFiles_;      ///< Stores the config files for each type in an array (must have the same size like ConfigFileType::Value)
+            static ConfigFileManager* singletonPtr_s;       ///< Stores the singleton-pointer
     };
 } // tolua_export
Index: code/branches/doc/src/libraries/core/OrxonoxClass.cc
===================================================================
--- code/branches/doc/src/libraries/core/OrxonoxClass.cc	(revision 7372)
+++ code/branches/doc/src/libraries/core/OrxonoxClass.cc	(revision 7373)
@@ -41,5 +41,7 @@
 namespace orxonox
 {
-    /** @brief Constructor: Sets the default values. */
+    /**
+        @brief Constructor: Sets the default values.
+    */
     OrxonoxClass::OrxonoxClass()
     {
@@ -53,5 +55,7 @@
     }
 
-    /** @brief Destructor: Deletes, if existing, the list of the parents. */
+    /**
+        @brief Destructor: Removes the object from the object-lists, notifies all @ref WeakPtr "weak pointers" that this object is being deleted.
+    */
     OrxonoxClass::~OrxonoxClass()
     {
@@ -72,5 +76,7 @@
     }
 
-    /** @brief Deletes the object if no smart pointers point to this object. Otherwise schedules the object to be deleted as soon as possible. */
+    /**
+        @brief Deletes the object if no @ref orxonox::SmartPtr "smart pointers" point to this object. Otherwise schedules the object to be deleted as soon as possible.
+    */
     void OrxonoxClass::destroy()
     {
@@ -85,4 +91,7 @@
     }
 
+    /**
+        @brief Removes this object from the object-lists.
+    */
     void OrxonoxClass::unregisterObject()
     {
@@ -92,40 +101,40 @@
     }
 
-    /** @brief Returns true if the objects class is of the given type or a derivative. */
+    /// Returns true if the object's class is of the given type or a derivative.
     bool OrxonoxClass::isA(const Identifier* identifier)
         { return this->getIdentifier()->isA(identifier); }
-    /** @brief Returns true if the objects class is exactly of the given type. */
+    /// Returns true if the object's class is exactly of the given type.
     bool OrxonoxClass::isExactlyA(const Identifier* identifier)
         { return this->getIdentifier()->isExactlyA(identifier); }
-    /** @brief Returns true if the objects class is a child of the given type. */
+    /// Returns true if the object's class is a child of the given type.
     bool OrxonoxClass::isChildOf(const Identifier* identifier)
         { return this->getIdentifier()->isChildOf(identifier); }
-    /** @brief Returns true if the objects class is a direct child of the given type. */
+    /// Returns true if the object's class is a direct child of the given type.
     bool OrxonoxClass::isDirectChildOf(const Identifier* identifier)
         { return this->getIdentifier()->isDirectChildOf(identifier); }
-    /** @brief Returns true if the objects class is a parent of the given type. */
+    /// Returns true if the object's class is a parent of the given type.
     bool OrxonoxClass::isParentOf(const Identifier* identifier)
         { return this->getIdentifier()->isParentOf(identifier); }
-    /** @brief Returns true if the objects class is a direct parent of the given type. */
+    /// Returns true if the object's class is a direct parent of the given type.
     bool OrxonoxClass::isDirectParentOf(const Identifier* identifier)
         { return this->getIdentifier()->isDirectParentOf(identifier); }
 
 
-    /** @brief Returns true if the objects class is of the given type or a derivative. */
+    /// Returns true if the object's class is of the given type or a derivative.
     bool OrxonoxClass::isA(const OrxonoxClass* object)
         { return this->getIdentifier()->isA(object->getIdentifier()); }
-    /** @brief Returns true if the objects class is exactly of the given type. */
+    /// Returns true if the object's class is exactly of the given type.
     bool OrxonoxClass::isExactlyA(const OrxonoxClass* object)
         { return this->getIdentifier()->isExactlyA(object->getIdentifier()); }
-    /** @brief Returns true if the objects class is a child of the given type. */
+    /// Returns true if the object's class is a child of the given type.
     bool OrxonoxClass::isChildOf(const OrxonoxClass* object)
         { return this->getIdentifier()->isChildOf(object->getIdentifier()); }
-    /** @brief Returns true if the objects class is a direct child of the given type. */
+    /// Returns true if the object's class is a direct child of the given type.
     bool OrxonoxClass::isDirectChildOf(const OrxonoxClass* object)
         { return this->getIdentifier()->isDirectChildOf(object->getIdentifier()); }
-    /** @brief Returns true if the objects class is a parent of the given type. */
+    /// Returns true if the object's class is a parent of the given type.
     bool OrxonoxClass::isParentOf(const OrxonoxClass* object)
         { return this->getIdentifier()->isParentOf(object->getIdentifier()); }
-    /** @brief Returns true if the objects class is a direct child of the given type. */
+    /// Returns true if the object's class is a direct child of the given type.
     bool OrxonoxClass::isDirectParentOf(const OrxonoxClass* object)
         { return this->getIdentifier()->isDirectParentOf(object->getIdentifier()); }
Index: code/branches/doc/src/libraries/core/OrxonoxClass.h
===================================================================
--- code/branches/doc/src/libraries/core/OrxonoxClass.h	(revision 7372)
+++ code/branches/doc/src/libraries/core/OrxonoxClass.h	(revision 7373)
@@ -63,5 +63,6 @@
 
         The BaseObject and Interfaces are derived with @c virtual @c public @c OrxonoxClass from OrxonoxClass.
-        OrxonoxClass is needed to create the class-hierarchy at startup and to store the Identifier and the MetaObjectList.
+        OrxonoxClass is needed to create the class-hierarchy at startup and to store the Identifier and the
+        MetaObjectList, as well as to provide an interface for SmartPtr and WeakPtr.
     */
     class _CoreExport OrxonoxClass
@@ -96,14 +97,20 @@
             bool isDirectParentOf(const Identifier* identifier);
 
+            /// Returns true if the object's class is of the given type or a derivative.
             template <class B> inline bool isA(const SubclassIdentifier<B>* identifier)
                 { return this->isA(*identifier); }
+            /// Returns true if the object's class is exactly of the given type.
             template <class B> inline bool isExactlyA(const SubclassIdentifier<B>* identifier)
                 { return this->isExactlyA(*identifier); }
+            /// Returns true if the object's class is a child of the given type.
             template <class B> inline bool isChildOf(const SubclassIdentifier<B>* identifier)
                 { return this->isChildOf(*identifier); }
+            /// Returns true if the object's class is a direct child of the given type.
             template <class B> inline bool isDirectChildOf(const SubclassIdentifier<B>* identifier)
                 { return this->isDirectChildOf(*identifier); }
+            /// Returns true if the object's class is a parent of the given type.
             template <class B> inline bool isParentOf(const SubclassIdentifier<B>* identifier)
                 { return this->isParentOf(*identifier); }
+            /// Returns true if the object's class is a direct parent of the given type.
             template <class B> inline bool isDirectParentOf(const SubclassIdentifier<B>* identifier)
                 { return this->isDirectParentOf(*identifier); }
@@ -118,4 +125,5 @@
             virtual void clone(OrxonoxClass*& item) {}
 
+            /// Returns the number of @ref orxonox::SmartPtr "smart pointers" that point to this object.
             inline unsigned int getReferenceCount() const
                 { return this->referenceCount_; }
@@ -146,4 +154,5 @@
 
         protected:
+            /// This virtual function is called if destroy() is called and no SmartPtr points to this object. Used in some cases to create a new SmartPtr to prevent destruction.
             virtual void preDestroy() {}
 
@@ -169,10 +178,10 @@
                 { this->weakPointers_.erase(reinterpret_cast<WeakPtr<OrxonoxClass>*>(pointer)); }
 
-            Identifier* identifier_;                   //!< The Identifier of the object
-            std::set<const Identifier*>* parents_;     //!< List of all parents of the object
-            MetaObjectList* metaList_;                 //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in
-            int referenceCount_;                       //!< Counts the references from smart pointers to this object
-            bool requestedDestruction_;                //!< Becomes true after someone called delete on this object
-            std::set<WeakPtr<OrxonoxClass>*> weakPointers_; //!< All weak pointers which point to this object (and like to get notified if it dies)
+            Identifier* identifier_;                            //!< The Identifier of the object
+            std::set<const Identifier*>* parents_;              //!< List of all parents of the object
+            MetaObjectList* metaList_;                          //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in
+            int referenceCount_;                                //!< Counts the references from smart pointers to this object
+            bool requestedDestruction_;                         //!< Becomes true after someone called delete on this object
+            std::set<WeakPtr<OrxonoxClass>*> weakPointers_;     //!< All weak pointers which point to this object (and like to get notified if it dies)
 
             /// 'Fast map' that holds this-pointers of all derived types
Index: code/branches/doc/src/libraries/core/SmartPtr.h
===================================================================
--- code/branches/doc/src/libraries/core/SmartPtr.h	(revision 7372)
+++ code/branches/doc/src/libraries/core/SmartPtr.h	(revision 7373)
@@ -37,4 +37,81 @@
     @file
     @ingroup Object SmartPtr
+    @brief Definition of SmartPtr<T>.
+
+    @anchor SmartPtrExample
+
+    orxonox::SmartPtr is an implementation of a smart pointer - it wraps a pointer to an
+    object  and keeps this object alive until no SmartPtr points to this object anymore.
+    In contrast to orxonox::SharedPtr, SmartPtr works only with classes that are derived
+    from orxonox::OrxonoxClass, because it's an intrusive implementation, meaning the
+    reference counter is stored in the object itself.
+
+    It's possible to use normal pointers and smart pointers to an object simultaneously.
+    You don't have to use SmartPtr all the time, you can create a SmartPtr for an object
+    at any time and also convert it back to a normal pointer if you like. This is possible
+    because the reference counter is stored in the object itself and not in SmartPtr (in
+    contrast to SharedPtr).
+
+    @b Important: If you want to delete an object, you must not use @c delete @c object but
+    rather @c object->destroy(). This function will check if there are smart pointers
+    pointing to the object. If yes, the object will be kept alive until all smart pointes
+    are destroyed. If no, the object is deleted instantly.
+
+    If all smart pointers that point to an object are destroyed, but you never called
+    @c object->destroy() before, the object will not be deleted! All a SmartPtr will do
+    is to really just keep an object alive, but it will not delete it automatically
+    unless you tried to destroy it before.
+
+    Example:
+    @code
+    class MyClass                                           // class declaration
+    {
+        public:
+            void setObject(OtherClass* object)              // passes a normal pointer which will be stored in a SmartPtr
+                { this->object_ = object; }
+
+            OtherClass* getObject() const                   // converts the SmartPtr to a normal pointer and returns it
+                { return this->object_; }
+
+        private:
+            SmartPtr<OtherClass> object_;                   // a pointer to an instance of OtherClass is stored in a SmartPtr
+    };
+    @endcode
+    In this example we assume that OtherClass is a child of OrxonoxClass. We don't care
+    about the inheritance of MyClass though.
+
+    Now we create an instance of MyClass and assign a pointer to an instance of OtherClass:
+    @code
+    MyClass* myclass = new MyClass();                       // create an instance of MyClass
+    OtherClass* object = new OtherClass();                  // create an instance of OtherClass
+    myclass->setObject(object);                             // the object is now stored in a SmartPtr inside myclass
+
+    object->destroy();                                      // we try to destroy object, but there's still a SmartPtr pointing at it.
+
+    # object still exists at this point (because a SmartPtr points at it)
+
+    delete myclass;                                         // now we delete myclass, which also destroys the SmartPtr
+
+    # object doesn't exist anymore (because the SmartPtr is now destroyed)
+    @endcode
+
+    Now we look at the same example, but we first delete myclass, then destroy object:
+    @code
+    MyClass* myclass = new MyClass();                       // create an instance of MyClass
+    OtherClass* object = new OtherClass();                  // create an instance of OtherClass
+    myclass->setObject(object);                             // the object is now stored in a SmartPtr inside myclass
+
+    delete myclass;                                         // we delete myclass, which also destroys the SmartPtr
+
+    # object still exists at this point (because destroy() was not called yet)
+
+    object->destroy();                                      // now we try to destroy object, which works instantly
+
+    # object doesn't exist anymore (because we just destroyed it)
+    @endcode
+
+    Note that in any case @c object->destroy() has to be called to delete the object.
+    However if a SmartPtr points at it, the destruction is delayed until all SmartPtr
+    are destroyed.
 */
 
@@ -52,16 +129,24 @@
 namespace orxonox
 {
+    /**
+        @brief A smart pointer which wraps a pointer to an object and keeps this object alive as long as the smart pointer exists.
+
+        @see See @ref SmartPtrExample "this description" for more information and an example.
+    */
     template <class T>
     class SmartPtr
     {
         public:
+            /// Constructor: Initializes the smart pointer with a null pointer.
             inline SmartPtr() : pointer_(0), base_(0)
             {
             }
 
+            /// Constructor: Used to explicitly initialize the smart pointer with a null pointer
             inline SmartPtr(int) : pointer_(0), base_(0)
             {
             }
 
+            /// Constructor: Initializes the smart pointer with a pointer to an object. @param pointer The pointer @param bAddRef If true, the reference counter is increased. Don't set this to false unless you know exactly what you're doing! (for example to avoid circular references if the @c this pointer of the possessing object is stored)
             inline SmartPtr(T* pointer, bool bAddRef = true) : pointer_(pointer), base_(pointer)
             {
@@ -70,4 +155,5 @@
             }
 
+            /// Copy-constructor
             inline SmartPtr(const SmartPtr& other) : pointer_(other.pointer_), base_(other.base_)
             {
@@ -76,4 +162,5 @@
             }
 
+            /// Copy-constructor for smart pointers to objects of another class.
             template <class O>
             inline SmartPtr(const SmartPtr<O>& other) : pointer_(other.get()), base_(other.base_)
@@ -83,4 +170,5 @@
             }
 
+            /// Constructor: Initializes the smart pointer with the pointer that is stored in a WeakPtr.
             template <class O>
             inline SmartPtr(const WeakPtr<O>& other) : pointer_(other.get()), base_(other.getBase())
@@ -90,4 +178,5 @@
             }
 
+            /// Destructor: Decrements the reference counter.
             inline ~SmartPtr()
             {
@@ -96,4 +185,5 @@
             }
 
+            /// Used to assign a null pointer.
             inline SmartPtr& operator=(int)
             {
@@ -102,4 +192,5 @@
             }
 
+            /// Assigns a new pointer.
             inline SmartPtr& operator=(T* pointer)
             {
@@ -108,4 +199,5 @@
             }
 
+            /// Assigns the wrapped pointer of another SmartPtr.
             inline SmartPtr& operator=(const SmartPtr& other)
             {
@@ -114,4 +206,5 @@
             }
 
+            /// Assigns the wrapped pointer of a SmartPtr of another class
             template <class O>
             inline SmartPtr& operator=(const SmartPtr<O>& other)
@@ -121,4 +214,5 @@
             }
 
+            /// Assigns the wrapped pointer of a WeakPtr.
             template <class O>
             inline SmartPtr& operator=(const WeakPtr<O>& other)
@@ -128,4 +222,5 @@
             }
 
+            /// Returns the wrapped pointer as @c T*
             inline T* get() const
             {
@@ -133,4 +228,5 @@
             }
 
+            /// Returns the wrapped pointer as @c OrxonoxClass*
             inline OrxonoxClass* getBase() const
             {
@@ -138,4 +234,5 @@
             }
 
+            /// Implicitly converts the SmartPtr to a pointer of type @c T*
             inline operator T*() const
             {
@@ -143,4 +240,5 @@
             }
 
+            /// Overloaded operator, returns a pointer to the stored object.
             inline T* operator->() const
             {
@@ -149,4 +247,5 @@
             }
 
+            /// Overloaded operator, returns a reference to the stored object.
             inline T& operator*() const
             {
@@ -155,4 +254,5 @@
             }
 
+            /// Returns true if the wrapped pointer is NULL.
             inline bool operator!() const
             {
@@ -160,4 +260,5 @@
             }
 
+            /// Swaps the contents of two smart pointers.
             inline void swap(SmartPtr& other)
             {
@@ -174,4 +275,5 @@
             }
 
+            /// Resets the smart pointer (equivalent to assigning a NULL pointer).
             inline void reset()
             {
@@ -180,8 +282,9 @@
 
         private:
-            T* pointer_;
-            OrxonoxClass* base_;
+            T* pointer_;            ///< The wrapped pointer to an object of type @a T
+            OrxonoxClass* base_;    ///< The wrapped pointer, casted up to OrxonoxClass (this is needed because with just a T* pointer, SmartPtr couln't be used with forward declarations)
     };
 
+    /// Swaps the contents of two smart pointers.
     template <class T>
     void swap(SmartPtr<T>& a, SmartPtr<T>& b)
@@ -190,4 +293,5 @@
     }
 
+    /// Uses a static_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new SmartPtr<T>.
     template <class T, class U>
     SmartPtr<T> static_pointer_cast(const SmartPtr<U>& p)
@@ -196,4 +300,5 @@
     }
 
+    /// Uses a const_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new SmartPtr<T>.
     template <class T, class U>
     SmartPtr<T> const_pointer_cast(const SmartPtr<U>& p)
@@ -202,4 +307,5 @@
     }
 
+    /// Uses a dynamic_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new SmartPtr<T>.
     template <class T, class U>
     SmartPtr<T> dynamic_pointer_cast(const SmartPtr<U>& p)
Index: code/branches/doc/src/libraries/core/WeakPtr.h
===================================================================
--- code/branches/doc/src/libraries/core/WeakPtr.h	(revision 7372)
+++ code/branches/doc/src/libraries/core/WeakPtr.h	(revision 7373)
@@ -32,4 +32,48 @@
     @file
     @ingroup Object SmartPtr
+    @brief Definition of WeakPtr<T>.
+
+    @anchor WeakPtrExample
+
+    A WeakPtr wraps a pointer to an object. If the object gets deleted, the WeakPtr becomes
+    NULL. This can be used to store pointers to objects without knowing when they will be
+    destroyed.
+
+    WeakPtr works only with objects that are derived from orxonox::OrxonoxClass, because
+    WeakPtr is intrusive and registers itself in the stored object, to get a notification if
+    the object is being deleted.
+
+    Example:
+    @code
+    MyClass* object = new MyClass();                    // create an instance of MyClass
+
+    WeakPtr<MyClass> pointer = object;                  // create a WeakPtr and assign the object
+
+    if (pointer)                                        // checks if pointer is not NULL (which is true)
+        pointer->someFunction();                        // calls MyClass::someFunction()
+
+    object->destroy();                                  // calls destroy() which deletes the object
+
+    if (pointer)                                        // checks if pointer is not NULL (which is now false)
+        pointer->someFunction();                        // this will not be executed
+    @endcode
+    In this example we assumed that MyClass is derived of OrxonoxClass (otherwise it couldn't
+    be used with a WeakPtr).
+
+    A callback can be registerd with the WeakPtr that will be called if the object gets deleted.
+    @code
+    void myCallback()                                   // definition of the callback function
+    {
+        COUT(0) << "Object destroyed" << std::endl;
+    }
+
+    MyClass* object = new MyClass();                    // create an instance of MyClass
+
+    WeakPtr<MyClass> pointer = object;                  // create a WeakPtr and assign the object
+
+    pointer.setCallback(createFunctor(&myCallback));    // defines a callback
+
+    object->destroy();                                  // calls destroy() which deletes the object. prints "Object destroyed" to the console
+    @endcode
 */
 
@@ -46,4 +90,9 @@
 namespace orxonox
 {
+    /**
+        @brief WeakPtr wraps a pointer to an object, which becomes NULL if the object is deleted.
+
+        @see See @ref WeakPtrExample "this description" for more information and an example.
+    */
     template <class T>
     class WeakPtr
@@ -52,12 +101,15 @@
 
         public:
+            /// Constructor: Initializes the weak pointer with a null pointer.
             inline WeakPtr() : pointer_(0), base_(0), callback_(0)
             {
             }
 
+            /// Constructor: Used to explicitly initialize the weak pointer with a null pointer
             inline WeakPtr(int) : pointer_(0), base_(0), callback_(0)
             {
             }
 
+            /// Constructor: Initializes the weak pointer with a pointer to an object.
             inline WeakPtr(T* pointer) : pointer_(pointer), base_(pointer), callback_(0)
             {
@@ -66,4 +118,5 @@
             }
 
+            /// Copy-constructor
             inline WeakPtr(const WeakPtr& other) : pointer_(other.pointer_), base_(other.base_), callback_(0)
             {
@@ -72,4 +125,5 @@
             }
 
+            /// Copy-constructor for weak pointers to objects of another class.
             template <class O>
             inline WeakPtr(const WeakPtr<O>& other) : pointer_(other.get()), base_(other.base_), callback_(0)
@@ -79,4 +133,5 @@
             }
 
+            /// Destructor
             inline ~WeakPtr()
             {
@@ -86,4 +141,5 @@
             }
 
+            /// Used to assign a null pointer.
             inline WeakPtr& operator=(int)
             {
@@ -92,4 +148,5 @@
             }
 
+            /// Assigns a new pointer.
             inline WeakPtr& operator=(T* pointer)
             {
@@ -98,4 +155,5 @@
             }
 
+            /// Assigns the wrapped pointer of another WeakPtr.
             inline WeakPtr& operator=(const WeakPtr& other)
             {
@@ -104,4 +162,5 @@
             }
 
+            /// Assigns the wrapped pointer of a WeakPtr of another class
             template <class O>
             inline WeakPtr& operator=(const WeakPtr<O>& other)
@@ -111,4 +170,5 @@
             }
 
+            /// Returns the wrapped pointer as @c T*
             inline T* get() const
             {
@@ -116,4 +176,5 @@
             }
 
+            /// Returns the wrapped pointer as @c OrxonoxClass*
             inline OrxonoxClass* getBase() const
             {
@@ -121,4 +182,5 @@
             }
 
+            /// Implicitly converts the WeakPtr to a pointer of type @c T*
             inline operator T*() const
             {
@@ -126,4 +188,5 @@
             }
 
+            /// Overloaded operator, returns a pointer to the stored object.
             inline T* operator->() const
             {
@@ -132,4 +195,5 @@
             }
 
+            /// Overloaded operator, returns a reference to the stored object.
             inline T& operator*() const
             {
@@ -138,4 +202,5 @@
             }
 
+            /// Returns true if the wrapped pointer is NULL.
             inline bool operator!() const
             {
@@ -143,4 +208,5 @@
             }
 
+            /// Swaps the contents of two weak pointers.
             inline void swap(WeakPtr& other)
             {
@@ -167,4 +233,5 @@
             }
 
+            /// Resets the weak pointer (equivalent to assigning a NULL pointer).
             inline void reset()
             {
@@ -172,4 +239,5 @@
             }
 
+            /// Registers a callback that will be executed if the stored object is destroyed.
             inline void setCallback(const FunctorPtr& callback)
             {
@@ -177,4 +245,5 @@
             }
 
+            /// Returns the registered callback.
             inline const FunctorPtr& getCallback() const
             {
@@ -183,4 +252,5 @@
 
         private:
+            /// Will be called by OrxonoxClass::~OrxonoxClass() if the stored object is deleted. Resets the wrapped pointer and executes the callback.
             inline void objectDeleted()
             {
@@ -191,9 +261,10 @@
             }
 
-            T* pointer_;
-            OrxonoxClass* base_;
-            FunctorPtr callback_;
+            T* pointer_;            ///< The wrapped pointer to an object of type @a T
+            OrxonoxClass* base_;    ///< The wrapped pointer, casted up to OrxonoxClass (this is needed because with just a T* pointer, WeakPtr couln't be used with forward declarations)
+            FunctorPtr callback_;   ///< This callback will be executed if the stored object is deleted
     };
 
+    /// Swaps the contents of two weak pointers.
     template <class T>
     void swap(WeakPtr<T>& a, WeakPtr<T>& b)
@@ -202,4 +273,5 @@
     }
 
+    /// Uses a static_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new WeakPtr<T>.
     template <class T, class U>
     WeakPtr<T> static_pointer_cast(const WeakPtr<U>& p)
@@ -208,4 +280,5 @@
     }
 
+    /// Uses a const_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new WeakPtr<T>.
     template <class T, class U>
     WeakPtr<T> const_pointer_cast(const WeakPtr<U>& p)
@@ -214,4 +287,5 @@
     }
 
+    /// Uses a dynamic_cast to cast a pointer of type U* to a pointer of type T* and returns it in a new WeakPtr<T>.
     template <class T, class U>
     WeakPtr<T> dynamic_pointer_cast(const WeakPtr<U>& p)
