Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 15, 2008, 4:31:58 PM (16 years ago)
Author:
landauf
Message:
  • removed IdentifierList and replaced it by a std::list
  • changed several doxygen tags
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core/src/orxonox/core/Identifier.h

    r812 r813  
    2626 */
    2727
    28 /*!
     28/**
    2929    @file Identifier.h
    3030    @brief Definition of the Identifier, ClassIdentifier and SubclassIdentifier classes, implementation of the ClassIdentifier and SubclassIdentifier classes.
     
    5252#define _Identifier_H__
    5353
     54#include <list>
    5455#include <map>
    5556#include <string>
     
    5960
    6061#include "ObjectList.h"
    61 #include "IdentifierList.h"
     62//#include "IdentifierList.h"
    6263#include "Debug.h"
    6364#include "Iterator.h"
     
    109110            virtual void removeObjects() const = 0;
    110111
    111             /** @returns the name of the class the Identifier belongs to. */
     112            /** @brief Returns the name of the class the Identifier belongs to. @return The name */
    112113            inline const std::string& getName() const { return this->name_; }
    113114
    114             /** @returns the parents of the class the Identifier belongs to. */
    115             inline const IdentifierList& getParents() const { return this->parents_; }
    116 
    117             /** @returns the children of the class the Identifier belongs to. */
    118             inline IdentifierList& getChildren() const { return *this->children_; }
    119 
    120             /** @returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. */
     115            /** @brief Returns the parents of the class the Identifier belongs to. @return The list of all parents */
     116            inline const std::list<const Identifier*>& getParents() const { return this->parents_; }
     117
     118//            /** @brief Returns the children of the class the Identifier belongs to. @return The list of all children */
     119//            inline const std::list<const Identifier*>& getChildren() const { return (*this->children_); }
     120
     121            /** @brief Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. @return The status of the class-hierarchy creation */
    121122            inline static bool isCreatingHierarchy() { return (hierarchyCreatingCounter_s > 0); }
    122123
    123             /** @returns the network ID to identify a class through the network. */
     124            /** @brief Returns the network ID to identify a class through the network. @return the network ID */
    124125            inline const unsigned int getNetworkID() const { return this->classID_; }
    125126
     
    127128            void setNetworkID(unsigned int id);
    128129
    129             /** @returns the ConfigValueContainer of a variable, given by the string of its name. @param varname The name of the variable */
     130            /** @brief Returns the ConfigValueContainer of a variable, given by the string of its name. @param varname The name of the variable @return The ConfigValueContainer */
    130131            inline ConfigValueContainer* getConfigValueContainer(const std::string& varname)
    131132                { return this->configValues_[varname]; }
     
    139140            Identifier(const Identifier& identifier) {} // don't copy
    140141            virtual ~Identifier();
    141             void initialize(const IdentifierList* parents);
     142            void initialize(std::list<const Identifier*>* parents);
     143
     144            /** @brief Returns the parents of the class the Identifier belongs to. @return The list of all parents */
     145            inline std::list<const Identifier*>& getParents() { return this->parents_; }
     146
     147            /** @brief Returns the children of the class the Identifier belongs to. @return The list of all children */
     148            inline std::list<const Identifier*>& getChildren() const { return (*this->children_); }
    142149
    143150            /**
     
    159166            }
    160167
    161             IdentifierList parents_;                                    //!< The Parents of the class the Identifier belongs to
    162             IdentifierList* children_;                                  //!< The Children of the class the Identifier belongs to
     168            static bool identifierIsInList(const Identifier* identifier, const std::list<const Identifier*>& list);
     169
     170//            IdentifierList parents_;                                    //!< The Parents of the class the Identifier belongs to
     171//            IdentifierList* children_;                                  //!< The Children of the class the Identifier belongs to
     172            std::list<const Identifier*> parents_;                      //!< The Parents of the class the Identifier belongs to
     173            std::list<const Identifier*>* children_;                    //!< The Children of the class the Identifier belongs to
    163174
    164175            std::string name_;                                          //!< The name of the class the Identifier belongs to
     
    194205
    195206        public:
    196             ClassIdentifier<T>* registerClass(const IdentifierList* parents, const std::string& name, bool bRootClass);
     207            ClassIdentifier<T>* registerClass(std::list<const Identifier*>* parents, const std::string& name, bool bRootClass);
    197208            void addObject(T* object);
    198209            void removeObjects() const;
     
    220231    /**
    221232        @brief Registers a class, which means that the name and the parents get stored.
    222         @param parents An IdentifierList, containing the Identifiers of all parents of the class
     233        @param parents A list, containing the Identifiers of all parents of the class
    223234        @param name A string, containing exactly the name of the class
    224235        @param bRootClass True if the class is either an Interface or the BaseObject itself
     
    226237    */
    227238    template <class T>
    228     ClassIdentifier<T>* ClassIdentifier<T>::registerClass(const IdentifierList* parents, const std::string& name, bool bRootClass)
     239    ClassIdentifier<T>* ClassIdentifier<T>::registerClass(std::list<const Identifier*>* parents, const std::string& name, bool bRootClass)
    229240    {
    230241        COUT(4) << "*** ClassIdentifier: Register Class in " << name << "-Singleton." << std::endl;
     
    383394            }
    384395
    385             /** @returns the assigned identifier. */
     396            /** @brief Returns the assigned identifier. @return The identifier */
    386397            inline const Identifier* getIdentifier() const
    387398                { return this->identifier_; }
    388399
    389             /** @returns true, if the assigned identifier is at least of the given type. @param identifier The identifier to compare with */
     400            /** @brief Returns true, if the assigned identifier is at least of the given type. @param identifier The identifier to compare with */
    390401            inline bool isA(const Identifier* identifier) const
    391402                { return this->identifier_->isA(identifier); }
    392403
    393             /** @returns true, if the assigned identifier is exactly of the given type. @param identifier The identifier to compare with */
     404            /** @brief Returns true, if the assigned identifier is exactly of the given type. @param identifier The identifier to compare with */
    394405            inline bool isDirectlyA(const Identifier* identifier) const
    395406                { return this->identifier_->isDirectlyA(identifier); }
    396407
    397             /** @returns true, if the assigned identifier is a child of the given identifier. @param identifier The identifier to compare with */
     408            /** @brief Returns true, if the assigned identifier is a child of the given identifier. @param identifier The identifier to compare with */
    398409            inline bool isChildOf(const Identifier* identifier) const
    399410                { return this->identifier_->isChildOf(identifier); }
    400411
    401             /** @returns true, if the assigned identifier is a parent of the given identifier. @param identifier The identifier to compare with */
     412            /** @brief Returns true, if the assigned identifier is a parent of the given identifier. @param identifier The identifier to compare with */
    402413            inline bool isParentOf(const Identifier* identifier) const
    403414                { return this->identifier_->isParentOf(identifier); }
Note: See TracChangeset for help on using the changeset viewer.