protobuf-c  1.2.0
Protocol Buffers implementation in C
ProtobufCMessage Struct Reference

An instance of a message. More...

Data Fields

const ProtobufCMessageDescriptordescriptor
 The descriptor for this message type. More...
 
unsigned n_unknown_fields
 The number of elements in unknown_fields. More...
 
ProtobufCMessageUnknownFieldunknown_fields
 The fields that weren't recognized by the parser. More...
 

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().

Field Documentation

const ProtobufCMessageDescriptor* ProtobufCMessage::descriptor

The descriptor for this message type.

unsigned ProtobufCMessage::n_unknown_fields

The number of elements in unknown_fields.

ProtobufCMessageUnknownField* ProtobufCMessage::unknown_fields

The fields that weren't recognized by the parser.