QtProtobuf  0.6
Protobuf plugin to generate Qt classes
Protected Member Functions | List of all members
QtProtobuf::QProtobufJsonSerializer Class Reference

The QProtobufJsonSerializer class. More...

#include <qprotobufjsonserializer.h>

Inheritance diagram for QtProtobuf::QProtobufJsonSerializer:
Inheritance graph
[legend]
Collaboration diagram for QtProtobuf::QProtobufJsonSerializer:
Collaboration graph
[legend]

Protected Member Functions

QByteArray serializeMessage (const QObject *object, const QProtobufMetaObject &metaObject) const override
 serializeMessage More...
 
void deserializeMessage (QObject *object, const QProtobufMetaObject &metaObject, const QByteArray &data) const override
 serializeMessage More...
 
QByteArray serializeObject (const QObject *object, const QProtobufMetaObject &metaObject, const QProtobufMetaProperty &metaProperty) const override
 serializeObject Serializes complete object according given propertyOrdering and metaObject information More...
 
void deserializeObject (QObject *object, const QProtobufMetaObject &metaObject, QProtobufSelfcheckIterator &it) const override
 deserializeObject Deserializes buffer to an object More...
 
QByteArray serializeListBegin (const QProtobufMetaProperty &metaProperty) const override
 serializeListBegin Method called at the begining of object list serialization More...
 
QByteArray serializeListObject (const QObject *object, const QProtobufMetaObject &metaObject, const QProtobufMetaProperty &metaProperty) const override
 serializeListObject Method called to serialize object as a part of list property More...
 
QByteArray serializeListEnd (QByteArray &buffer, const QProtobufMetaProperty &metaProperty) const override
 serializeListEnd Method called at the end of object list serialization More...
 
bool deserializeListObject (QObject *object, const QProtobufMetaObject &metaObject, QProtobufSelfcheckIterator &it) const override
 deserializeListObject Deserializes an object from byte stream as part of list property More...
 
QByteArray serializeMapBegin (const QProtobufMetaProperty &metaProperty) const override
 serializeMapEnd Method called at the begining of map serialization More...
 
QByteArray serializeMapPair (const QVariant &key, const QVariant &value, const QProtobufMetaProperty &metaProperty) const override
 serializeMapPair Serializes QMap pair of key and value to raw data buffer More...
 
QByteArray serializeMapEnd (QByteArray &buffer, const QProtobufMetaProperty &metaProperty) const override
 serializeMapEnd Method called at the end of map serialization More...
 
bool deserializeMapPair (QVariant &key, QVariant &value, QProtobufSelfcheckIterator &it) const override
 deserializeMapPair Deserializes QMap pair of key and value from raw data More...
 
QByteArray serializeEnum (int64 value, const QMetaEnum &metaEnum, const QtProtobuf::QProtobufMetaProperty &metaProperty) const override
 serializeEnum Serializes enum value represented as int64 type More...
 
QByteArray serializeEnumList (const QList< int64 > &value, const QMetaEnum &metaEnum, const QtProtobuf::QProtobufMetaProperty &metaProperty) const override
 serializeEnumList Method called to serialize list of enum values More...
 
void deserializeEnum (int64 &value, const QMetaEnum &metaEnum, QProtobufSelfcheckIterator &it) const override
 deserializeEnum Deserializes enum value from byte stream More...
 
void deserializeEnumList (QList< int64 > &value, const QMetaEnum &metaEnum, QProtobufSelfcheckIterator &it) const override
 deserializeEnum Deserializes list of enum values from byte stream More...
 

Additional Inherited Members

- Public Member Functions inherited from QtProtobuf::QAbstractProtobufSerializer
template<typename T >
QByteArray serialize (const QObject *object)
 Serialization of a registered qtproto message object into byte-array. More...
 
template<typename T >
void deserialize (T *object, const QByteArray &data)
 Deserialization of a byte-array into a registered qtproto message object. More...
 

Detailed Description

The QProtobufJsonSerializer class.

Member Function Documentation

◆ deserializeEnum()

void QProtobufJsonSerializer::deserializeEnum ( int64 &  value,
const QMetaEnum &  metaEnum,
QProtobufSelfcheckIterator it 
) const
overrideprotectedvirtual

