summaryrefslogtreecommitdiffstats
path: root/common/facade.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/facade.h')
-rw-r--r--common/facade.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/common/facade.h b/common/facade.h
index 99fbcdc..a24ac7a 100644
--- a/common/facade.h
+++ b/common/facade.h
@@ -33,8 +33,9 @@ namespace Sink {
33 33
34/** 34/**
35 * Default facade implementation for resources that are implemented in a separate process using the ResourceAccess class. 35 * Default facade implementation for resources that are implemented in a separate process using the ResourceAccess class.
36 * 36 *
37 * Ideally a basic resource has no implementation effort for the facades and can simply instanciate default implementations (meaning it only has to implement the factory with all supported types). 37 * Ideally a basic resource has no implementation effort for the facades and can simply instanciate default implementations (meaning it only has to implement the factory with all
38 * supported types).
38 * A resource has to implement: 39 * A resource has to implement:
39 * * A facade factory registering all available facades 40 * * A facade factory registering all available facades
40 * * An adaptor factory if it uses special resource buffers (default implementation can be used otherwise) 41 * * An adaptor factory if it uses special resource buffers (default implementation can be used otherwise)
@@ -43,16 +44,17 @@ namespace Sink {
43 * Additionally a resource only has to provide a synchronizer plugin to execute the synchronization 44 * Additionally a resource only has to provide a synchronizer plugin to execute the synchronization
44 */ 45 */
45template <typename DomainType> 46template <typename DomainType>
46class SINK_EXPORT GenericFacade: public Sink::StoreFacade<DomainType> 47class SINK_EXPORT GenericFacade : public Sink::StoreFacade<DomainType>
47{ 48{
48public: 49public:
49 /** 50 /**
50 * Create a new GenericFacade 51 * Create a new GenericFacade
51 * 52 *
52 * @param resourceIdentifier is the identifier of the resource instance 53 * @param resourceIdentifier is the identifier of the resource instance
53 * @param adaptorFactory is the adaptor factory used to generate the mappings from domain to resource types and vice versa 54 * @param adaptorFactory is the adaptor factory used to generate the mappings from domain to resource types and vice versa
54 */ 55 */
55 GenericFacade(const QByteArray &resourceIdentifier, const DomainTypeAdaptorFactoryInterface::Ptr &adaptorFactory = DomainTypeAdaptorFactoryInterface::Ptr(), const QSharedPointer<Sink::ResourceAccessInterface> resourceAccess = QSharedPointer<Sink::ResourceAccessInterface>()); 56 GenericFacade(const QByteArray &resourceIdentifier, const DomainTypeAdaptorFactoryInterface::Ptr &adaptorFactory = DomainTypeAdaptorFactoryInterface::Ptr(),
57 const QSharedPointer<Sink::ResourceAccessInterface> resourceAccess = QSharedPointer<Sink::ResourceAccessInterface>());
56 ~GenericFacade(); 58 ~GenericFacade();
57 59
58 static QByteArray bufferTypeForDomainType(); 60 static QByteArray bufferTypeForDomainType();
@@ -63,10 +65,9 @@ public:
63 65
64protected: 66protected:
65 std::function<void(Sink::ApplicationDomain::ApplicationDomainType &domainObject)> mResultTransformation; 67 std::function<void(Sink::ApplicationDomain::ApplicationDomainType &domainObject)> mResultTransformation;
66 //TODO use one resource access instance per application & per resource 68 // TODO use one resource access instance per application & per resource
67 QSharedPointer<Sink::ResourceAccessInterface> mResourceAccess; 69 QSharedPointer<Sink::ResourceAccessInterface> mResourceAccess;
68 DomainTypeAdaptorFactoryInterface::Ptr mDomainTypeAdaptorFactory; 70 DomainTypeAdaptorFactoryInterface::Ptr mDomainTypeAdaptorFactory;
69 QByteArray mResourceInstanceIdentifier; 71 QByteArray mResourceInstanceIdentifier;
70}; 72};
71
72} 73}