Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 9, 2007, 11:21:14 PM (16 years ago)
Author:
landauf
Message:
  • added comments and doxygen-tags to the ConfigValueContainer
  • changed some comments in the other files
File:
1 edited

Legend:

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

    r434 r447  
    77     - a list with all objects
    88     - parents and childs
    9      - the factory, if available
     9     - the factory (if available)
    1010     - the networkID that can be synchronised with the server
     11     - all configurable variables (if available)
    1112
    1213    Every object has a pointer to the Identifier of its class. This allows the use isA(...),
     
    1819
    1920    SubclassIdentifier is a separated class, acting like an Identifier, but has a given class.
    20     You can only assign Identifiers of the given class or a derivative to a SubclassIdentifier.
     21    You can only assign Identifiers of exactly the given class or of a derivative to a SubclassIdentifier.
    2122*/
    2223
     
    4849         - a list with all objects
    4950         - parents and childs
    50          - the factory, if available
     51         - the factory (if available)
    5152         - the networkID that can be synchronised with the server
     53         - all configurable variables (if available)
    5254
    5355        Every object has a pointer to the Identifier of its class. This allows the use isA(...),
     
    8789            inline IdentifierList& getChildren() const { return *this->children_; }
    8890
    89             /** @returns true, if a branch of the class-hierarchy is getting created, causing all new objects to store their parents. */
     91            /** @returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. */
    9092            inline static bool isCreatingHierarchy() { return (hierarchyCreatingCounter_s > 0); }
    9193
    92             /** @returns the NetworkID to identify a class through the network. */
     94            /** @returns the network ID to identify a class through the network. */
    9395            inline const unsigned int getNetworkID() const { return this->classID_; }
    9496
     97            /** @brief Sets the network ID to a new value. @param id The new value */
    9598            void setNetworkID(unsigned int id);
    9699
     100            /** @returns the ConfigValueContainer of a variable, given by the string of its name. @param varname The name of the variable */
    97101            inline ConfigValueContainer* getConfigValueContainer(const std::string& varname)
    98102                { return this->configValues_[varname]; }
    99103
     104            /** @brief Sets the ConfigValueContainer of a variable, given by the string of its name. @param varname The name of the variablee @param container The container */
    100105            inline void setConfigValueContainer(const std::string& varname, ConfigValueContainer* container)
    101106                { this->configValues_[varname] = container; }
     
    134139            std::string name_;                                          //!< The name of the class the Identifier belongs to
    135140
    136             BaseFactory* factory_;                                      //!< The Factory, able to create new objects of the given class
     141            BaseFactory* factory_;                                      //!< The Factory, able to create new objects of the given class (if available)
    137142            bool bCreatedOneObject_;                                    //!< True if at least one object of the given type was created (used to determine the need of storing the parents)
    138143            static int hierarchyCreatingCounter_s;                      //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading)
    139             static unsigned int classIDcounter_s;                       //!< The number of unique Identifiers
    140             unsigned int classID_;                                      //!< The networkID to identify a class through the network
    141             std::map<std::string, ConfigValueContainer*> configValues_;
     144            static unsigned int classIDcounter_s;                       //!< The number of existing Identifiers
     145            unsigned int classID_;                                      //!< The network ID to identify a class through the network
     146            std::map<std::string, ConfigValueContainer*> configValues_; //!< A map to link the string of configurable variables with their ConfigValueContainer
    142147    };
    143148
     
    173178
    174179    /**
    175         @brief Constructor: Create the ObjectList.
     180        @brief Constructor: Creates the ObjectList.
    176181    */
    177182    template <class T>
     
    182187
    183188    /**
    184         @brief Destructor: Delete the ObjectList, set the singleton-pointer to zero.
     189        @brief Destructor: Deletes the ObjectList, sets the singleton-pointer to zero.
    185190    */
    186191    template <class T>
     
    195200        @param parents An IdentifierList, containing the Identifiers of all parents of the class
    196201        @param name A string, containing exactly the name of the class
    197         @param bRootClass True if the class is either an Interface or BaseObject itself
     202        @param bRootClass True if the class is either an Interface or the BaseObject itself
    198203        @return The ClassIdentifier itself
    199204    */
     
    235240
    236241    /**
    237         @returns the Identifier itself
     242        @returns the Identifier itself.
    238243    */
    239244    template <class T>
     
    270275    //! The SubclassIdentifier acts almost like an Identifier, but has some prerequisites.
    271276    /**
    272         You can only assign Identifiers that belong to a class of at least B (or derived) to a SubclassIdentifier<T>.
     277        You can only assign an Identifier that belongs to a class T (or derived) to a SubclassIdentifier<T>.
    273278        If you assign something else, the program aborts.
    274279        Because we know the minimal type, a dynamic_cast is done, which makes it easier to create a new object.
     
    323328
    324329            /**
    325                 @brief Creates a new object of the type of the assigned identifier and dynamic_casts it to the minimal type given by the SubclassIdentifier.
     330                @brief Creates a new object of the type of the assigned Identifier and dynamic_casts it to the minimal type given by T.
    326331                @return The new object
    327332            */
     
    330335                BaseObject* newObject = this->identifier_->fabricate();
    331336
    332                 // Check if the creation worked
     337                // Check if the creation was successful
    333338                if (newObject)
    334339                {
Note: See TracChangeset for help on using the changeset viewer.