| 
            Last change
 on this file since 3a9cda 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
           | 
        
      
      
| Line |   | 
|---|
| 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 {
 | 
|---|
| 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
 | 
|---|
| 29 |   {
 | 
|---|
| 30 |   public:
 | 
|---|
| 31 |     Aclass();
 | 
|---|
| 32 |     ~Aclass();
 | 
|---|
| 33 | 
 | 
|---|
| 34 |     void count();
 | 
|---|
| 35 |     int getcount() const;
 | 
|---|
| 36 |     void setcount(int const _counter);
 | 
|---|
| 37 | 
 | 
|---|
| 38 |     int counter;
 | 
|---|
| 39 |   };
 | 
|---|
| 40 | 
 | 
|---|
| 41 |   class Bclass :
 | 
|---|
| 42 |     public Iclass
 | 
|---|
| 43 |   {
 | 
|---|
| 44 |   public:
 | 
|---|
| 45 |     Bclass();
 | 
|---|
| 46 |     ~Bclass();
 | 
|---|
| 47 | 
 | 
|---|
| 48 |     void count();
 | 
|---|
| 49 |     int getcount() const;
 | 
|---|
| 50 |     void setcount(int const _counter);
 | 
|---|
| 51 | 
 | 
|---|
| 52 |     double counter;
 | 
|---|
| 53 |   };
 | 
|---|
| 54 | };
 | 
|---|
| 55 | 
 | 
|---|
| 56 | #endif /* COMMONSTUB_HPP_ */
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.