QtProtobuf  0.6
Protobuf plugin to generate Qt classes
Classes | Macros | Typedefs | Enumerations | Functions
QtProtobuf

Qt framework wrappers and bindings for protobuf objects. More...

Classes

class  QtProtobuf::QAbstractProtobufSerializer
 The QAbstractProtobufSerializer class is interface that represents basic functions for serialization/deserialization. More...
 
class  QtProtobuf::QProtobufJsonSerializer
 The QProtobufJsonSerializer class. More...
 
class  QtProtobuf::QProtobufSelfcheckIterator
 The QProtobufSelfcheckIterator class. More...
 
class  QtProtobuf::QProtobufSerializationPluginInterface
 The QProtobufSerializationPluginInterface class is interface that provides possibility to load serialization/deserialization implementations to project via Qt plugin mechanism. More...
 
class  QtProtobuf::QProtobufSerializer
 The QProtobufSerializer class. More...
 

Macros

#define Q_DECLARE_PROTOBUF_SERIALIZERS(T)
 Defines serializers for type T inherited of QObject. More...
 
#define Q_PROTOBUF_OBJECT
 Declares propertyOrdering for type T inherited of QObject. More...
 
#define Q_PROTOBUF_IMPORT_QUICK_PLUGIN()
 Imports statically linked QtProtobufQuickPlugin. More...
 

Typedefs

using QtProtobuf::int32 = transparent< int32_t >
 int32 signed 32-bit integer More...
 
using QtProtobuf::uint32 = uint32_t
 uint32 unsigned 32-bit integer More...
 
using QtProtobuf::uint64 = uint64_t
 uint64 unsigned 64-bit integer More...
 
using QtProtobuf::sint32 = int32_t
 sint32 signed 32-bit ZigZag integer More...
 
using QtProtobuf::sint64 = int64_t
 sint64 signed 64-bit ZigZag integer More...
 
using QtProtobuf::fixed32 = transparent< uint32_t, 1 >
 fixed32 unsigned 32-bit fixed size integer More...
 
using QtProtobuf::fixed64 = transparent< uint64_t, 1 >
 fixed64 unsigned 64-bit fixed size integer More...
 
using QtProtobuf::sfixed32 = transparent< int32_t, 1 >
 fixed32 signed 32-bit fixed size integer More...
 
using QtProtobuf::sfixed64 = transparent< int64_t, 1 >
 fixed64 signed 64-bit fixed size integer More...
 
using QtProtobuf::int32List = QList< int32 >
 alias for list of QtProtobuf::int32
 
using QtProtobuf::int64List = QList< int64 >
 alias for list of QtProtobuf::int64
 
using QtProtobuf::uint32List = QList< uint32 >
 alias for list of QtProtobuf::uint32
 
using QtProtobuf::uint64List = QList< uint64 >
 alias for list of QtProtobuf::uint64
 
using QtProtobuf::sint32List = QList< sint32 >
 alias for list of QtProtobuf::sint32
 
using QtProtobuf::sint64List = QList< sint64 >
 alias for list of QtProtobuf::sint64
 
using QtProtobuf::fixed32List = QList< fixed32 >
 alias for list of QtProtobuf::fixed32
 
using QtProtobuf::fixed64List = QList< fixed64 >
 alias for list of QtProtobuf::fixed64
 
using QtProtobuf::sfixed32List = QList< sfixed32 >
 alias for list of QtProtobuf::sfixed32
 
using QtProtobuf::sfixed64List = QList< sfixed64 >
 alias for list of QtProtobuf::sfixed64
 
using QtProtobuf::FloatList = QList< float >
 alias for list of QtProtobuf::float
 
using QtProtobuf::DoubleList = QList< double >
 alias for list of QtProtobuf::double
 

Enumerations

enum  QtProtobuf::WireTypes {
  QtProtobuf::UnknownWireType = -1 , QtProtobuf::Varint = 0 , QtProtobuf::Fixed64 = 1 , QtProtobuf::LengthDelimited = 2 ,
  QtProtobuf::StartGroup = 3 , QtProtobuf::EndGroup = 4 , QtProtobuf::Fixed32 = 5
}
 The WireTypes enumeration reflects protobuf default wiretypes. More...
 

Functions

void QtProtobuf::qRegisterProtobufTypes ()
 qRegisterProtobufTypes This method should be called in all applications that supposed to use QtProtobuf
 

Detailed Description

Qt framework wrappers and bindings for protobuf objects.

Macro Definition Documentation

◆ Q_DECLARE_PROTOBUF_SERIALIZERS

#define Q_DECLARE_PROTOBUF_SERIALIZERS (   T)
Value:
public:\
QByteArray serialize(QtProtobuf::QAbstractProtobufSerializer *serializer) const { Q_ASSERT_X(serializer != nullptr, "QProtobufObject", "Serializer is null"); return serializer->serialize<T>(this); }\
void deserialize(QtProtobuf::QAbstractProtobufSerializer *serializer, const QByteArray &array) { Q_ASSERT_X(serializer != nullptr, "QProtobufObject", "Serializer is null"); serializer->deserialize<T>(this, array); }\
private:
The QAbstractProtobufSerializer class is interface that represents basic functions for serialization/...
Definition: qabstractprotobufserializer.h:72
void deserialize(T *object, const QByteArray &data)
Deserialization of a byte-array into a registered qtproto message object.
Definition: qabstractprotobufserializer.h:98
QByteArray serialize(const QObject *object)
Serialization of a registered qtproto message object into byte-array.
Definition: qabstractprotobufserializer.h:82

