MCPcopy Create free account
hub / github.com/ceph/ceph / MutableEntry

Class MutableEntry

src/log/Entry.h:61–84  ·  view source on GitHub ↗

This should never be moved to the heap! Only allocate this on the stack. See * CachedStackStringStream for rationale. */

Source from the content-addressed store, hash-verified

59 * CachedStackStringStream for rationale.
60 */
61class MutableEntry : public Entry {
62public:
63 MutableEntry() = delete;
64 MutableEntry(short pr, short sub) : Entry(pr, sub) {}
65 MutableEntry(const MutableEntry&) = delete;
66 MutableEntry& operator=(const MutableEntry&) = delete;
67 MutableEntry(MutableEntry&&) = delete;
68 MutableEntry& operator=(MutableEntry&&) = delete;
69 ~MutableEntry() override = default;
70
71 std::ostream& get_ostream() {
72 return *cos;
73 }
74
75 std::string_view strv() const override {
76 return cos->strv();
77 }
78 std::size_t size() const override {
79 return cos->strv().size();
80 }
81
82private:
83 CachedStackStringStream cos;
84};
85
86class ConcreteEntry : public Entry {
87public:

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68