Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 25, 2015, 10:49:34 PM (9 years ago)
Author:
landauf
Message:

create and initialize Identifiers explicitly via registerClass(). registerClass() must be called before using an Identifier of this type.
(some tests will currently fail)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/class/Identifier.cc

    r10381 r10395  
    5050        @brief Constructor: No factory, no object created, new ObjectList and a unique networkID.
    5151    */
    52     Identifier::Identifier()
     52    Identifier::Identifier(const std::string& name, Factory* factory, bool bLoadable)
    5353        : classID_(IdentifierManager::getInstance().getUniqueClassId())
    5454    {
    55         this->factory_ = 0;
     55        this->name_ = name;
     56        this->factory_ = factory;
     57        this->bLoadable_ = bLoadable;
    5658        this->bInitialized_ = false;
    57         this->bLoadable_ = false;
    5859        this->bIsVirtualBase_ = false;
    5960
     
    7879        for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportObjectContainers_.begin(); it != this->xmlportObjectContainers_.end(); ++it)
    7980            delete (it->second);
    80     }
    81 
    82     /**
    83         @brief Sets the name of the class.
    84     */
    85     void Identifier::setName(const std::string& name)
    86     {
    87         if (name != this->name_)
    88         {
    89             this->name_ = name;
    90             IdentifierManager::getInstance().addIdentifierToLookupMaps(this);
    91         }
    92     }
    93 
    94     void Identifier::setFactory(Factory* factory)
    95     {
    96         if (this->factory_)
    97             delete this->factory_;
    98 
    99         this->factory_ = factory;
    10081    }
    10182
     
    127108    {
    128109        this->networkID_ = id;
    129         IdentifierManager::getInstance().addIdentifierToLookupMaps(this);
     110        IdentifierManager::getInstance().addIdentifier(this);
    130111    }
    131112
Note: See TracChangeset for help on using the changeset viewer.