Ignore:
Timestamp:
Jan 5, 2011, 1:48:15 PM (15 years ago)
Author:
Frederik Heber <heber@…>
Children:
567640
Parents:
1afcbe
git-author:
Frederik Heber <heber@…> (01/05/11 11:26:48)
git-committer:
Frederik Heber <heber@…> (01/05/11 13:48:15)
Message:

Added Prototype Factory pattern.

  • the Prototype Factory basically stores Clone instead of Creator patterns in its lookup tables to produce.
  • Clone has not protected cstor/dstor but is friend with CloneTest and PrototypeFactoryStub to grant them access.
  • also these prototypes may be manipulated by befriended classes.
  • added unit test and stub.
  • Library version is now 3:0:0, API version is 1.0.5.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Patterns/unittests/stubs/CloneStub.hpp

    r1afcbe rd76c105  
    2424};
    2525
     26class CloneTest;
     27class PrototypeFactoryStub;
     28
    2629template <class T>
    2730class Prototype :
     
    2932  public Clone<IPrototype>
    3033{
    31 public:
     34    /**
     35     * Prototype Factory is friend because it needs to access protected cstor
     36     * to instantiate prototypes.
     37     */
     38    friend class PrototypeFactoryStub;
     39
     40    /**
     41     * Test is friend such that it can access protected cstor.
     42     */
     43    friend class CloneTest;
     44
     45protected:
    3246    Prototype() {
    3347      member.setcount(0);
     
    3549    ~Prototype() {};
    3650
     51public:
    3752    void count() {
    3853      member.count();
Note: See TracChangeset for help on using the changeset viewer.