Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 24, 2009, 11:32:39 AM (15 years ago)
Author:
rgrieder
Message:

Applied changes to the real sandbox this time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/src/libraries/core/Identifier.h

    r5738 r5782  
    6666#include "ObjectList.h"
    6767#include "ObjectListBase.h"
    68 #include "Super.h"
    6968
    7069namespace orxonox
     
    107106            bool isDirectParentOf(const Identifier* identifier) const;
    108107
    109             /** @brief Returns true if the class can be loaded through XML. */
    110             inline bool isLoadable() const { return this->bLoadable_; }
    111             /** @brief Set the class to be loadable through XML or not. */
    112             inline void setLoadable(bool bLoadable) { this->bLoadable_ = bLoadable; }
    113 
    114108            /** @brief Returns the list of all existing objects of this class. @return The list */
    115109            inline ObjectListBase* getObjects() const
     
    181175
    182176
    183             /** @brief Returns the map that stores all console commands. @return The const_iterator */
    184             inline const std::map<std::string, ConsoleCommand*>& getConsoleCommandMap() const { return this->consoleCommands_; }
    185             /** @brief Returns a const_iterator to the beginning of the map that stores all console commands. @return The const_iterator */
    186             inline std::map<std::string, ConsoleCommand*>::const_iterator getConsoleCommandMapBegin() const { return this->consoleCommands_.begin(); }
    187             /** @brief Returns a const_iterator to the end of the map that stores all console commands. @return The const_iterator */
    188             inline std::map<std::string, ConsoleCommand*>::const_iterator getConsoleCommandMapEnd() const { return this->consoleCommands_.end(); }
    189 
    190             /** @brief Returns the map that stores all console commands with their names in lowercase. @return The const_iterator */
    191             inline const std::map<std::string, ConsoleCommand*>& getLowercaseConsoleCommandMap() const { return this->consoleCommands_LC_; }
    192             /** @brief Returns a const_iterator to the beginning of the map that stores all console commands with their names in lowercase. @return The const_iterator */
    193             inline std::map<std::string, ConsoleCommand*>::const_iterator getLowercaseConsoleCommandMapBegin() const { return this->consoleCommands_LC_.begin(); }
    194             /** @brief Returns a const_iterator to the end of the map that stores all console commands with their names in lowercase. @return The const_iterator */
    195             inline std::map<std::string, ConsoleCommand*>::const_iterator getLowercaseConsoleCommandMapEnd() const { return this->consoleCommands_LC_.end(); }
    196 
    197             /** @brief Returns the map that stores all XMLPort params. @return The const_iterator */
    198             inline const std::map<std::string, XMLPortParamContainer*>& getXMLPortParamMap() const { return this->xmlportParamContainers_; }
    199             /** @brief Returns a const_iterator to the beginning of the map that stores all XMLPort params. @return The const_iterator */
    200             inline std::map<std::string, XMLPortParamContainer*>::const_iterator getXMLPortParamMapBegin() const { return this->xmlportParamContainers_.begin(); }
    201             /** @brief Returns a const_iterator to the end of the map that stores all XMLPort params. @return The const_iterator */
    202             inline std::map<std::string, XMLPortParamContainer*>::const_iterator getXMLPortParamMapEnd() const { return this->xmlportParamContainers_.end(); }
    203 
    204             /** @brief Returns the map that stores all XMLPort objects. @return The const_iterator */
    205             inline const std::map<std::string, XMLPortObjectContainer*>& getXMLPortObjectMap() const { return this->xmlportObjectContainers_; }
    206             /** @brief Returns a const_iterator to the beginning of the map that stores all XMLPort objects. @return The const_iterator */
    207             inline std::map<std::string, XMLPortObjectContainer*>::const_iterator getXMLPortObjectMapBegin() const { return this->xmlportObjectContainers_.begin(); }
    208             /** @brief Returns a const_iterator to the end of the map that stores all XMLPort objects. @return The const_iterator */
    209             inline std::map<std::string, XMLPortObjectContainer*>::const_iterator getXMLPortObjectMapEnd() const { return this->xmlportObjectContainers_.end(); }
    210 
    211             /** @brief Returns the map that stores all XMLPort events. @return The const_iterator */
    212             inline const std::map<std::string, XMLPortObjectContainer*>& getXMLPortEventMap() const { return this->xmlportEventContainers_; }
    213             /** @brief Returns a const_iterator to the beginning of the map that stores all XMLPort events. @return The const_iterator */
    214             inline std::map<std::string, XMLPortObjectContainer*>::const_iterator getXMLPortEventMapBegin() const { return this->xmlportEventContainers_.begin(); }
    215             /** @brief Returns a const_iterator to the end of the map that stores all XMLPort events. @return The const_iterator */
    216             inline std::map<std::string, XMLPortObjectContainer*>::const_iterator getXMLPortEventMapEnd() const { return this->xmlportEventContainers_.end(); }
    217 
    218177            /** @brief Returns true if this class has at least one config value. @return True if this class has at least one config value */
    219178            inline bool hasConfigValues() const { return this->bHasConfigValues_; }
    220             /** @brief Returns true if this class has at least one console command. @return True if this class has at least one console command */
    221             inline bool hasConsoleCommands() const { return this->bHasConsoleCommands_; }
    222179
    223180            /** @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 */
    224181            inline static bool isCreatingHierarchy() { return (hierarchyCreatingCounter_s > 0); }
    225 
    226             /** @brief Returns the network ID to identify a class through the network. @return the network ID */
    227             inline const uint32_t getNetworkID() const { return this->networkID_; }
    228 
    229             /** @brief Sets the network ID to a new value. @param id The new value */
    230             void setNetworkID(uint32_t id);
    231182
    232183            /** @brief Returns the unique ID of the class */
     
    236187            ConfigValueContainer* getConfigValueContainer(const std::string& varname);
    237188            ConfigValueContainer* getLowercaseConfigValueContainer(const std::string& varname);
    238 
    239             void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container);
    240             XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname);
    241 
    242             void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container);
    243             XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname);
    244 
    245             void addXMLPortEventContainer(const std::string& eventname, XMLPortObjectContainer* container);
    246             XMLPortObjectContainer* getXMLPortEventContainer(const std::string& eventname);
    247 
    248             ConsoleCommand& addConsoleCommand(ConsoleCommand* command, bool bCreateShortcut);
    249             ConsoleCommand* getConsoleCommand(const std::string& name) const;
    250             ConsoleCommand* getLowercaseConsoleCommand(const std::string& name) const;
    251189
    252190            void initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass);
     
    260198
    261199            static Identifier* getIdentifierSingleton(const std::string& name, Identifier* proposal);
    262             virtual void createSuperFunctionCaller() const = 0;
    263200
    264201            /** @brief Returns the map that stores all Identifiers. @return The map */
     
    305242            bool bCreatedOneObject_;                                       //!< True if at least one object of the given type was created (used to determine the need of storing the parents)
    306243            bool bSetName_;                                                //!< True if the name is set
    307             bool bLoadable_;                                               //!< False = it's not permitted to load the object through XML
    308244            std::string name_;                                             //!< The name of the class the Identifier belongs to
    309245            BaseFactory* factory_;                                         //!< The Factory, able to create new objects of the given class (if available)
    310246            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)
    311             uint32_t networkID_;                                           //!< The network ID to identify a class through the network
    312247            const unsigned int classID_;                                   //!< Uniquely identifies a class (might not be the same as the networkID_)
    313248            static unsigned int classIDCounter_s;                          //!< Static counter for the unique classIDs
     
    316251            std::map<std::string, ConfigValueContainer*> configValues_;    //!< A map to link the string of configurable variables with their ConfigValueContainer
    317252            std::map<std::string, ConfigValueContainer*> configValues_LC_; //!< A map to link the string of configurable variables with their ConfigValueContainer
    318 
    319             bool bHasConsoleCommands_;                                     //!< True if this class has at least one assigned console command
    320             std::map<std::string, ConsoleCommand*> consoleCommands_;       //!< All console commands of this class
    321             std::map<std::string, ConsoleCommand*> consoleCommands_LC_;    //!< All console commands of this class with their names in lowercase
    322 
    323             std::map<std::string, XMLPortParamContainer*> xmlportParamContainers_;     //!< All loadable parameters
    324             std::map<std::string, XMLPortObjectContainer*> xmlportObjectContainers_;   //!< All attachable objects
    325             std::map<std::string, XMLPortObjectContainer*> xmlportEventContainers_;    //!< All events
    326253    };
    327254
     
    344271    class ClassIdentifier : public Identifier
    345272    {
    346         #define SUPER_INTRUSIVE_DECLARATION_INCLUDE
    347         #include "Super.h"
    348 
    349273        public:
    350274            static ClassIdentifier<T> *getIdentifier();
     
    360284            ClassIdentifier()
    361285            {
    362                 SuperFunctionInitialization<0, T>::initialize(this);
    363286            }
    364287            ~ClassIdentifier()
    365288            {
    366                 SuperFunctionDestruction<0, T>::destroy(this);
    367289            }
    368290
     
    630552                { return this->identifier_; }
    631553
    632 //            /** @brief Returns true, if the assigned identifier is at least of the given type. @param identifier The identifier to compare with */
    633 //            inline bool isA(const Identifier* identifier) const
    634 //                { return this->identifier_->isA(identifier); }
    635 //
    636 //            /** @brief Returns true, if the assigned identifier is exactly of the given type. @param identifier The identifier to compare with */
    637 //            inline bool isExactlyA(const Identifier* identifier) const
    638 //                { return this->identifier_->isExactlyA(identifier); }
    639 //
    640 //            /** @brief Returns true, if the assigned identifier is a child of the given identifier. @param identifier The identifier to compare with */
    641 //            inline bool isChildOf(const Identifier* identifier) const
    642 //                { return this->identifier_->isChildOf(identifier); }
    643 //
    644 //            /** @brief Returns true, if the assigned identifier is a direct child of the given identifier. @param identifier The identifier to compare with */
    645 //            inline bool isDirectChildOf(const Identifier* identifier) const
    646 //                { return this->identifier_->isDirectChildOf(identifier); }
    647 //
    648 //            /** @brief Returns true, if the assigned identifier is a parent of the given identifier. @param identifier The identifier to compare with */
    649 //            inline bool isParentOf(const Identifier* identifier) const
    650 //                { return this->identifier_->isParentOf(identifier); }
    651 //
    652 //            /** @brief Returns true, if the assigned identifier is a direct parent of the given identifier. @param identifier The identifier to compare with */
    653 //            inline bool isDirectParentOf(const Identifier* identifier) const
    654 //                { return this->identifier_->isDirectParentOf(identifier); }
    655 
    656554        private:
    657555            Identifier* identifier_;            //!< The assigned identifier
Note: See TracChangeset for help on using the changeset viewer.