Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1543 for code/trunk/src/core


Ignore:
Timestamp:
Jun 5, 2008, 2:18:14 PM (17 years ago)
Author:
rgrieder
Message:
  • applied patch to remove ClassManager (wouldn't wanna maintain it anymore ;))
  • sorted core CMLs a little bit
  • updated OrxonoxStableHeaders.h
Location:
code/trunk/src/core
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/core/CMakeLists.txt

    r1535 r1543  
    11SET(CORE_SRC_FILES
    2   BaseObject.cc
    3   ClassTreeMask.cc
    42  ConfigFileManager.cc
    53  ConfigValueContainer.cc
    64  Core.cc
    75  Error.cc
    8   Executor.cc
    9   Factory.cc
    10   Identifier.cc
    11   IdentifierDistributor.cc
     6  Language.cc
     7  OrxonoxClass.cc
    128  OutputBuffer.cc
    13   Shell.cc
    14   CommandExecutor.cc
    15   CommandEvaluation.cc
    16   ConsoleCommand.cc
    17   ArgumentCompletionFunctions.cc
    18   ConsoleCommandCompilation.cc
    19   Language.cc
    20   Loader.cc
    21   MetaObjectList.cc
    22   Namespace.cc
    23   NamespaceNode.cc
    24   OrxonoxClass.cc
    259  OutputHandler.cc
    2610  Script.cc
    2711  SignalHandler.cc
     12
     13  # command
     14  ArgumentCompletionFunctions.cc
     15  CommandEvaluation.cc
     16  CommandExecutor.cc
     17  ConsoleCommand.cc
     18  ConsoleCommandCompilation.cc
     19  Executor.cc
     20
     21  # hierarchy
     22  Factory.cc
     23  Identifier.cc
     24  MetaObjectList.cc
     25
     26  # level
     27  BaseObject.cc
     28  ClassTreeMask.cc
     29  Loader.cc
     30  Namespace.cc
     31  NamespaceNode.cc
     32  XMLPort.cc
     33
     34  # shell
     35  IRC.cc
     36  Shell.cc
    2837  TclBind.cc
    29   XMLPort.cc
    3038  TclThreadManager.cc
    31   IRC.cc
    3239
     40  # input
    3341  input/Button.cc
    3442  input/CalibratorCallback.cc
  • code/trunk/src/core/ClassFactory.h

    r1505 r1543  
    7474    {
    7575        COUT(4) << "*** ClassFactory: Create entry for " << name << " in Factory." << std::endl;
    76         ClassManager<T>::getIdentifier()->addFactory(new ClassFactory<T>);
    77         Factory::add(name, ClassManager<T>::getIdentifier());
     76        ClassIdentifier<T>::getIdentifier()->addFactory(new ClassFactory<T>);
     77        Factory::add(name, ClassIdentifier<T>::getIdentifier());
    7878
    7979        return true;
  • code/trunk/src/core/ClassManager.h

    r1505 r1543  
    1 /*
    2  *   ORXONOX - the hottest 3D action shooter ever to exist
    3  *                    > www.orxonox.net <
    4  *
    5  *
    6  *   License notice:
    7  *
    8  *   This program is free software; you can redistribute it and/or
    9  *   modify it under the terms of the GNU General Public License
    10  *   as published by the Free Software Foundation; either version 2
    11  *   of the License, or (at your option) any later version.
    12  *
    13  *   This program is distributed in the hope that it will be useful,
    14  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  *   GNU General Public License for more details.
    17  *
    18  *   You should have received a copy of the GNU General Public License
    19  *   along with this program; if not, write to the Free Software
    20  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    21  *
    22  *   Author:
    23  *      Fabian 'x3n' Landau
    24  *   Co-authors:
    25  *      ...
    26  *
    27  */
    28 
    29 /**
    30     @file ClassManager.h
    31     @brief Definition and Implementation of the ClassManager template.
    32 
    33     The ClassManager is a helper-class for ClassIdentifier. Because ClassIdentifiers must
    34     be unique, they are created through the IdentifierDistributor-class to assure the
    35     uniqueness of the ClassIdentifier. But accessing Identifiers through IdentifierDistributor
    36     is slow, because it uses strings and a map. Thats why we use the ClassManager-template: It's
    37     a singleton like ClassIdentifier, but it doesn't hurt if there are multiple instances in
    38     different libraries, because they all store the same pointer to the unique ClassIdentifier
    39     which they've retrieved through IdentifierDistributor.
    40 */
    41 
    42 #ifndef _ClassManager_H__
    43 #define _ClassManager_H__
    44 
    45 #include "CorePrereqs.h"
    46 
    47 #include <string>
    48 
    49 #include "Identifier.h"
    50 #include "IdentifierDistributor.h"
    51 #include "Debug.h"
    52 
    53 namespace orxonox
    54 {
    55     //! ClassManager is a helper class to allow faster access on the ClassIdentifiers.
    56     /**
    57         Because accessing the IdentifierDistributor is slow, the ClassManager accesses it once
    58         and stores the result in a member-variable. IdentifierDistributor assures the uniqueness
    59         of the ClassIdentifier, even if there are multiple instances of the ClassManager-template
    60         in different libraries.
    61     */
    62     template <class T>
    63     class ClassManager
    64     {
    65         public:
    66             static ClassManager<T>* getSingleton();
    67             static ClassIdentifier<T>* getIdentifier();
    68             static const std::string& getName();
    69 
    70         private:
    71             ClassManager();
    72             ClassManager(const ClassIdentifier<T>& identifier) {}    // don't copy
    73             ~ClassManager() {}                                       // don't delete
    74 
    75             bool bInitialized_;                 //!< This is false until the ClassIdentifier gets assigned
    76             ClassIdentifier<T>* identifier_;    //!< The unique ClassIdentifier for the class T
    77     };
    78 
    79     /**
    80         @brief Constructor: Marks the ClassManager as uninitialized.
    81     */
    82     template <class T>
    83     ClassManager<T>::ClassManager()
    84     {
    85         this->bInitialized_ = false;
    86     }
    87 
    88     /**
    89         @brief Returns the one and only instance of this class for the template parameter T.
    90         @return The instance
    91     */
    92     template <class T>
    93     ClassManager<T>* ClassManager<T>::getSingleton()
    94     {
    95         static ClassManager<T> theOneAndOnlyInstance = ClassManager<T>();
    96         return &theOneAndOnlyInstance;
    97     }
    98 
    99     /**
    100         @brief Creates the only instance of this class for the template class T and retrieves a unique Identifier for the given name.
    101         @return The unique Identifier
    102     */
    103     template <class T>
    104     ClassIdentifier<T>* ClassManager<T>::getIdentifier()
    105     {
    106         // Check if the ClassManager is already initialized
    107         if (!ClassManager<T>::getSingleton()->bInitialized_)
    108         {
    109             // Get the name of the class
    110             std::string name = typeid(T).name();
    111 
    112             // It's not -> retrieve the ClassIdentifier through IdentifierDistributor
    113             COUT(4) << "*** ClassManager: Request Identifier Singleton for " << name << "." << std::endl;
    114 
    115             // First create a ClassIdentifier in case there's no instance existing yet
    116             ClassIdentifier<T>* temp = new ClassIdentifier<T>();
    117 
    118             // Ask the IdentifierDistributor for the unique ClassIdentifier
    119             ClassManager<T>::getSingleton()->identifier_ = (ClassIdentifier<T>*)IdentifierDistributor::getIdentifier(name, temp);
    120 
    121             // If the retrieved Identifier differs from our proposal, we don't need the proposal any more
    122             if (temp != ClassManager<T>::getSingleton()->identifier_)
    123             {
    124                 COUT(4) << "*** ClassManager: Requested Identifier for " << name << " was already existing and got assigned." << std::endl;
    125 
    126                 // Delete the unnecessary proposal
    127                 delete temp;
    128             }
    129             else
    130             {
    131                 COUT(4) << "*** ClassManager: Requested Identifier for " << name << " was not yet existing and got created." << std::endl;
    132             }
    133 
    134             ClassManager<T>::getSingleton()->bInitialized_ = true;
    135         }
    136 
    137         // Finally return the unique ClassIdentifier
    138         return ClassManager<T>::getSingleton()->identifier_;
    139     }
    140 
    141     /**
    142         @brief Returns the name of the class the ClassManager belongs to.
    143         @return The name
    144     */
    145     template <class T>
    146     const std::string& ClassManager<T>::getName()
    147     {
    148         static std::string unknownClassName = std::string("unknown");
    149 
    150         if (ClassManager<T>::getSingleton()->bInitialized_)
    151             return ClassManager<T>::getSingleton()->identifier_->getName();
    152         else
    153             return unknownClassName;
    154     }
    155 }
    156 
    157 #endif /* _ClassManager_H__ */
  • code/trunk/src/core/ClassTreeMask.cc

    r1505 r1543  
    266266    ClassTreeMask::ClassTreeMask()
    267267    {
    268         this->root_ = new ClassTreeMaskNode(ClassManager<BaseObject>::getIdentifier(), true);
     268        this->root_ = new ClassTreeMaskNode(ClassIdentifier<BaseObject>::getIdentifier(), true);
    269269    }
    270270
     
    275275    ClassTreeMask::ClassTreeMask(const ClassTreeMask& other)
    276276    {
    277         this->root_ = new ClassTreeMaskNode(ClassManager<BaseObject>::getIdentifier(), true);
     277        this->root_ = new ClassTreeMaskNode(ClassIdentifier<BaseObject>::getIdentifier(), true);
    278278        for (ClassTreeMaskIterator it = other.root_; it; ++it)
    279279            this->add(it->getClass(), it->isIncluded(), false);
     
    435435    {
    436436        delete this->root_;
    437         this->root_ = new ClassTreeMaskNode(ClassManager<BaseObject>::getIdentifier(), true);
     437        this->root_ = new ClassTreeMaskNode(ClassIdentifier<BaseObject>::getIdentifier(), true);
    438438    }
    439439
  • code/trunk/src/core/CommandEvaluation.cc

    r1505 r1543  
    2929#include "CommandEvaluation.h"
    3030#include "ConsoleCommand.h"
     31#include "Identifier.h"
    3132#include "Debug.h"
    3233#include "util/String.h"
  • code/trunk/src/core/ConfigFileManager.cc

    r1505 r1543  
    529529            for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getIdentifierMapBegin(); it != Identifier::getIdentifierMapEnd(); ++it)
    530530            {
    531                 if ((*it).second->hasConfigValues() /* && (*it).second != ClassManager<KeyBinder>::getIdentifier()*/)
     531                if ((*it).second->hasConfigValues() /* && (*it).second != ClassIdentifier<KeyBinder>::getIdentifier()*/)
    532532                {
    533533                    for (std::map<std::string, ConfigValueContainer*>::const_iterator it2 = (*it).second->getConfigValueMapBegin(); it2 != (*it).second->getConfigValueMapEnd(); ++it2)
  • code/trunk/src/core/ConfigValueIncludes.h

    r1505 r1543  
    6363*/
    6464#define SetConfigValueGeneric(classname, varname, defvalue) \
    65     orxonox::ConfigValueContainer* container##varname = ClassManager<classname>::getIdentifier()->getConfigValueContainer(#varname); \
     65    orxonox::ConfigValueContainer* container##varname = ClassIdentifier<classname>::getIdentifier()->getConfigValueContainer(#varname); \
    6666    if (!container##varname) \
    6767    { \
    68         container##varname = new orxonox::ConfigValueContainer(CFT_Settings, ClassManager<classname>::getIdentifier(), #varname, varname = defvalue); \
    69         ClassManager<classname>::getIdentifier()->addConfigValueContainer(#varname, container##varname); \
     68        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, ClassIdentifier<classname>::getIdentifier(), #varname, varname = defvalue); \
     69        ClassIdentifier<classname>::getIdentifier()->addConfigValueContainer(#varname, container##varname); \
    7070    } \
    7171    container##varname->getValue(&varname)
  • code/trunk/src/core/ConsoleCommand.h

    r1534 r1543  
    4242
    4343#define SetConsoleCommandGeneric(fakevariable, classname, command, bCreateShortcut) \
    44     orxonox::ConsoleCommand& fakevariable = orxonox::ClassManager<classname>::getIdentifier()->addConsoleCommand(command, bCreateShortcut)
     44    orxonox::ConsoleCommand& fakevariable = orxonox::ClassIdentifier<classname>::getIdentifier()->addConsoleCommand(command, bCreateShortcut)
    4545
    4646
  • code/trunk/src/core/CoreIncludes.h

    r1505 r1543  
    4444
    4545#include "Identifier.h"
    46 #include "ClassManager.h"
    4746#include "Factory.h"
    4847#include "ClassFactory.h"
     
    5655*/
    5756#define InternRegisterObject(ClassName, bRootClass) \
    58     this->setIdentifier(orxonox::ClassManager<ClassName>::getIdentifier()->registerClass(this->getParents(), #ClassName, bRootClass)); \
     57    this->setIdentifier(orxonox::ClassIdentifier<ClassName>::getIdentifier()->registerClass(this->getParents(), #ClassName, bRootClass)); \
    5958    if (orxonox::Identifier::isCreatingHierarchy() && this->getParents()) \
    6059        this->getParents()->insert(this->getParents()->end(), this->getIdentifier()); \
    61     orxonox::ClassManager<ClassName>::getIdentifier()->addObject(this); \
     60    orxonox::ClassIdentifier<ClassName>::getIdentifier()->addObject(this); \
    6261    if (orxonox::Identifier::isCreatingHierarchy()) \
    6362      return
     
    9392*/
    9493#define Class(ClassName) \
    95     ClassManager<ClassName>::getIdentifier()
     94    ClassIdentifier<ClassName>::getIdentifier()
    9695
    9796/**
  • code/trunk/src/core/CorePrereqs.h

    r1535 r1543  
    9797  template <class T>
    9898  class ClassIdentifier;
    99   template <class T>
    100   class ClassManager;
    10199  class ClassTreeMask;
    102100  class ClassTreeMaskIterator;
     
    124122  class FunctorStatic;
    125123  class Identifier;
    126   class IdentifierDistributor;
    127124  class IRC;
    128125  template <class T>
  • code/trunk/src/core/Identifier.cc

    r1505 r1543  
    7373        delete this->children_;
    7474        delete this->directChildren_;
     75    }
     76
     77    /**
     78        @brief Returns an identifier by name and adds it if not available
     79        @param name The name of the identifier as typeid().name() suggests
     80        @param proposal A pointer to a newly created identifier for the case of non existance in the map
     81        @return The identifier (unique instance)
     82    */
     83    Identifier *Identifier::getIdentifier(std::string &name, Identifier *proposal)
     84    {
     85        static std::map<std::string, Identifier*> identifiers;    //!< The map to store all Identifiers.
     86        std::map<std::string, Identifier*>::const_iterator it = identifiers.find(name);
     87        if (it == identifiers.end())
     88        {
     89            // there isn't an entry yet, put the proposal in it
     90            identifiers[name] = proposal;
     91        }
     92        else
     93        {
     94            // this happens when a template exists twice --> delete the proposal
     95            delete proposal;
     96        }
     97        return identifiers[name];
    7598    }
    7699
  • code/trunk/src/core/Identifier.h

    r1505 r1543  
    253253            }
    254254
     255            static Identifier* getIdentifier(std::string &name, Identifier *proposal);
     256
    255257            std::set<const Identifier*> parents_;                          //!< The parents of the class the Identifier belongs to
    256258            std::set<const Identifier*>* children_;                        //!< The children of the class the Identifier belongs to
     
    288290
    289291        To be really sure that not more than exactly one object exists (even with libraries),
    290         ClassIdentifiers are only created by IdentifierDistributor.
    291 
    292         You can access the ClassIdentifiers created by IdentifierDistributor through the
    293         ClassManager singletons.
     292        ClassIdentifiers are stored in the Identifier Singleton.
    294293    */
    295294    template <class T>
    296295    class ClassIdentifier : public Identifier
    297296    {
    298         template <class TT>
    299         friend class ClassManager;
    300 
    301297        public:
    302298            ClassIdentifier<T>* registerClass(std::set<const Identifier*>* parents, const std::string& name, bool bRootClass);
     
    316312            void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container);
    317313
     314            static ClassIdentifier<T> *getIdentifier();
     315
    318316        private:
    319317            ClassIdentifier();
     
    325323            std::map<std::string, XMLPortClassParamContainer<T>*> xmlportParamContainers_;              //!< All loadable parameters
    326324            std::map<std::string, XMLPortClassObjectContainer<T, class O>*> xmlportObjectContainers_;   //!< All attachable objects
     325
     326            static ClassIdentifier<T> *classIdentifier_s;
    327327    };
     328
     329    template <class T>
     330    ClassIdentifier<T> *ClassIdentifier<T>::classIdentifier_s = 0;
    328331
    329332    /**
     
    365368
    366369    /**
     370        @brief Creates the only instance of this class for the template class T and retrieves a unique Identifier for the given name.
     371        @return The unique Identifier
     372    */
     373    template <class T>
     374    ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
     375    {
     376        // check if the static field has already been filled
     377        if (ClassIdentifier<T>::classIdentifier_s == 0)
     378        {
     379            // Get the name of the class
     380            std::string name = typeid(T).name();
     381
     382            // create a new identifier anyway. Will be deleted in Identifier::getIdentifier if not used.
     383            ClassIdentifier<T> *proposal = new ClassIdentifier<T>();
     384
     385            // Get the entry from the map
     386            ClassIdentifier<T>::classIdentifier_s = (ClassIdentifier<T>*)Identifier::getIdentifier(name, proposal);
     387        }
     388
     389        // Finally return the unique ClassIdentifier
     390        return ClassIdentifier<T>::classIdentifier_s;
     391    }
     392
     393    /**
    367394        @brief Sets the name of the class.
    368395        @param name The name
     
    472499            SubclassIdentifier()
    473500            {
    474                 this->identifier_ = ClassManager<T>::getIdentifier();
     501                this->identifier_ = ClassIdentifier<T>::getIdentifier();
    475502            }
    476503
     
    491518            SubclassIdentifier<T>& operator=(Identifier* identifier)
    492519            {
    493                 if (!identifier->isA(ClassManager<T>::getIdentifier()))
     520                if (!identifier->isA(ClassIdentifier<T>::getIdentifier()))
    494521                {
    495522                    COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
    496                     COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassManager<T>::getIdentifier()->getName() << "!" << std::endl;
    497                     COUT(1) << "Error: SubclassIdentifier<" << ClassManager<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl;
     523                    COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!" << std::endl;
     524                    COUT(1) << "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl;
    498525                    COUT(1) << "Aborting..." << std::endl;
    499526                    abort();
     
    541568                    {
    542569                        COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
    543                         COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassManager<T>::getIdentifier()->getName() << "!" << std::endl;
     570                        COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!" << std::endl;
    544571                        COUT(1) << "Error: Couldn't fabricate a new Object." << std::endl;
    545572                        COUT(1) << "Aborting..." << std::endl;
  • code/trunk/src/core/IdentifierDistributor.cc

    r1505 r1543  
    1 /*
    2  *   ORXONOX - the hottest 3D action shooter ever to exist
    3  *                    > www.orxonox.net <
    4  *
    5  *
    6  *   License notice:
    7  *
    8  *   This program is free software; you can redistribute it and/or
    9  *   modify it under the terms of the GNU General Public License
    10  *   as published by the Free Software Foundation; either version 2
    11  *   of the License, or (at your option) any later version.
    12  *
    13  *   This program is distributed in the hope that it will be useful,
    14  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  *   GNU General Public License for more details.
    17  *
    18  *   You should have received a copy of the GNU General Public License
    19  *   along with this program; if not, write to the Free Software
    20  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    21  *
    22  *   Author:
    23  *      Fabian 'x3n' Landau
    24  *   Co-authors:
    25  *      ...
    26  *
    27  */
    28 
    29 /**
    30     @file IdentifierDistributor.cc
    31     @brief Implementation of the IdentifierDistributor class.
    32 */
    33 
    34 #include "IdentifierDistributor.h"
    35 #include "Identifier.h"
    36 
    37 namespace orxonox
    38 {
    39     /**
    40         @brief Returns the only instance of a ClassIdentifier for a given class.
    41         @param name The name of the class
    42         @param proposal A proposal for the ClassIdentifier in case there is no entry yet.
    43         @return The unique ClassIdentifier
    44     */
    45     Identifier* IdentifierDistributor::getIdentifier(const std::string& name, Identifier* proposal)
    46     {
    47         // Create the only instance of the IdentifierDistributor-singleton
    48         static IdentifierDistributor theOneAndOnlyInstance = IdentifierDistributor();
    49 
    50         // Look for an entry in the map
    51         std::map<std::string, Identifier*>::const_iterator it = theOneAndOnlyInstance.identifiers_.find(name);
    52         if (it != theOneAndOnlyInstance.identifiers_.end())
    53         {
    54             // There is already an entry: return it
    55             return (*it).second;
    56         }
    57         else
    58         {
    59             // There is no entry: put the proposal into the map and return it
    60             theOneAndOnlyInstance.identifiers_[name] = proposal;
    61             return proposal;
    62         }
    63     }
    64 }
  • code/trunk/src/core/IdentifierDistributor.h

    r1505 r1543  
    1 /*
    2  *   ORXONOX - the hottest 3D action shooter ever to exist
    3  *                    > www.orxonox.net <
    4  *
    5  *
    6  *   License notice:
    7  *
    8  *   This program is free software; you can redistribute it and/or
    9  *   modify it under the terms of the GNU General Public License
    10  *   as published by the Free Software Foundation; either version 2
    11  *   of the License, or (at your option) any later version.
    12  *
    13  *   This program is distributed in the hope that it will be useful,
    14  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  *   GNU General Public License for more details.
    17  *
    18  *   You should have received a copy of the GNU General Public License
    19  *   along with this program; if not, write to the Free Software
    20  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    21  *
    22  *   Author:
    23  *      Fabian 'x3n' Landau
    24  *   Co-authors:
    25  *      ...
    26  *
    27  */
    28 
    29 /**
    30     @file IdentifierDistributor.h
    31     @brief Definition of the IdentifierDistributor class
    32 
    33     The IdentifierDistributor makes sure that only one instance of ClassIdentifier for each
    34     template parameter T exists. All Identifiers are stored in a map with their name.
    35     IdentifierDistributor is a singleton class, it can't be created or deleted directly.
    36 */
    37 
    38 #ifndef _IdentifierDistributor_H__
    39 #define _IdentifierDistributor_H__
    40 
    41 #include "CorePrereqs.h"
    42 
    43 #include <map>
    44 
    45 namespace orxonox
    46 {
    47     //! The Identifier Distributor stores all Identifiers and makes sure there are no ambiguities.
    48     class _CoreExport IdentifierDistributor
    49     {
    50         public:
    51             static Identifier* getIdentifier(const std::string& name, Identifier* proposal);
    52 
    53         private:
    54             IdentifierDistributor() {};                                         // Don't create
    55             IdentifierDistributor(const IdentifierDistributor& distributor);    // Don't copy
    56             ~IdentifierDistributor() {}                                         // Don't delete
    57 
    58             std::map<std::string, Identifier*> identifiers_;    //!< The map to store all Identifiers.
    59     };
    60 }
    61 
    62 #endif /* _IdentifierDistributor_H__ */
  • code/trunk/src/core/Iterator.h

    r1505 r1543  
    6464            {
    6565                this->element_ = 0;
    66                 ClassManager<T>::getIdentifier()->getObjects()->registerIterator(this);
     66                ClassIdentifier<T>::getIdentifier()->getObjects()->registerIterator(this);
    6767            }
    6868
     
    7474            {
    7575                this->element_ = element;
    76                 ClassManager<T>::getIdentifier()->getObjects()->registerIterator(this);
     76                ClassIdentifier<T>::getIdentifier()->getObjects()->registerIterator(this);
    7777            }
    7878
     
    8282            ~Iterator()
    8383            {
    84                 ClassManager<T>::getIdentifier()->getObjects()->unregisterIterator(this);
     84                ClassIdentifier<T>::getIdentifier()->getObjects()->unregisterIterator(this);
    8585            }
    8686
  • code/trunk/src/core/MetaObjectList.h

    r1505 r1543  
    8989    MetaObjectListElement<T>::~MetaObjectListElement()
    9090    {
    91         COUT(5) << "*** MetaObjectList: Removing Object from " << ClassManager<T>::getIdentifier()->getName() << "-list." << std::endl;
     91        COUT(5) << "*** MetaObjectList: Removing Object from " << ClassIdentifier<T>::getIdentifier()->getName() << "-list." << std::endl;
    9292        this->list_->notifyIterators(this->element_);
    9393
  • code/trunk/src/core/ObjectList.h

    r1505 r1543  
    4444
    4545#include "Iterator.h"
    46 #include "ClassManager.h"
     46#include "Identifier.h"
    4747
    4848namespace orxonox
     
    9595            /** @brief Returns the first element in the list. @return The first element */
    9696            inline static Iterator<T> start()
    97                 { return Iterator<T>(ClassManager<T>::getIdentifier()->getObjects()->first_); }
     97                { return Iterator<T>(ClassIdentifier<T>::getIdentifier()->getObjects()->first_); }
    9898
    9999            /** @brief Returns the first element in the list. @return The first element */
    100100            inline static Iterator<T> begin()
    101                 { return Iterator<T>(ClassManager<T>::getIdentifier()->getObjects()->first_); }
     101                { return Iterator<T>(ClassIdentifier<T>::getIdentifier()->getObjects()->first_); }
    102102
    103103            /** @brief Returns the last element in the list. @return The last element */
    104104            inline static Iterator<T> end()
    105                 { return Iterator<T>(ClassManager<T>::getIdentifier()->getObjects()->last_); }
     105                { return Iterator<T>(ClassIdentifier<T>::getIdentifier()->getObjects()->last_); }
    106106
    107107            inline void registerIterator(Iterator<T>* iterator)
  • code/trunk/src/core/input/KeyBinder.cc

    r1538 r1543  
    265265  {
    266266    // config value stuff
    267     ConfigValueContainer* cont = ClassManager<KeyBinder>::getIdentifier()->getConfigValueContainer(button.name_);
     267    ConfigValueContainer* cont = ClassIdentifier<KeyBinder>::getIdentifier()->getConfigValueContainer(button.name_);
    268268    if (!cont)
    269269    {
    270       cont = new ConfigValueContainer(CFT_Keybindings, ClassManager<KeyBinder>::getIdentifier(), button.name_, "");
    271       ClassManager<KeyBinder>::getIdentifier()->addConfigValueContainer(button.name_, cont);
     270      cont = new ConfigValueContainer(CFT_Keybindings, ClassIdentifier<KeyBinder>::getIdentifier(), button.name_, "");
     271      ClassIdentifier<KeyBinder>::getIdentifier()->addConfigValueContainer(button.name_, cont);
    272272    }
    273273    std::string old = button.bindingString_;
Note: See TracChangeset for help on using the changeset viewer.