A Node is a fixed‐size container of as many objects of type T as would fit in a region of memory of size NS. The last NS % sizeof(T) bytes are ignored and uninitialized.
Synopsis
Declared in <folly/Padded.h>
template<
class T,
size_t NS>
class Node;
Description
Node only works for trivial types, which is usually not a concern. This is intentional: Node itself is trivial, which means that it can be serialized / deserialized using a simple memcpy.
Type Aliases
Name |
Description |
The underlying element type. |
Member Functions
Name |
Description |
|
|
Compares two nodes for element‐wise equality. |
|
Compares two nodes for inequality. |
Static Member Functions
Name |
Description |
Return the number of nodes needed to represent n values. Rounds up. |
|
Return the total byte size needed to represent n values, rounded up to the nearest full node. |
|
Return the number of bytes used for padding n values. Note that, even if n is a multiple of kElementCount, this may return non‐zero if kPaddingBytes != 0, as the padding at the end of the last node is not included in the result. |
|
Return the minimum byte size needed to represent n values. Does not round up. Even if n is a multiple of kElementCount, this may be different from paddedByteSize() if kPaddingBytes != 0, as the padding at the end of the last node is not included in the result. Note that the calculation below works for n=0 correctly (returns 0). |
Static Data Members
Name |
Description |
The number of elements stored in one node. |
|
The size of one node in bytes. |
|
The number of trailing padding bytes in one node. |
Created with MrDocs