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

Class TRef

library/cpp/yt/memory/ref.h:19–59  ·  view source on GitHub ↗

A non-owning reference to a range of memory.

Source from the content-addressed store, hash-verified

17
18//! A non-owning reference to a range of memory.
19class TRef
20 : public TRange<char>
21{
22public:
23 //! Creates a null TRef.
24 TRef() = default;
25
26 //! Creates a TRef for a given block of memory.
27 TRef(const void* data, size_t size);
28
29 //! Creates a TRef for a given range of memory.
30 TRef(const void* begin, const void* end);
31
32 //! Creates an empty TRef.
33 static TRef MakeEmpty();
34
35 //! Creates a non-owning TRef for a given blob.
36 static TRef FromBlob(const TBlob& blob);
37
38 //! Creates a non-owning TRef for a given string.
39 static TRef FromString(const TString& str);
40
41 //! Creates a non-owning TRef for a given std::string.
42 static TRef FromString(const std::string& str);
43
44 //! Creates a non-owning TRef for a given stringbuf.
45 static TRef FromStringBuf(TStringBuf strBuf);
46
47 //! Creates a non-owning TRef for a given pod structure.
48 template <class T>
49 static TRef FromPod(const T& data);
50
51 //! Converts to TStringBuf.
52 TStringBuf ToStringBuf() const;
53
54 //! Creates a TRef for a part of existing range.
55 TRef Slice(size_t startOffset, size_t endOffset) const;
56
57 //! Compares the content for bitwise equality.
58 static bool AreBitwiseEqual(TRef lhs, TRef rhs);
59};
60
61////////////////////////////////////////////////////////////////////////////////
62

Callers 10

ToRefMethod · 0.70
MakeEmptyMethod · 0.70
FromStringMethod · 0.70
FromStringBufMethod · 0.70
FromPodMethod · 0.70
SliceMethod · 0.70
operator TRefMethod · 0.70
FromBlobMethod · 0.70
FormatValueFunction · 0.70
GetMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected