MCPcopy Create free account
hub / github.com/catboost/catboost / TBlob

Class TBlob

util/memory/blob.h:24–330  ·  view source on GitHub ↗

@addtogroup BLOBs @{

Source from the content-addressed store, hash-verified

22/// @addtogroup BLOBs
23/// @{
24class TBlob {
25public:
26 class TBase {
27 public:
28 inline TBase() noexcept = default;
29 virtual ~TBase() = default;
30
31 virtual void Ref() noexcept = 0;
32 virtual void UnRef() noexcept = 0;
33 };
34
35private:
36 struct TStorage {
37 const void* Data;
38 size_t Length;
39 TBase* Base;
40
41 inline TStorage(const void* data, size_t length, TBase* base) noexcept
42 : Data(data)
43 , Length(length)
44 , Base(base)
45 {
46 }
47
48 inline ~TStorage() = default;
49
50 inline void Swap(TStorage& r) noexcept {
51 DoSwap(Data, r.Data);
52 DoSwap(Length, r.Length);
53 DoSwap(Base, r.Base);
54 }
55 };
56
57public:
58 using value_type = ui8;
59 using const_reference = const value_type&;
60 using const_pointer = const value_type*;
61 using const_iterator = const_pointer;
62
63 /**
64 * Constructs a null blob (data array points to nullptr).
65 */
66 TBlob() noexcept
67 : S_(nullptr, 0, nullptr)
68 {
69 }
70
71 inline TBlob(const TBlob& r) noexcept
72 : S_(r.S_)
73 {
74 Ref();
75 }
76
77 TBlob(TBlob&& r) noexcept
78 : TBlob()
79 {
80 this->Swap(r);
81 }

Callers 3

DropMethod · 0.70
SubBlobMethod · 0.70
NoCopyMethod · 0.70

Calls 2

moveFunction · 0.50
SwapMethod · 0.45

Tested by

no test coverage detected