deserializeEnum Deserializes enum value from byte stream

Parameters
[out]valueBuffer that will be used to collect new enum value
[in]metaEnumInformation about enumeration type
[in]itPoints to serialized raw key/value data

Implements QtProtobuf::QAbstractProtobufSerializer.

◆ deserializeEnumList()

void QProtobufJsonSerializer::deserializeEnumList ( QList< int64 > &  value,
const QMetaEnum &  metaEnum,
QProtobufSelfcheckIterator it 
) const
overrideprotectedvirtual

deserializeEnum Deserializes list of enum values from byte stream

Parameters
[out]valueQList that will be used to collect deserialized enum values
[in]metaEnumInformation about enumeration type
[in]itPoints to serialized raw key/value data

Implements QtProtobuf::QAbstractProtobufSerializer.

◆ deserializeListObject()

bool QProtobufJsonSerializer::deserializeListObject ( QObject *  object,
const QProtobufMetaObject &  metaObject,
QProtobufSelfcheckIterator it 
) const
overrideprotectedvirtual

deserializeListObject Deserializes an object from byte stream as part of list property

Parameters
[out]objectPointer to pre-allocated object, that will be appended to list property
[in]Protobufmeta object information for given object. Static meta object usualy is used to get actual property value and write new property to object
[in]itPointer to beging of buffer where object serialized data is located

Implements QtProtobuf::QAbstractProtobufSerializer.

◆ deserializeMapPair()

bool QProtobufJsonSerializer::deserializeMapPair ( QVariant &  key,
QVariant &  value,
QProtobufSelfcheckIterator it 
) const
overrideprotectedvirtual

deserializeMapPair Deserializes QMap pair of key and value from raw data

Parameters
[out]keyBuffer that will be used to store deserialized key. When passed to function, QVariant already stores default constructed value. So it's possible to receive meta information about type from it.
[out]valueBuffer that will be used to store deserialized value. When passed to function, QVariant already stores default constructed value. So it's possible to receive meta information about type from it.
[in]itPoints to serialized raw key/value data
See also
https://developers.google.com/protocol-buffers/docs/proto3#maps for details

Implements QtProtobuf::QAbstractProtobufSerializer.

◆ deserializeMessage()

void QProtobufJsonSerializer::deserializeMessage ( QObject *  object,
const QProtobufMetaObject &  metaObject,
const QByteArray &  data 
) const
overrideprotectedvirtual

serializeMessage

Parameters
object
propertyOrdering
metaObject
Returns

Implements QtProtobuf::QAbstractProtobufSerializer.

◆ deserializeObject()

void QProtobufJsonSerializer::deserializeObject ( QObject *  object,
const QProtobufMetaObject &  metaObject,
QProtobufSelfcheckIterator it 
) const
overrideprotectedvirtual

deserializeObject Deserializes buffer to an object

Parameters
[out]objectPointer to pre-allocated object
[in]metaObjectProtobuf meta object information for given object. Static meta object usualy is used to get actual property value and write new property to object
[in]itPointer to beging of buffer where object serialized data is located
[in]propertyOrderingOrdering of properties for given object
[in]metaPropertyInformation about property to be serialized

Implements QtProtobuf::QAbstractProtobufSerializer.

◆ serializeEnum()

QByteArray QProtobufJsonSerializer::serializeEnum ( int64  value,
const QMetaEnum &  metaEnum,
const QtProtobuf::QProtobufMetaProperty metaProperty 
) const
overrideprotectedvirtual

serializeEnum Serializes enum value represented as int64 type

Parameters
[in]valueEnum value to be serialized
[in]metaEnumInformation about enumeration type
[in]metaPropertyInformation about property to be serialized
Returns
Raw serialized data represented as byte array
See also
https://developers.google.com/protocol-buffers/docs/proto3#maps for details

Implements QtProtobuf::QAbstractProtobufSerializer.

◆ serializeEnumList()

QByteArray QProtobufJsonSerializer::serializeEnumList ( const QList< int64 > &  value,
const QMetaEnum &  metaEnum,
const QtProtobuf::QProtobufMetaProperty metaProperty 
) const
overrideprotectedvirtual

serializeEnumList Method called to serialize list of enum values

