~karsten.klagges/openwns-allinone/trunk

« back to all changes in this revision

Viewing changes to framework/library/src/LongCreator.hpp

  • Committer: Karsten Klagges
  • Date: 2014-08-06 13:03:56 UTC
  • Revision ID: kks@comnets.rwth-aachen.de-20140806130356-aiav38l8m4mm7wup
fixed indentation and precompiled header issue

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 *
26
26
 ******************************************************************************/
27
27
 
28
 
#ifndef WNS_LONGCREATOR_HPP
29
 
#define WNS_LONGCREATOR_HPP
30
 
 
 
28
#pragma once
31
29
#include <openwns/StaticFactory.hpp>
32
30
#include <openwns/ICreator.hpp>
33
31
 
34
32
namespace wns
35
33
{
36
 
    /**
37
 
     * @brief Creator implementation to be used with StaticFactory.
38
 
     * @author Marc Schinnenburg <marc@schinnenburg.com>
39
 
     */
40
 
    template <typename T, typename KIND = T>
41
 
    class LongCreator :
 
34
/**
 
35
 * @brief Creator implementation to be used with StaticFactory.
 
36
 * @author Marc Schinnenburg <marc@schinnenburg.com>
 
37
 */
 
38
template <typename T, typename KIND = T>
 
39
class LongCreator :
42
40
        public LongCreator<KIND, KIND>
 
41
{
 
42
public:
 
43
    virtual KIND* create(long l)
43
44
    {
44
 
    public:
45
 
        virtual KIND* create(long l)
46
 
        {
47
 
            return new T(l);
48
 
        }
49
 
    };
 
45
        return new T(l);
 
46
    }
 
47
};
50
48
 
51
 
    template <typename KIND>
52
 
    class LongCreator<KIND, KIND> :
 
49
template <typename KIND>
 
50
class LongCreator<KIND, KIND> :
53
51
        public ICreator
 
52
{
 
53
public:
 
54
    virtual
 
55
    ~LongCreator()
54
56
    {
55
 
    public:
56
 
        virtual
57
 
        ~LongCreator()
58
 
        {
59
 
        }
 
57
    }
60
58
 
61
 
        virtual KIND*
62
 
        create(long l) = 0;
63
 
    };
 
59
    virtual KIND*
 
60
    create(long l) = 0;
 
61
};
64
62
}
65
 
 
66
 
#endif // NOT defined WNS_LONGCREATOR_HPP