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

Class TMutableRef

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

A non-owning reference to a mutable range of memory. Use with caution :)

Source from the content-addressed store, hash-verified

63//! A non-owning reference to a mutable range of memory.
64//! Use with caution :)
65class TMutableRef
66 : public TMutableRange<char>
67{
68public:
69 //! Creates a null TMutableRef.
70 //! Note empty TMutableRef is not the same as null TMutableRef.
71 //! `operator bool` can be used to check if ref is nonnull.
72 TMutableRef() = default;
73
74 //! Creates a TMutableRef for a given block of memory.
75 TMutableRef(void* data, size_t size);
76
77 //! Creates a TMutableRef for a given range of memory.
78 TMutableRef(void* begin, void* end);
79
80 //! Creates an empty TMutableRef.
81 static TMutableRef MakeEmpty();
82
83 //! Converts a TMutableRef to TRef.
84 operator TRef() const;
85
86 //! Creates a non-owning TMutableRef for a given blob.
87 static TMutableRef FromBlob(TBlob& blob);
88
89 //! Creates a non-owning TMutableRef for a given pod structure.
90 template <class T>
91 static TMutableRef FromPod(T& data);
92
93 //! Creates a non-owning TMutableRef for a given TString.
94 //! Ensures that the string is not shared.
95 static TMutableRef FromString(TString& str);
96
97 //! Creates a non-owning TMutableRef for a given std::string.
98 static TMutableRef FromString(std::string& str);
99
100 //! Creates a TMutableRef for a part of existing range.
101 TMutableRef Slice(size_t startOffset, size_t endOffset) const;
102};
103
104////////////////////////////////////////////////////////////////////////////////
105

Callers 8

MakeEmptyMethod · 0.85
FromPodMethod · 0.85
FromStringMethod · 0.85
SliceMethod · 0.85
operator TMutableRefMethod · 0.85
GetRefMethod · 0.85
FromBlobMethod · 0.85
AllocateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected