Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 25, 2007, 5:21:53 PM (16 years ago)
Author:
landauf
Message:

reimplementation of the factory and parts of the class-hierarchy-generating-algorithm. interfaces with protected constructors are now allowed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchie/src/Identifier.cc

    r243 r244  
    1111    {
    1212        this->bCreatedOneObject_ = false;
     13        this->factory_ = 0;
    1314
    1415        this->children_ = new IdentifierList;
     
    2728        std::cout << "*** Initialize " << this->name_ << "-Singleton.\n";
    2829#endif
     30        this->bCreatedOneObject_ = true;
     31
    2932        if (parents)
    3033        {
    31             this->bCreatedOneObject_ = true;
    32 
    3334            IdentifierListElement* temp1 = parents->first_;
    3435            while (temp1)
     
    3940                temp1 = temp1->next_;
    4041            }
     42        }
     43    }
     44
     45    BaseObject* Identifier::fabricate()
     46    {
     47        if (this->factory_)
     48        {
     49            return this->factory_->fabricate();
     50        }
     51        else
     52        {
     53            std::cout << "Error: Cannot create an object of type '" << this->name_ << "'. Class is abstract.\n";
     54            std::cout << "Aborting...";
     55            abort();
    4156        }
    4257    }
Note: See TracChangeset for help on using the changeset viewer.