Defines serializers for type T inherited of QObject.

Is part of autogenerated by qtprogobufgenerator classes

◆ Q_PROTOBUF_IMPORT_QUICK_PLUGIN

#define Q_PROTOBUF_IMPORT_QUICK_PLUGIN ( )

Imports statically linked QtProtobufQuickPlugin.


If you use statically linked QtProtobuf, you need to call Q_PROTOBUF_IMPORT_QUICK_PLUGIN macro before use QtProtobuf in QML.
C++:

int main(int argc, char *argv[]) {
...
...
}
#define Q_PROTOBUF_IMPORT_QUICK_PLUGIN()
Imports statically linked QtProtobufQuickPlugin.
Definition: qtprotobufglobal.h:88
void qRegisterProtobufTypes()
qRegisterProtobufTypes This method should be called in all applications that supposed to use QtProtob...
Definition: qtprotobuf.cpp:62

QML:

//Make QtProtobuf types visible in QML
import QtProtobuf 0.4 //Use recent QtProtobuf version
...
Item {
//QtProtobuf usage
}
...

◆ Q_PROTOBUF_OBJECT

#define Q_PROTOBUF_OBJECT
Value:
public:\
static const QtProtobuf::QProtobufPropertyOrdering propertyOrdering;\
static const QtProtobuf::QProtobufMetaObject protobufMetaObject;\
private:

Declares propertyOrdering for type T inherited of QObject.

Is part of autogenerated by qtprogobufgenerator classes

Typedef Documentation

◆ fixed32

using QtProtobuf::fixed32 = typedef transparent<uint32_t, 1>

fixed32 unsigned 32-bit fixed size integer

fixed32 is unsigned 32-bit integer that is represented in protobuf as fixed size 32-bit field aka WireTypes::Fixed32

◆ fixed64

using QtProtobuf::fixed64 = typedef transparent<uint64_t, 1>

fixed64 unsigned 64-bit fixed size integer

fixed64 is unsigned 64-bit integer that is represented in protobuf as fixed size 64-bit field aka WireTypes::Fixed64

◆ int32

using QtProtobuf::int32 = typedef transparent<int32_t>

int32 signed 32-bit integer

int32 is regular signed 32-bit integer that is represented in protobuf as variable size integer aka WireTypes::Varint without modificators

◆ sfixed32

using QtProtobuf::sfixed32 = typedef transparent<int32_t, 1>

fixed32 signed 32-bit fixed size integer

fixed32 is signed 32-bit integer that is represented in protobuf as fixed size 32-bit field aka WireTypes::Fixed32

◆ sfixed64

using QtProtobuf::sfixed64 = typedef transparent<int64_t, 1>

fixed64 signed 64-bit fixed size integer

fixed64 is signed 64-bit integer that is represented in protobuf as fixed size 64-bit field aka WireTypes::Fixed64

◆ sint32

using QtProtobuf::sint32 = typedef int32_t

sint32 signed 32-bit ZigZag integer

sint32 is 32-bit integer with forced sign marker that is represented in protobuf as variable size integer aka WireTypes::Varint. sint32 type serialized using ZigZag convertion to reduce size of negative numbers.

See also
https://developers.google.com/protocol-buffers/docs/encoding#signed-integers for details.

◆ sint64

using QtProtobuf::sint64 = typedef int64_t

sint64 signed 64-bit ZigZag integer

sint64 is 64-bit integer with forced sign marker that is represented in protobuf as variable size integer aka WireTypes::Varint. sint64 type serialized using ZigZag convertion to reduce size of negative numbers.

See also
https://developers.google.com/protocol-buffers/docs/encoding#signed-integers for details.

◆ uint32

using QtProtobuf::uint32 = typedef uint32_t

uint32 unsigned 32-bit integer

uint32 is unsigned 32-bit integer that is represented in protobuf as variable size integer aka WireTypes::Varint without modificators

◆ uint64

using QtProtobuf::uint64 = typedef uint64_t

uint64 unsigned 64-bit integer

uint64 is unsigned 64-bit integer that is represented in protobuf as variable size integer aka WireTypes::Varint without modificators

Enumeration Type Documentation

◆ WireTypes

The WireTypes enumeration reflects protobuf default wiretypes.

See also
https://developers.google.com/protocol-buffers/docs/encoding for details.
Enumerator
UnknownWireType 

Invalid wire type.

Varint 

int32, int64, uint32, uint64, sint32, sint64, bool, enum

Fixed64 

fixed64, sfixed64, double

LengthDelimited 

string, bytes, embedded messages, packed repeated fields

StartGroup 

groups

Deprecated:
Is deprecated in proto syntax 3.

Not supported by QtProtobuf

EndGroup 

groups

Deprecated:
Is deprecated in proto syntax 3.

Not supported by QtProtobuf

Fixed32 

fixed32, sfixed32, float