| 
            Last change
 on this file since bbd746 was             1afcbe, checked in by Frederik Heber <heber@…>, 15 years ago           | 
        
        
          | 
             
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.
  
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            804 bytes
           | 
        
      
      
| Rev | Line |   | 
|---|
| [724564] | 1 | /*
 | 
|---|
 | 2 |  * CommonStub.hpp
 | 
|---|
 | 3 |  *
 | 
|---|
 | 4 |  *  Created on: Jan 4, 2011
 | 
|---|
 | 5 |  *      Author: heber
 | 
|---|
 | 6 |  */
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | #ifndef COMMONSTUB_HPP_
 | 
|---|
 | 9 | #define COMMONSTUB_HPP_
 | 
|---|
 | 10 | 
 | 
|---|
 | 11 | // include config.h
 | 
|---|
 | 12 | #ifdef HAVE_CONFIG_H
 | 
|---|
 | 13 | #include <config.h>
 | 
|---|
 | 14 | #endif
 | 
|---|
 | 15 | 
 | 
|---|
 | 16 | namespace teststubs {
 | 
|---|
| [1afcbe] | 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
 | 
|---|
| [724564] | 29 |   {
 | 
|---|
 | 30 |   public:
 | 
|---|
 | 31 |     Aclass();
 | 
|---|
 | 32 |     ~Aclass();
 | 
|---|
 | 33 | 
 | 
|---|
| [1afcbe] | 34 |     void count();
 | 
|---|
 | 35 |     int getcount() const;
 | 
|---|
 | 36 |     void setcount(int const _counter);
 | 
|---|
 | 37 | 
 | 
|---|
| [724564] | 38 |     int counter;
 | 
|---|
 | 39 |   };
 | 
|---|
 | 40 | 
 | 
|---|
| [1afcbe] | 41 |   class Bclass :
 | 
|---|
 | 42 |     public Iclass
 | 
|---|
| [724564] | 43 |   {
 | 
|---|
 | 44 |   public:
 | 
|---|
 | 45 |     Bclass();
 | 
|---|
 | 46 |     ~Bclass();
 | 
|---|
 | 47 | 
 | 
|---|
| [1afcbe] | 48 |     void count();
 | 
|---|
 | 49 |     int getcount() const;
 | 
|---|
 | 50 |     void setcount(int const _counter);
 | 
|---|
 | 51 | 
 | 
|---|
 | 52 |     double counter;
 | 
|---|
| [724564] | 53 |   };
 | 
|---|
 | 54 | };
 | 
|---|
 | 55 | 
 | 
|---|
 | 56 | #endif /* COMMONSTUB_HPP_ */
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.