ArcGIS Procedural Runtime  3.2.10650
StreamAdaptor.h
1 /*
2  COPYRIGHT (c) 2012-2024 Esri R&D Center Zurich
3  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
4  Unpublished material - all rights reserved under the
5  Copyright Laws of the United States and applicable international
6  laws, treaties, and conventions.
7 
8  For additional information, contact:
9  Environmental Systems Research Institute, Inc.
10  Attn: Contracts and Legal Services Department
11  380 New York Street
12  Redlands, California, 92373
13  USA
14 
15  email: contracts@esri.com
16 */
17 
18 #ifndef PRTX_STREAM_ADAPTOR_H_
19 #define PRTX_STREAM_ADAPTOR_H_
20 
21 #include "prt/ContentType.h"
22 #include "prt/Cache.h"
23 
24 #include "prtx/prtx.h"
25 #include "prtx/Content.h"
26 #include "prtx/URI.h"
27 #include "prtx/Extension.h"
28 #include "prtx/ResolveMap.h"
29 
30 #include <string>
31 #include <iosfwd>
32 #include <memory>
33 
34 
35 namespace prtx {
36 
37 class StreamAdaptor;
38 using StreamAdaptorPtr = std::shared_ptr<StreamAdaptor>;
39 
46 class PRTX_EXPORTS_API StreamAdaptor : public Extension {
47 protected:
48  StreamAdaptor() = default;
49 
50 public:
51  virtual ~StreamAdaptor() = default;
52 
59  virtual void resolve(
60  ContentPtrVector& results,
61  prt::Cache* cache,
62  const std::wstring& key,
63  prt::ContentType ct,
64  prtx::ResolveMap const* resolveMap,
65  std::wstring& warnings
66  ) const final;
67 
73  virtual std::istream* createStream(prtx::URIPtr uri) const = 0;
74 
78  virtual void destroyStream(std::istream* stream) const = 0;
79 
87  virtual prtx::Extension::ExtensionType getExtensionType() const final override {
89  }
90 
98  virtual prt::ContentType getContentType() const final override {
99  return prt::CT_UNDEFINED;
100  }
101 };
102 
103 
104 } // namespace prtx
105 
106 
107 #endif /* PRTX_STREAM_ADAPTOR_H_ */
Extension does not make use of specific content type.
Definition: ContentType.h:29
ExtensionType
Definition: Extension.h:46
virtual prtx::Extension::ExtensionType getExtensionType() const final override
Definition: StreamAdaptor.h:87
Definition: StreamAdaptor.h:46
Definition: Extension.h:41
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35
std::shared_ptr< URI > URIPtr
shared pointer implementation of prtx::URI
Definition: URI.h:37
ContentType
Definition: ContentType.h:28
Definition: Cache.h:53
Definition: /ResolveMap.h:40
virtual prt::ContentType getContentType() const final override
Definition: StreamAdaptor.h:98
Extension sub-class is a stream adaptor.
Definition: Extension.h:48