class InlineData

Defined at line 482 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

Public Members

static const cordz_info_t kNullCordzInfo
static const size_t kTagOffset

Public Methods

void InlineData ()

Defined at line 505 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void InlineData (DefaultInitType )

Defined at line 507 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void InlineData (CordRep * rep)

Defined at line 511 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void InlineData (absl::string_view sv, CordRep * rep)

Explicit constexpr constructor to create a constexpr InlineData

value. Creates an inlined SSO value if `rep` is null, otherwise

creates a tree instance value.

Defined at line 518 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

bool is_empty ()

Returns true if the current instance is empty.

The 'empty value' is an inlined data value of zero length.

Defined at line 552 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

bool is_tree ()

Returns true if the current instance holds a tree value.

Defined at line 555 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

bool is_profiled ()

Returns true if the current instance holds a cordz_info value.

Requires the current instance to hold a tree value.

Defined at line 559 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

bool is_either_profiled (const InlineData & data1, const InlineData & data2)

Returns true if either of the provided instances hold a cordz_info value.

This method is more efficient than the equivalent `data1.is_profiled() ||

data2.is_profiled()`. Requires both arguments to hold a tree.

Defined at line 567 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

CordzInfo * cordz_info ()

Returns the cordz_info sampling instance for this instance, or nullptr

if the current instance is not sampled and does not have CordzInfo data.

Requires the current instance to hold a tree value.

Defined at line 577 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void set_cordz_info (CordzInfo * cordz_info)

Sets the current cordz_info sampling instance for this instance, or nullptr

if the current instance is not sampled and does not have CordzInfo data.

Requires the current instance to hold a tree value.

Defined at line 588 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void clear_cordz_info ()

Resets the current cordz_info to null / empty.

Defined at line 596 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

const char * as_chars ()

Returns a read only pointer to the character data inside this instance.

Requires the current instance to hold inline data.

Defined at line 603 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

char * as_chars ()

Returns a mutable pointer to the character data inside this instance.

Should be used for 'write only' operations setting an inlined value.

Applications can set the value of inlined data either before or after

setting the inlined size, i.e., both of the below are valid:

// Set inlined data and inline size

memcpy(data_.as_chars(), data, size);

data_.set_inline_size(size);

// Set inlined size and inline data

data_.set_inline_size(size);

memcpy(data_.as_chars(), data, size);

It's an error to read from the returned pointer without a preceding write

if the current instance does not hold inline data, i.e.: is_tree() == true.

Defined at line 623 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

CordRep * as_tree ()

Returns the tree value of this value.

Requires the current instance to hold a tree value.

Defined at line 627 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void set_inline_data (const char * data, size_t n)

Defined at line 632 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void CopyInlineToString (std::string * dst)

Defined at line 640 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void copy_max_inline_to (char * dst)

Defined at line 653 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void make_tree (CordRep * rep)

Initialize this instance to holding the tree value `rep`,

initializing the cordz_info to null, i.e.: 'not profiled'.

Defined at line 660 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void set_tree (CordRep * rep)

Set the tree value of this instance to 'rep`.

Requires the current instance to already hold a tree value.

Does not affect the value of cordz_info.

Defined at line 668 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

size_t inline_size ()

Returns the size of the inlined character data inside this instance.

Requires the current instance to hold inline data.

Defined at line 675 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void set_inline_size (size_t size)

Sets the size of the inlined character data inside this instance.

Requires `size` to be

<

= kMaxInline.

See the documentation on 'as_chars()' for more information and examples.

Defined at line 680 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

int Compare (const InlineData & rhs)

Compares 'this' inlined data with rhs. The comparison is a straightforward

lexicographic comparison. `Compare()` returns values as follows:

-1 'this' InlineData instance is smaller

0 the InlineData instances are equal

1 'this' InlineData instance larger

Defined at line 692 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void InlineData (const InlineData & rhs)

Defined at line 881 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

InlineData & operator= (const InlineData & rhs)

Defined at line 882 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void poison ()

Poisons the unused inlined SSO data if the current instance

is inlined, else un-poisons the entire instance.

Defined at line 886 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void unpoison ()

Un-poisons this instance.

Defined at line 885 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

void poison_this ()

Poisons the current instance. This is used on default initialization.

Defined at line 884 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

Enumerations

enum DefaultInitType
Name Value
kDefaultInit 0

DefaultInitType forces the use of the default initialization constructor.

Defined at line 485 of file ../../third_party/abseil-cpp/src/absl/strings/internal/cord_internal.h

Friends

bool InlineData (const InlineData & lhs, const InlineData & rhs)
bool InlineData (const InlineData & lhs, const InlineData & rhs)
void InlineData (InlineData & lhsInlineData & rhs)