object-introspection/types/folly_iobuf_queue_type.toml
Aditya Sarwade 1334e08d05 Specify namespace for IOBuf in IOBufQueue function
Things can fail if there are only IOBufQueue objects but no IOBuf
object. Just specify the namespace too.
2023-07-19 11:13:39 +01:00

33 lines
680 B
TOML

[info]
type_name = "folly::IOBufQueue"
ctype = "FOLLY_IOBUFQUEUE_TYPE"
header = "folly/io/IOBufQueue.h"
# Old:
typeName = "folly::IOBufQueue"
matcher = "^folly::IOBufQueue$"
ns = ["folly::IOBufQueue"]
numTemplateParams = 0
replaceTemplateParamIndex = []
[codegen]
decl = """
void getSizeType(const %1% &container, size_t& returnArg);
"""
func = """
void getSizeType(const %1% &container, size_t& returnArg)
{
SAVE_SIZE(sizeof(%1%));
const folly::IOBuf *head = container.front();
SAVE_DATA((uintptr_t)head);
if (head && pointers.add((uintptr_t)head)) {
SAVE_DATA(1);
getSizeType(*head, returnArg);
} else {
SAVE_DATA(0);
}
}
"""