Ignore:
Timestamp:
Jan 5, 2011, 11:08:49 AM (15 years ago)
Author:
Frederik Heber <heber@…>
Children:
d76c105
Parents:
724564
Message:

Added Clone pattern.

  • Clone is necessary for having prototypes, i.e. it defines an interface class that has a virtual * clone() const function that each derived type has to implement.
  • Added unit test.
  • made CommonStub a bit cleaner.
  • updated documentation fo Factory and FactoryTypeList
  • Library version is now 2:2:0, API is 1.0.4.
File:
1 edited

Legend:

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

    r724564 r1afcbe  
    1515
    1616namespace teststubs {
    17   class Aclass
     17  class Iclass
     18  {
     19  public:
     20    virtual ~Iclass();
     21
     22    virtual void count() = 0;
     23    virtual int getcount() const = 0;
     24    virtual void setcount(int const _counter) = 0;
     25  };
     26
     27  class Aclass :
     28    public Iclass
    1829  {
    1930  public:
     
    2132    ~Aclass();
    2233
     34    void count();
     35    int getcount() const;
     36    void setcount(int const _counter);
     37
    2338    int counter;
    2439  };
    2540
    26   class Bclass
     41  class Bclass :
     42    public Iclass
    2743  {
    2844  public:
     
    3046    ~Bclass();
    3147
    32     int counter;
     48    void count();
     49    int getcount() const;
     50    void setcount(int const _counter);
     51
     52    double counter;
    3353  };
    3454};
Note: See TracChangeset for help on using the changeset viewer.