libsignal-protocol-c  master
ProtobufCMessage Struct Reference

#include <protobuf-c.h>

Collaboration diagram for ProtobufCMessage:

Public Attributes

const ProtobufCMessageDescriptordescriptor
 
unsigned n_unknown_fields
 
ProtobufCMessageUnknownFieldunknown_fields
 

Detailed Description

An instance of a message.

ProtobufCMessage is a light-weight "base class" for all messages.

In particular, ProtobufCMessage doesn't have any allocation policy associated with it. That's because it's common to create ProtobufCMessage objects on the stack. In fact, that's what we recommend for sending messages. If the object is allocated from the stack, you can't really have a memory leak.

This means that calls to functions like protobuf_c_message_unpack() which return a ProtobufCMessage must be paired with a call to a free function, like protobuf_c_message_free_unpacked().

Member Data Documentation

◆ descriptor

const ProtobufCMessageDescriptor* ProtobufCMessage::descriptor

The descriptor for this message type.

◆ n_unknown_fields

unsigned ProtobufCMessage::n_unknown_fields

The number of elements in unknown_fields.

◆ unknown_fields

ProtobufCMessageUnknownField* ProtobufCMessage::unknown_fields

The fields that weren't recognized by the parser.


The documentation for this struct was generated from the following file: