diff options
Diffstat (limited to 'common/facade.h')
-rw-r--r-- | common/facade.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/common/facade.h b/common/facade.h index a24ac7a..658ccb8 100644 --- a/common/facade.h +++ b/common/facade.h | |||
@@ -55,7 +55,7 @@ public: | |||
55 | */ | 55 | */ |
56 | GenericFacade(const QByteArray &resourceIdentifier, const DomainTypeAdaptorFactoryInterface::Ptr &adaptorFactory = DomainTypeAdaptorFactoryInterface::Ptr(), | 56 | GenericFacade(const QByteArray &resourceIdentifier, const DomainTypeAdaptorFactoryInterface::Ptr &adaptorFactory = DomainTypeAdaptorFactoryInterface::Ptr(), |
57 | const QSharedPointer<Sink::ResourceAccessInterface> resourceAccess = QSharedPointer<Sink::ResourceAccessInterface>()); | 57 | const QSharedPointer<Sink::ResourceAccessInterface> resourceAccess = QSharedPointer<Sink::ResourceAccessInterface>()); |
58 | ~GenericFacade(); | 58 | virtual ~GenericFacade(); |
59 | 59 | ||
60 | static QByteArray bufferTypeForDomainType(); | 60 | static QByteArray bufferTypeForDomainType(); |
61 | KAsync::Job<void> create(const DomainType &domainObject) Q_DECL_OVERRIDE; | 61 | KAsync::Job<void> create(const DomainType &domainObject) Q_DECL_OVERRIDE; |
@@ -70,4 +70,16 @@ protected: | |||
70 | DomainTypeAdaptorFactoryInterface::Ptr mDomainTypeAdaptorFactory; | 70 | DomainTypeAdaptorFactoryInterface::Ptr mDomainTypeAdaptorFactory; |
71 | QByteArray mResourceInstanceIdentifier; | 71 | QByteArray mResourceInstanceIdentifier; |
72 | }; | 72 | }; |
73 | |||
74 | /** | ||
75 | * A default facade implemenation that simply instantiates a generic resource with the given DomainTypeAdaptorFactory | ||
76 | */ | ||
77 | template<typename DomainType, typename DomainTypeAdaptorFactory> | ||
78 | class DefaultFacade : public GenericFacade<DomainType> | ||
79 | { | ||
80 | public: | ||
81 | DefaultFacade(const QByteArray &resourceIdentifier) : GenericFacade<DomainType>(resourceIdentifier, QSharedPointer<DomainTypeAdaptorFactory>::create()) {} | ||
82 | virtual ~DefaultFacade(){} | ||
83 | }; | ||
84 | |||
73 | } | 85 | } |