Seismic Drive Client API
SDHierarchicalDataset.h
Go to the documentation of this file.
1 // ============================================================================
2 // Copyright 2017-2021, Schlumberger
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 // ============================================================================
16 
17 #pragma once
18 
19 #include "DLL_EXPORT.h"
20 #include "SDDatasetDisposition.h"
22 #include "SDManager.h"
23 
24 #include <memory>
25 #include <unordered_map>
26 
27 namespace seismicdrive
28 {
29  struct HttpContext;
30 
31  /*******************************************************************************/
40  class DLL_PUBLIC SDHierarchicalDataset
41  {
42  public:
43  /*******************************************************************************/
51  SDHierarchicalDataset(SDManager *sdmanager, const std::string &sdfilename, const bool log = false);
52 
53  /*******************************************************************************/
62  SDHierarchicalDataset(SDManager *sdmanager, const std::string &sdfilename, const std::string &filetype, const bool log = false);
63 
64  /*******************************************************************************/
70 
71  /*******************************************************************************/
79 
80  /*******************************************************************************/
86  SDHierarchicalDataset &operator=(SDHierarchicalDataset &&sdhd) noexcept;
87 
88  /*******************************************************************************/
96 
97  /*******************************************************************************/
103  SDHierarchicalDataset &operator=(const SDHierarchicalDataset &op);
104 
105  /*******************************************************************************/
120  void open(const SDDatasetDisposition disposition);
121 
122  /*******************************************************************************/
139  void open(const SDDatasetDisposition disposition, const std::string &legaltag);
140 
141  /*******************************************************************************/
159  void open(const SDDatasetDisposition disposition, const std::string &legaltag, const std::string &wid);
160 
161  /*******************************************************************************/
231  void open(const SDDatasetDisposition disposition, const std::unordered_map<std::string, std::string> &args);
232 
233  /*******************************************************************************/
239  void close();
240 
241  /*******************************************************************************/
247  void flush();
248 
249  /*******************************************************************************/
255  bool exist() const;
256 
257  /*******************************************************************************/
264  bool exists() const;
265 
266  /*******************************************************************************/
273  bool isOpen();
274 
275  /*******************************************************************************/
284  bool objectExists(const std::string &blockName) const;
285 
286  /*******************************************************************************/
293  SDHierarchicalDatasetAccessor getDatasetAccessor() const;
294 
295  /*******************************************************************************/
302  void mergeDatasetAccessor(const SDHierarchicalDatasetAccessor &dsaccessor);
303 
304  /*******************************************************************************/
309  void lock();
310 
311  /*******************************************************************************/
316  void waitLock();
317 
318  /*******************************************************************************/
323  void unlock();
324 
325  /*******************************************************************************/
332  std::string getConsistencyID();
333 
334  /*******************************************************************************/
341  int getConsistencyCounter();
342 
343  /*******************************************************************************/
359  void setTags(const std::vector<std::string> &tags) const;
360 
361  /*******************************************************************************/
376  std::vector<std::string> getTags() const;
377 
378  /*******************************************************************************/
385  std::string getLegalTag() const;
386 
387  /*******************************************************************************/
402  std::string getCreatedDate() const;
403 
404  /*******************************************************************************/
411  std::string getType() const;
412 
413  /*******************************************************************************/
429  void setSeismicMeta(const std::string &seismicmeta);
430 
431  /*******************************************************************************/
446  std::string getSeismicMeta() const;
447 
448  /*******************************************************************************/
470  void setHttpContext(const HttpContext *context = nullptr);
471 
472  private:
473 #ifdef _MSC_VER
474  #pragma warning(push)
475  #pragma warning(disable : 4251)
476 #endif
477 
478  class Impl;
479 
480  std::unique_ptr<Impl> _impl;
481 
482 #ifdef _MSC_VER
483  #pragma warning(pop)
484 #endif
485 
486  friend class SDHierarchicalDatasetTest;
487  };
488 
489 }
Defines the underline http connection parameters.
Definition: HttpContext.h:85
SDDatasetDisposition
Defines the different Seismic Drive Dataset Dispositions.
Definition: SDDatasetDisposition.h:29
This class represents a hierarchical cloud storage dataset.
Definition: SDHierarchicalDataset.h:40
This class allows access to hierarchical datasets in cloud storage.
Definition: SDHierarchicalDatasetAccessor.h:83
Definition: SDManager.h:27
Definition: Constants.h:27