OpenZGY/C++ API and Internals (ALPHA)
Access seismic data stored in ZGY format.
guid.h
Go to the documentation of this file.
1 // Copyright 2017-2020, Schlumberger
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include <cstdint>
18 #include <cstddef>
19 #include <array>
20 #include <string>
21 #include <ostream>
22 
23 namespace InternalZGY {
24 #if 0
25 }
26 #endif
27 
40 class GUID
41 {
42 public:
43  typedef std::array<std::uint8_t,16> guid_bytes_t;
44 
45 public:
46  GUID();
47  explicit GUID(const guid_bytes_t& in);
48  explicit GUID(nullptr_t);
49  std::string toString() const;
50  void copyTo(std::uint8_t *ptr, std::int64_t len);
51 
52 private:
53  static guid_bytes_t generate();
54  static std::string format(const guid_bytes_t& guid);
55 
56 private:
57  guid_bytes_t _data;
58 };
59 
60 namespace Formatters
61 {
62  extern std::ostream& operator<<(std::ostream& os, const ::InternalZGY::GUID& guid);
63 }
64 
65 } // namespace
66 
InternalZGY::GUID
Simplified GUID handling. Only big endian, random number guids.
Definition: guid.h:40
InternalZGY
Implementation not visible to clients.