Parameters
[in]valueList of enum values to be serialized, represented as int64
[in]metaEnumInformation about enumeration type
[in]metaPropertyInformation about property to be serialized
Returns
Raw serialized data represented as byte array
See also
https://developers.google.com/protocol-buffers/docs/proto3#maps for details

Implements QtProtobuf::QAbstractProtobufSerializer.

◆ serializeListBegin()

QByteArray QProtobufJsonSerializer::serializeListBegin ( const QProtobufMetaProperty metaProperty) const
overrideprotectedvirtual

serializeListBegin Method called at the begining of object list serialization

Parameters
[in]metaPropertyInformation about property to be serialized
Returns
Raw serialized data represented as byte array

Reimplemented from QtProtobuf::QAbstractProtobufSerializer.

◆ serializeListEnd()

QByteArray QProtobufJsonSerializer::serializeListEnd ( QByteArray &  buffer,
const QProtobufMetaProperty metaProperty 
) const
overrideprotectedvirtual

serializeListEnd Method called at the end of object list serialization

Parameters
[in]bufferBuffer at and of list serialization
[in]metaPropertyInformation about property to be serialized
Returns
Raw serialized data represented as byte array

Reimplemented from QtProtobuf::QAbstractProtobufSerializer.

◆ serializeListObject()

QByteArray QProtobufJsonSerializer::serializeListObject ( const QObject *  object,
const QProtobufMetaObject &  metaObject,
const QProtobufMetaProperty metaProperty 
) const
overrideprotectedvirtual

serializeListObject Method called to serialize object as a part of list property

Parameters
[in]objectPointer to object that will be serialized
[in]metaObjectProtobuf meta object information for given object
[in]metaPropertyInformation about property to be serialized
Returns
Raw serialized data represented as byte array

Implements QtProtobuf::QAbstractProtobufSerializer.

◆ serializeMapBegin()

QByteArray QProtobufJsonSerializer::serializeMapBegin ( const QProtobufMetaProperty metaProperty) const
overrideprotectedvirtual

serializeMapEnd Method called at the begining of map serialization

Parameters
[in]metaPropertyInformation about property to be serialized
Returns
Raw serialized data represented as byte array

Reimplemented from QtProtobuf::QAbstractProtobufSerializer.

◆ serializeMapEnd()

QByteArray QProtobufJsonSerializer::serializeMapEnd ( QByteArray &  buffer,
const QProtobufMetaProperty metaProperty 
) const
overrideprotectedvirtual

serializeMapEnd Method called at the end of map serialization

Parameters
[in]bufferBuffer at and of list serialization
[in]metaPropertyInformation about property to be serialized
Returns
Raw serialized data represented as byte array

Reimplemented from QtProtobuf::QAbstractProtobufSerializer.

◆ serializeMapPair()

QByteArray QProtobufJsonSerializer::serializeMapPair ( const QVariant &  key,
const QVariant &  value,
const QProtobufMetaProperty metaProperty 
) const
overrideprotectedvirtual

serializeMapPair Serializes QMap pair of key and value to raw data buffer

Parameters
[in]keyMap key
[in]valueMap value for given key
[in]metaPropertyInformation about property to be serialized
Returns
Raw serialized data represented as byte array
See also
https://developers.google.com/protocol-buffers/docs/proto3#maps for details

Implements QtProtobuf::QAbstractProtobufSerializer.

◆ serializeMessage()

QByteArray QProtobufJsonSerializer::serializeMessage ( const QObject *  object,
const QProtobufMetaObject &  metaObject 
) const
overrideprotectedvirtual

serializeMessage

Parameters
object
propertyOrdering
metaObject
Returns

Implements QtProtobuf::QAbstractProtobufSerializer.

◆ serializeObject()

QByteArray QProtobufJsonSerializer::serializeObject ( const QObject *  object,
const QProtobufMetaObject &  metaObject,
const QProtobufMetaProperty metaProperty 
) const
overrideprotectedvirtual

serializeObject Serializes complete object according given propertyOrdering and metaObject information

Parameters
[in]objectPointer to object to be serialized
[in]metaObjectProtobuf meta object information for given object
[in]metaPropertyInformation about property to be serialized
Returns
Raw serialized data represented as byte array

Implements QtProtobuf::QAbstractProtobufSerializer.


The documentation for this class was generated from the following files: