Bladeren bron

Lots of coding-style improvements

- Added Q_PROTOBUF_OBJECT macro to hide propertyOrdering variable definition
- Minor improvement of code generation
- Align pointer and reference indication in whole project
Alexey Edelev 5 jaren geleden
bovenliggende
commit
7678b7377d

+ 6 - 6
examples/addressbookserver/main.cpp

@@ -20,7 +20,7 @@ public:
     std::vector<::grpc::ServerAsyncWriter<Contacts> *> m_clients;
     std::vector<::grpc::ServerAsyncWriter<CallStatus> *> m_callClients;
     AddressBookService(): m_clients({}) {
-        Contact* contact = m_contacts.add_list();
+        Contact *contact = m_contacts.add_list();
         contact->set_firstname("John");
         contact->set_lastname("Doe");
         contact = m_contacts.add_list();
@@ -76,7 +76,7 @@ public:
         }
 
         std::cout << "addContact called" << std::endl;
-        Contact* newContact = m_contacts.add_list();
+        Contact *newContact = m_contacts.add_list();
         *newContact = *request;
         *response = m_contacts;
         updateContacts();
@@ -134,7 +134,7 @@ public:
 
 class ContactsHandler {
 public:
-    ContactsHandler(AddressBookService* service, ::grpc::ServerCompletionQueue* cq) :  tag_(0xdeadbeef)
+    ContactsHandler(AddressBookService *service, ::grpc::ServerCompletionQueue *cq) :  tag_(0xdeadbeef)
       , writer_(&ctx_)
       , cq_(cq)
     {
@@ -145,12 +145,12 @@ public:
     grpc::ServerContext ctx_;
     ListFrame request_;
     ::grpc::ServerAsyncWriter< ::qtprotobuf::examples::Contacts> writer_;
-    ::grpc::ServerCompletionQueue* cq_;
+    ::grpc::ServerCompletionQueue *cq_;
 };
 
 class CallHandler {
 public:
-    CallHandler(AddressBookService* service, ::grpc::ServerCompletionQueue* cq) :  tag_(0xdeadbeee)
+    CallHandler(AddressBookService *service, ::grpc::ServerCompletionQueue *cq) :  tag_(0xdeadbeee)
       , writer_(&ctx_)
       , cq_(cq)
     {
@@ -161,7 +161,7 @@ public:
     grpc::ServerContext ctx_;
     None request_;
     ::grpc::ServerAsyncWriter< ::qtprotobuf::examples::CallStatus> writer_;
-    ::grpc::ServerCompletionQueue* cq_;
+    ::grpc::ServerCompletionQueue *cq_;
 };
 
 void AddressBookService::registerWriter(ContactsHandler *handler)    {

+ 2 - 2
examples/simplechatserver/main.cpp

@@ -97,7 +97,7 @@ public:
 
 class MessageListHandler {
 public:
-    MessageListHandler(SimpleChatService* service, ::grpc::ServerCompletionQueue* cq) :  tag_(0xdeadbeef)
+    MessageListHandler(SimpleChatService *service, ::grpc::ServerCompletionQueue *cq) :  tag_(0xdeadbeef)
       , writer_(&ctx_)
       , cq_(cq)
     {
@@ -108,7 +108,7 @@ public:
     grpc::ServerContext ctx_;
     None request_;
     ::grpc::ServerAsyncWriter< ::qtprotobuf::examples::ChatMessages> writer_;
-    ::grpc::ServerCompletionQueue* cq_;
+    ::grpc::ServerCompletionQueue *cq_;
 };
 
 void SimpleChatService::loginUser(MessageListHandler *handler) {

+ 2 - 2
src/generator/classgeneratorbase.cpp

@@ -230,7 +230,7 @@ ClassGeneratorBase::EnumVisibility ClassGeneratorBase::getEnumVisibility(const F
     const FileDescriptor *enumFile = field->enum_type()->file();
 
     for (int i = 0; i < enumFile->message_type_count(); i++) {
-        const Descriptor* msg = enumFile->message_type(i);
+        const Descriptor *msg = enumFile->message_type(i);
         for (int j = 0; j < msg->enum_type_count(); j++) {
             if (enumType->full_name() == msg->enum_type(j)->full_name()) {
                 return NEIGHBOUR_ENUM;
@@ -241,7 +241,7 @@ ClassGeneratorBase::EnumVisibility ClassGeneratorBase::getEnumVisibility(const F
     return GLOBAL_ENUM;
 }
 
-void ClassGeneratorBase::getMethodParameters(const MethodDescriptor* method, std::map<std::string, std::string> &parameters)
+void ClassGeneratorBase::getMethodParameters(const MethodDescriptor *method, std::map<std::string, std::string> &parameters)
 {
     std::string inputTypeName = method->input_type()->full_name();
     std::string outputTypeName = method->output_type()->full_name();

+ 1 - 1
src/generator/classgeneratorbase.h

@@ -121,7 +121,7 @@ protected:
     template<typename T>
     static std::string getNamespacesList(const T *message, std::vector<std::string> &container, const std::string &localNamespace);
     static EnumVisibility getEnumVisibility(const ::google::protobuf::FieldDescriptor *field, const ::google::protobuf::Descriptor *messageFor);
-    void getMethodParameters(const ::google::protobuf::MethodDescriptor* method, std::map<std::string, std::string> &parameters);
+    void getMethodParameters(const ::google::protobuf::MethodDescriptor *method, std::map<std::string, std::string> &parameters);
 };
 
 } //namespace generator

+ 1 - 1
src/generator/clientgenerator.cpp

@@ -75,7 +75,7 @@ void ClientGenerator::printClientMethodsDeclaration()
 {
     Indent();
     for (int i = 0; i < mService->method_count(); i++) {
-        const MethodDescriptor* method = mService->method(i);
+        const MethodDescriptor *method = mService->method(i);
         std::map<std::string, std::string> parameters;
         getMethodParameters(method, parameters);
 

+ 1 - 1
src/generator/clientgenerator.h

@@ -41,7 +41,7 @@ namespace generator {
 class ClientGenerator : public ServiceGeneratorBase
 {
 public:
-    ClientGenerator(const ::google::protobuf::ServiceDescriptor* service,
+    ClientGenerator(const ::google::protobuf::ServiceDescriptor *service,
                     std::unique_ptr<google::protobuf::io::ZeroCopyOutputStream> out);
     ~ClientGenerator() = default;
 

+ 1 - 1
src/generator/clientsourcegenerator.cpp

@@ -45,7 +45,7 @@ ClientSourceGenerator::ClientSourceGenerator(const google::protobuf::ServiceDesc
 void ClientSourceGenerator::printMethods()
 {
     for (int i = 0; i < mService->method_count(); i++) {
-        const MethodDescriptor* method = mService->method(i);
+        const MethodDescriptor *method = mService->method(i);
         std::map<std::string, std::string> parameters;
         getMethodParameters(method, parameters);
         if (method->server_streaming()) {

+ 1 - 1
src/generator/clientsourcegenerator.h

@@ -45,7 +45,7 @@ public:
 protected:
     void printMethods();
     void printConstructor();
-    const ::google::protobuf::ServiceDescriptor* mService;
+    const ::google::protobuf::ServiceDescriptor *mService;
 };
 
 } //namespace qtprotobuf

+ 1 - 1
src/generator/generator.cpp

@@ -90,7 +90,7 @@ bool QtGenerator::Generate(const FileDescriptor *file,
     }
 
     for (int i = 0; i < file->service_count(); i++) {
-        const ServiceDescriptor* service = file->service(i);
+        const ServiceDescriptor *service = file->service(i);
         std::string baseFilename(service->name());
         utils::tolower(baseFilename);
 

+ 14 - 31
src/generator/protobufclassgenerator.cpp

@@ -75,7 +75,7 @@ void ProtobufClassGenerator::printMoveSemantic()
 
     Indent();
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
         if (isComplexType(field) || field->is_repeated()) {
             printField(field, Templates::MoveComplexFieldTemplate);
         } else {
@@ -95,7 +95,7 @@ void ProtobufClassGenerator::printMoveSemantic()
 
     Indent();
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
         if (isComplexType(field) || field->is_repeated()) {
             printField(field, Templates::MoveComplexFieldTemplate);
         } else {
@@ -123,7 +123,7 @@ void ProtobufClassGenerator::printComparisonOperators()
         mPrinter.Print("true");
     }
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
         if (producePropertyMap(field, properties)) {
             if (!isFirst) {
                 mPrinter.Print("\n&& ");
@@ -164,7 +164,7 @@ void ProtobufClassGenerator::printInclude(const FieldDescriptor *field, std::set
 {
     assert(field != nullptr);
     std::string newInclude;
-    const char* includeTemplate;
+    const char *includeTemplate;
     switch (field->type()) {
     case FieldDescriptor::TYPE_MESSAGE:
         if ( field->is_map() ) {
@@ -277,7 +277,7 @@ void ProtobufClassGenerator::printConstructor()
 {
     std::string parameterList;
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
         std::string fieldTypeName = getTypeName(field, mMessage);
         std::string fieldName = field->name();
         fieldName[0] = static_cast<char>(::tolower(fieldName[0]));
@@ -318,7 +318,7 @@ void ProtobufClassGenerator::printConstructor()
                     {"parameter_list", parameterList}}, Templates::ProtoConstructorTemplate);
 
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
         std::string fieldName = field->name();
         fieldName[0] =  static_cast<char>(::tolower(fieldName[0]));
         mPrinter.Print({{"property_name", fieldName}}, Templates::PropertyInitializerTemplate);
@@ -330,7 +330,7 @@ void ProtobufClassGenerator::printMaps()
 {
     Indent();
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
 
         if (field->is_map()) {
             std::string keyType = getTypeName(field->message_type()->field(0), mMessage);
@@ -352,7 +352,7 @@ void ProtobufClassGenerator::printMaps()
 void ProtobufClassGenerator::printLocalEmumsMetaTypesDeclaration()
 {
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
         if (field == nullptr || field->enum_type() == nullptr)
             continue;
 
@@ -367,7 +367,7 @@ void ProtobufClassGenerator::printLocalEmumsMetaTypesDeclaration()
 void ProtobufClassGenerator::printMapsMetaTypesDeclaration()
 {
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
         if (field->is_map()) {
              mPrinter.Print({{"classname", field->message_type()->name()},
                              {"namespaces", mNamespacesColonDelimited + "::" + mClassName}}, Templates::DeclareMetaTypeTemplate);
@@ -381,8 +381,8 @@ void ProtobufClassGenerator::printProperties()
     //private section
     Indent();
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
-        const char* propertyTemplate = Templates::PropertyTemplate;
+        const FieldDescriptor *field = mMessage->field(i);
+        const char *propertyTemplate = Templates::PropertyTemplate;
         if (field->type() == FieldDescriptor::TYPE_MESSAGE && !field->is_map() && !field->is_repeated()) {
             propertyTemplate = Templates::MessagePropertyTemplate;
         }
@@ -391,7 +391,7 @@ void ProtobufClassGenerator::printProperties()
 
     //Generate extra QmlListProperty that is mapped to list
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
         if (field->type() == FieldDescriptor::TYPE_MESSAGE && field->is_repeated() && !field->is_map()) {
             printField(field, Templates::QmlListPropertyTemplate);
         }
@@ -413,7 +413,7 @@ void ProtobufClassGenerator::printProperties()
     printComparisonOperators();
 
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
         if (field->type() == FieldDescriptor::TYPE_MESSAGE) {
             if (!field->is_map() && !field->is_repeated()) {
                 printField(field, Templates::GetterMessageTemplate);
@@ -462,13 +462,6 @@ void ProtobufClassGenerator::printListType()
 
 }
 
-void ProtobufClassGenerator::printFieldsOrderingDefinition()
-{
-    Indent();
-    mPrinter.Print(Templates::FieldsOrderingDefinitionContainerTemplate);
-    Outdent();
-}
-
 void ProtobufClassGenerator::printClassMembers()
 {
     Indent();
@@ -482,7 +475,7 @@ std::set<std::string> ProtobufClassGenerator::extractModels() const
 {
     std::set<std::string> extractedModels;
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
         if (field->is_repeated()
                 && field->type() == FieldDescriptor::TYPE_MESSAGE) {
             std::string typeName = field->message_type()->name();
@@ -492,13 +485,6 @@ std::set<std::string> ProtobufClassGenerator::extractModels() const
     return extractedModels;
 }
 
-void ProtobufClassGenerator::printSerializers()
-{
-    Indent();
-    mPrinter.Print({{"classname", mClassName}}, Templates::SerializersTemplate);
-    Outdent();
-}
-
 void ProtobufClassGenerator::run()
 {
     printPreamble();
@@ -506,9 +492,6 @@ void ProtobufClassGenerator::run()
     printNamespaces();
     printClassDeclaration();
     printProperties();
-    printPublic();
-    printFieldsOrderingDefinition();
-    printSerializers();
     printPrivate();
     printClassMembers();
     encloseClass();

+ 2 - 4
src/generator/protobufclassgenerator.h

@@ -45,9 +45,9 @@ using PropertyMap = std::map<std::string, std::string>;
 
 class ProtobufClassGenerator : public ClassGeneratorBase
 {
-    const ::google::protobuf::Descriptor* mMessage;
+    const ::google::protobuf::Descriptor *mMessage;
 public:
-    ProtobufClassGenerator(const ::google::protobuf::Descriptor* message, std::unique_ptr<::google::protobuf::io::ZeroCopyOutputStream> out);
+    ProtobufClassGenerator(const ::google::protobuf::Descriptor *message, std::unique_ptr<::google::protobuf::io::ZeroCopyOutputStream> out);
     virtual ~ProtobufClassGenerator() = default;
 
     void run() override;
@@ -58,7 +58,6 @@ public:
     void printComparisonOperators();
     void printField(const ::google::protobuf::FieldDescriptor *field, const char *fieldTemplate);
     void printProperties();
-    void printFieldsOrderingDefinition();
     void printClassMembers();
     void printConstructor();
     void printListType();
@@ -66,7 +65,6 @@ public:
     void printMaps();
     void printMapsMetaTypesDeclaration();
     void printLocalEmumsMetaTypesDeclaration();
-    void printSerializers();
 
     std::set<std::string> extractModels() const;
 

+ 2 - 2
src/generator/protobufsourcegenerator.cpp

@@ -53,7 +53,7 @@ void ProtobufSourceGenerator::printRegisterBody()
     mPrinter.Print(registrationProperties, Templates::QmlRegisterTypeTemplate);
 
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
         if (field->type() == FieldDescriptor::TYPE_ENUM
                 && isLocalMessageEnum(mMessage, field)) {
             mPrinter.Print({{"type", mClassName + "::" + field->enum_type()->name() + "List"},
@@ -91,7 +91,7 @@ void ProtobufSourceGenerator::printFieldsOrdering() {
     mPrinter.Print({{"type", mClassName}}, Templates::FieldsOrderingContainerTemplate);
     Indent();
     for (int i = 0; i < mMessage->field_count(); i++) {
-        const FieldDescriptor* field = mMessage->field(i);
+        const FieldDescriptor *field = mMessage->field(i);
         if (i != 0) {
             mPrinter.Print("\n,");
         }

+ 4 - 4
src/generator/servicegeneratorbase.cpp

@@ -41,7 +41,7 @@ using namespace ::google::protobuf;
 using namespace ::google::protobuf::compiler;
 using namespace qtprotobuf::generator;
 
-ServiceGeneratorBase::ServiceGeneratorBase(const ::google::protobuf::ServiceDescriptor* service,
+ServiceGeneratorBase::ServiceGeneratorBase(const ::google::protobuf::ServiceDescriptor *service,
                                            std::unique_ptr<google::protobuf::io::ZeroCopyOutputStream> out) :
     ClassGeneratorBase(service->full_name(), std::move(out))
   , mService(service)
@@ -53,7 +53,7 @@ void ServiceGeneratorBase::printIncludes()
     std::unordered_set<std::string> includeSet;
 
     for (int i = 0; i < mService->method_count(); i++) {
-        const MethodDescriptor* method = mService->method(i);
+        const MethodDescriptor *method = mService->method(i);
         std::string inputTypeName = method->input_type()->name();
         std::string outputTypeName = method->output_type()->name();
         utils::tolower(inputTypeName);
@@ -72,11 +72,11 @@ void ServiceGeneratorBase::printClassName()
     mPrinter.Print({{"classname", mClassName}}, Templates::NonProtoClassDefinitionTemplate);
 }
 
-void ServiceGeneratorBase::printMethodsDeclaration(const char* methodTemplate, const char* methodAsyncTemplate, const char* methodAsync2Template)
+void ServiceGeneratorBase::printMethodsDeclaration(const char *methodTemplate, const char *methodAsyncTemplate, const char *methodAsync2Template)
 {
     Indent();
     for (int i = 0; i < mService->method_count(); i++) {
-        const MethodDescriptor* method = mService->method(i);
+        const MethodDescriptor *method = mService->method(i);
         std::map<std::string, std::string> parameters;
         getMethodParameters(method, parameters);
         mPrinter.Print(parameters, methodTemplate);

+ 3 - 3
src/generator/servicegeneratorbase.h

@@ -41,16 +41,16 @@ namespace generator {
 class ServiceGeneratorBase : public ClassGeneratorBase
 {
 protected:
-    const ::google::protobuf::ServiceDescriptor* mService;
+    const ::google::protobuf::ServiceDescriptor *mService;
 
 public:
-    ServiceGeneratorBase(const ::google::protobuf::ServiceDescriptor* service,
+    ServiceGeneratorBase(const ::google::protobuf::ServiceDescriptor *service,
                          std::unique_ptr<google::protobuf::io::ZeroCopyOutputStream> out);
     void run() = 0;
 
     void printIncludes();
     void printClassName();
-    void printMethodsDeclaration(const char* methodTemplate, const char* methodAsyncTemplate = "", const char *methodAsync2Template = "");
+    void printMethodsDeclaration(const char *methodTemplate, const char *methodAsyncTemplate = "", const char *methodAsync2Template = "");
 };
 
 } //namespace generator

+ 9 - 10
src/generator/templates.cpp

@@ -67,8 +67,10 @@ const char *Templates::NonProtoClassDefinitionTemplate = "\nclass $classname$ :
                                                          "{\n"
                                                          "    Q_OBJECT\n";
 const char *Templates::ProtoClassDefinitionTemplate = "\nclass $classname$ : public QObject\n"
-                                                 "{\n"
-                                                 "    Q_OBJECT\n";
+                                                      "{\n"
+                                                      "    Q_OBJECT\n"
+                                                      "    Q_PROTOBUF_OBJECT\n"
+                                                      "    Q_DECLARE_PROTOBUF_SERIALIZERS($classname$)\n";
 
 const char *Templates::PropertyTemplate = "Q_PROPERTY($type$ $property_name$ READ $property_name$ WRITE set$property_name_cap$ NOTIFY $property_name$Changed)\n";
 const char *Templates::MessagePropertyTemplate = "Q_PROPERTY($type$ *$property_name$ READ $property_name$_p WRITE set$property_name_cap$_p NOTIFY $property_name$Changed)\n";
@@ -146,17 +148,15 @@ const char *Templates::SetterTemplateSimpleType = "void set$property_name_cap$(c
 const char *Templates::SignalsBlockTemplate = "\nsignals:\n";
 const char *Templates::SignalTemplate = "void $property_name$Changed();\n";
 
-const char *Templates::FieldsOrderingDefinitionContainerTemplate = "static const std::unordered_map<int/*field number*/, int/*property number*/> propertyOrdering;\n";
-
 const char *Templates::FieldsOrderingContainerTemplate = "const std::unordered_map<int, int> $type$::propertyOrdering = {";
-const char *Templates::FieldOrderTemplate = "{$field_number$,$property_number$}";
+const char *Templates::FieldOrderTemplate = "{$field_number$, $property_number$}";
 
 const char *Templates::EnumTemplate = "$type$";
 
 const char *Templates::SimpleBlockEnclosureTemplate = "}\n\n";
 const char *Templates::SemicolonBlockEnclosureTemplate = "};\n";
 const char *Templates::EmptyBlockTemplate = "{}\n\n";
-const char *Templates::PropertyInitializerTemplate = "\n    ,m_$property_name$($property_name$)";
+const char *Templates::PropertyInitializerTemplate = "\n    , m_$property_name$($property_name$)";
 const char *Templates::ConstructorContentTemplate = "\n{\n}\n";
 
 const char *Templates::DeclareMetaTypeTemplate = "Q_DECLARE_METATYPE($namespaces$::$classname$)\n";
@@ -185,7 +185,7 @@ const char *Templates::ClassDefinitionTemplate = "\nclass $classname$ : public $
 const char *Templates::QObjectMacro = "Q_OBJECT";
 const char *Templates::ClientMethodDeclarationSyncTemplate = "Q_INVOKABLE bool $method_name$(const $param_type$ &$param_name$, const QPointer<$return_type$> &$return_name$);\n";
 const char *Templates::ClientMethodDeclarationAsyncTemplate = "Q_INVOKABLE qtprotobuf::AsyncReply *$method_name$(const $param_type$ &$param_name$);\n";
-const char *Templates::ClientMethodDeclarationAsync2Template = "Q_INVOKABLE void $method_name$(const $param_type$ &$param_name$, const QObject* context, const std::function<void(qtprotobuf::AsyncReply*)> &callback);\n";
+const char *Templates::ClientMethodDeclarationAsync2Template = "Q_INVOKABLE void $method_name$(const $param_type$ &$param_name$, const QObject *context, const std::function<void(qtprotobuf::AsyncReply *)> &callback);\n";
 const char *Templates::ServerMethodDeclarationTemplate = "Q_INVOKABLE virtual $return_type$ $method_name$(const $param_type$ &$param_name$) = 0;\n";
 
 
@@ -200,15 +200,14 @@ const char *Templates::ClientMethodDefinitionAsyncTemplate = "\nqtprotobuf::Asyn
                                                              "{\n"
                                                              "    return call(\"$method_name$\", $param_name$);\n"
                                                              "}\n";
-const char *Templates::ClientMethodDefinitionAsync2Template = "\nvoid $classname$::$method_name$(const $param_type$ &$param_name$, const QObject* context, const std::function<void(AsyncReply*)> &callback)\n"
+const char *Templates::ClientMethodDefinitionAsync2Template = "\nvoid $classname$::$method_name$(const $param_type$ &$param_name$, const QObject *context, const std::function<void(AsyncReply *)> &callback)\n"
                                                               "{\n"
-                                                              "    qtprotobuf::AsyncReply* reply = call(\"$method_name$\", $param_name$);\n"
+                                                              "    qtprotobuf::AsyncReply *reply = call(\"$method_name$\", $param_name$);\n"
                                                               "    QObject::connect(reply, &qtprotobuf::AsyncReply::finished, context, [reply, callback](){\n"
                                                               "        callback(reply);\n"
                                                               "    });\n"
                                                               "}\n";
 
-const char *Templates::SerializersTemplate = "Q_DECLARE_PROTOBUF_SERIALIZERS($classname$)\n";
 const char *Templates::RegisterSerializersTemplate = "qtprotobuf::ProtobufObjectPrivate::registerSerializers<$classname$>();\n";
 const char *Templates::RegistratorTemplate = "static qtprotobuf::RegistrationHelper helper(registerTypes);\n";
 const char *Templates::QmlRegisterTypeTemplate = "qmlRegisterType<$namespaces$::$classname$>(\"$package$\", 1, 0, \"$classname$\");\n";

+ 0 - 2
src/generator/templates.h

@@ -90,7 +90,6 @@ public:
     static const char *SetterTemplateMessageType;
     static const char *SignalsBlockTemplate;
     static const char *SignalTemplate;
-    static const char *FieldsOrderingDefinitionContainerTemplate;
     static const char *FieldsOrderingContainerTemplate;
     static const char *FieldOrderTemplate;
     static const char *EnumTemplate;
@@ -109,7 +108,6 @@ public:
     static const char *RegisterQmlListPropertyMetaTypeTemplate;
     static const char *QEnumTemplate;
     static const char *MapSerializationRegisterTemplate;
-    static const char *SerializersTemplate;
     static const char *RegisterSerializersTemplate;
     static const char *RegistratorTemplate;
     static const char *QmlRegisterTypeTemplate;

+ 1 - 1
src/generator/utils.h

@@ -58,7 +58,7 @@ static void replace(std::string &data, const std::string &from, const std::strin
     }
 }
 
-static void tolower(std::string& str) {
+static void tolower(std::string &str) {
     std::transform(std::begin(str), std::end(str), std::begin(str), ::tolower);
 }
 

+ 1 - 1
src/grpc/abstractchannel.h

@@ -89,7 +89,7 @@ public:
      * \param args
      * \param handler
      */
-    virtual void subscribe(const QString &method, const QString &service, const QByteArray &args, AbstractClient* client, const std::function<void(const QByteArray&)> &handler) = 0;
+    virtual void subscribe(const QString &method, const QString &service, const QByteArray &args, AbstractClient *client, const std::function<void(const QByteArray &)> &handler) = 0;
 protected:
     AbstractChannel() = default;
     virtual ~AbstractChannel() = default;

+ 2 - 2
src/grpc/abstractclient.cpp

@@ -58,7 +58,7 @@ void AbstractClient::attachChannel(const std::shared_ptr<AbstractChannel> &chann
     d->channel = channel;
 }
 
-bool AbstractClient::call(const QString &method, const QByteArray& arg, QByteArray& ret)
+bool AbstractClient::call(const QString &method, const QByteArray &arg, QByteArray &ret)
 {
     if (!d->channel) {
         d->lastError = AbstractChannel::Unknown;
@@ -69,7 +69,7 @@ bool AbstractClient::call(const QString &method, const QByteArray& arg, QByteArr
     return d->lastError == AbstractChannel::Ok;
 }
 
-AsyncReply *AbstractClient::call(const QString &method, const QByteArray& arg)
+AsyncReply *AbstractClient::call(const QString &method, const QByteArray &arg)
 {
     AsyncReply *reply = new AsyncReply(d->channel);
 

+ 4 - 4
src/grpc/abstractclient.h

@@ -92,7 +92,7 @@ protected:
         subscribe_p(method, arg.serialize(), [this, signal](const QByteArray &data) {
             R ret;
             ret.deserialize(data);
-            C* client = static_cast<C*>(this);
+            C *client = static_cast<C *>(this);
             (client->*signal)(ret);
         });
     }
@@ -114,9 +114,9 @@ protected:
     }
 
 private:
-    bool call(const QString &method, const QByteArray& arg, QByteArray& ret);
-    AsyncReply *call(const QString &method, const QByteArray& arg);
-    void subscribe_p(const QString &method, const QByteArray& arg, const std::function<void(const QByteArray&)> &handler);
+    bool call(const QString &method, const QByteArray &arg, QByteArray &ret);
+    AsyncReply *call(const QString &method, const QByteArray &arg);
+    void subscribe_p(const QString &method, const QByteArray &arg, const std::function<void(const QByteArray &)> &handler);
 
     Q_DISABLE_COPY(AbstractClient)
     AbstractClient(AbstractClient &&) = delete;

+ 4 - 4
src/grpc/abstractcredentials.h

@@ -65,8 +65,8 @@ public:
     }
 protected:
     AbstractCredentials() = default;
-    void setCallCredentials(const CredentialMap& credentialMap) { mCallCredentials = credentialMap; }
-    void setChannelCredentials(const CredentialMap& credentialMap) { mChannelCredentials = credentialMap; }
+    void setCallCredentials(const CredentialMap &credentialMap) { mCallCredentials = credentialMap; }
+    void setChannelCredentials(const CredentialMap &credentialMap) { mChannelCredentials = credentialMap; }
 
 private:
     CredentialMap mCallCredentials;
@@ -76,7 +76,7 @@ private:
 class QTGRPCSHARED_EXPORT CallCredentials : public AbstractCredentials
 {
 protected:
-    CallCredentials(const CredentialMap& credentialMap) {
+    CallCredentials(const CredentialMap &credentialMap) {
         setCallCredentials(credentialMap);
         setChannelCredentials(CredentialMap{});
     }
@@ -88,7 +88,7 @@ private:
 class QTGRPCSHARED_EXPORT ChannelCredentials : public AbstractCredentials
 {
 protected:
-    ChannelCredentials(const CredentialMap& credentialMap) {
+    ChannelCredentials(const CredentialMap &credentialMap) {
         setCallCredentials(CredentialMap{});
         setChannelCredentials(credentialMap);
     }

+ 1 - 1
src/grpc/asyncreply.h

@@ -59,7 +59,7 @@ signals:
     void error(AbstractChannel::StatusCodes);
 
 protected:
-    AsyncReply(const std::shared_ptr<AbstractChannel> &channel, QObject* parent = nullptr) : QObject(parent)
+    AsyncReply(const std::shared_ptr<AbstractChannel> &channel, QObject *parent = nullptr) : QObject(parent)
     , m_channel(channel){}
     ~AsyncReply();
 

+ 9 - 9
src/grpc/http2channel.cpp

@@ -99,9 +99,9 @@ struct Http2ChannelPrivate {
     QNetworkAccessManager nm;
     AbstractCredentials credentials;
     QSslConfiguration sslConfig;
-    std::unordered_map<QNetworkReply*, ExpectedData> activeStreamReplies;
+    std::unordered_map<QNetworkReply *, ExpectedData> activeStreamReplies;
 
-    QNetworkReply* post(const QString &method, const QString &service, const QByteArray &args, bool stream = false) {
+    QNetworkReply *post(const QString &method, const QString &service, const QByteArray &args, bool stream = false) {
         QUrl callUrl = url;
         callUrl.setPath("/" + service + "/" + method);
 
@@ -120,28 +120,28 @@ struct Http2ChannelPrivate {
         request.setAttribute(QNetworkRequest::Http2DirectAttribute, true);
 
         QByteArray msg(5, '\0');
-        *(int*)(msg.data() + 1) = qToBigEndian(args.size());
+        *(int *)(msg.data() + 1) = qToBigEndian(args.size());
         msg += args;
         qProtoDebug() << "SEND: " << msg.size();
 
-        QNetworkReply* networkReply = nm.post(request, msg);
+        QNetworkReply *networkReply = nm.post(request, msg);
 
         if (!stream) {
             //TODO: Add configurable timeout logic
-            QTimer::singleShot(6000, networkReply, [networkReply, this]() {
+            QTimer::singleShot(6000, networkReply, [networkReply]() {
                 Http2ChannelPrivate::abortNetworkReply(networkReply);
             });
         }
         return networkReply;
     }
 
-    static void abortNetworkReply(QNetworkReply* networkReply) {
+    static void abortNetworkReply(QNetworkReply *networkReply) {
         if (networkReply->isRunning()) {
             networkReply->abort();
         }
     }
 
-    static QByteArray processReply(QNetworkReply* networkReply, AbstractChannel::StatusCodes& statusCode) {
+    static QByteArray processReply(QNetworkReply *networkReply, AbstractChannel::StatusCodes &statusCode) {
         //Check if no network error occured
         if (networkReply->error() != QNetworkReply::NoError) {
             qProtoWarning() << "Network error occured" << networkReply->errorString();
@@ -262,7 +262,7 @@ void Http2Channel::subscribe(const QString &method, const QString &service, cons
 
         if (replyIt == d->activeStreamReplies.end()) {
             qProtoDebug() << data.toHex();
-            int expectedDataSize = qFromBigEndian(*(int*)(data.data() + 1)) + 5;
+            int expectedDataSize = qFromBigEndian(*(int *)(data.data() + 1)) + 5;
             qProtoDebug() << "First chunk received: " << data.size() << " expectedDataSize: " << expectedDataSize;
 
             if (expectedDataSize == 0) {
@@ -286,7 +286,7 @@ void Http2Channel::subscribe(const QString &method, const QString &service, cons
         }
     });
 
-    QObject::connect(client, &AbstractClient::destroyed, networkReply, [client, networkReply, connection, this](){
+    QObject::connect(client, &AbstractClient::destroyed, networkReply, [networkReply, connection, this](){
         d->activeStreamReplies.erase(networkReply);
         QObject::disconnect(connection);
         Http2ChannelPrivate::abortNetworkReply(networkReply);

+ 10 - 2
src/protobuf/qprotobufobject.h

@@ -27,5 +27,13 @@
 
 #include "qprotobufobject_p.h"
 
-#define Q_DECLARE_PROTOBUF_SERIALIZERS(T) QByteArray serialize() const { return qtprotobuf::ProtobufObjectPrivate::serialize<T>(this); } \
-    void deserialize(const QByteArray &array) { qtprotobuf::ProtobufObjectPrivate::deserialize<T>(this, array); }
+#define Q_DECLARE_PROTOBUF_SERIALIZERS(T)\
+    public:\
+        QByteArray serialize() const { return qtprotobuf::ProtobufObjectPrivate::serialize<T>(this); }\
+        void deserialize(const QByteArray &array) { qtprotobuf::ProtobufObjectPrivate::deserialize<T>(this, array); }\
+    private:
+
+#define Q_PROTOBUF_OBJECT\
+    public:\
+        static const std::unordered_map<int/*field number*/, int/*property number*/> propertyOrdering;\
+    private:

+ 1 - 1
src/protobuf/qprotobufobject_p.cpp

@@ -135,7 +135,7 @@ void ProtobufObjectPrivate::deserializeProperty(QObject *object, const QMetaProp
     metaProperty.write(object, newPropertyValue);
 }
 
-void ProtobufObjectPrivate::deserializeUserType(const QMetaProperty &metaProperty, SelfcheckIterator& it, QVariant &out)
+void ProtobufObjectPrivate::deserializeUserType(const QMetaProperty &metaProperty, SelfcheckIterator &it, QVariant &out)
 {
     qProtoDebug() << __func__ << "userType" << metaProperty.userType() << "typeName" << metaProperty.typeName()
                   << "currentByte:" << QString::number((*it), 16);

+ 15 - 15
src/protobuf/qprotobufobject_p.h

@@ -107,9 +107,9 @@ public:
               typename std::enable_if_t<std::is_base_of<QObject, T>::value, int> = 0>
     static void wrapSerializer(const std::function<QByteArray(const T &, int &)> &s, const std::function<QVariant(SelfcheckIterator &)> &d, WireTypes type)
     {
-        serializers[qMetaTypeId<T*>()] = {
+        serializers[qMetaTypeId<T *>()] = {
             [s](const QVariant &value, int &fieldIndex) {
-                return s(*(value.value<T*>()), fieldIndex);
+                return s(*(value.value<T *>()), fieldIndex);
             },
             [d](SelfcheckIterator &it, QVariant &value){
                 value = d(it);
@@ -122,9 +122,9 @@ public:
               typename std::enable_if_t<std::is_base_of<QObject, T>::value, int> = 0>
     static void wrapSerializer(const std::function<QByteArray(const T &, int &)> &s, const std::function<void(SelfcheckIterator &it, QVariant &value)> &d, WireTypes type)
     {
-        serializers[qMetaTypeId<T*>()] = {
+        serializers[qMetaTypeId<T *>()] = {
             [s](const QVariant &value, int &fieldIndex) {
-                return s(*(value.value<T*>()), fieldIndex);
+                return s(*(value.value<T *>()), fieldIndex);
             },
             d,
             type
@@ -171,7 +171,7 @@ public:
 
         //Reserve required number of bytes
         QByteArray result(sizeof(V), '\0');
-        *reinterpret_cast<V*>(result.data()) = value;
+        *reinterpret_cast<V *>(result.data()) = value;
         return result;
     }
 
@@ -185,7 +185,7 @@ public:
 
         //Reserve required number of bytes
         QByteArray result(sizeof(V), '\0');
-        *reinterpret_cast<V*>(result.data()) = value;
+        *reinterpret_cast<V *>(result.data()) = value;
         return result;
     }
 
@@ -378,7 +378,7 @@ public:
         using ItType = typename QMap<K, QSharedPointer<V>>::const_iterator;
         QByteArray mapResult;
         auto kSerializer = serializers.at(qMetaTypeId<K>());//Throws exception if not found
-        auto vSerializer = serializers.at(qMetaTypeId<V*>());//Throws exception if not found
+        auto vSerializer = serializers.at(qMetaTypeId<V *>());//Throws exception if not found
 
         for ( ItType it = mapValue.constBegin(); it != mapValue.constEnd(); it++) {
             QByteArray result;
@@ -411,7 +411,7 @@ public:
               typename std::enable_if_t<std::is_base_of<QObject, V>::value, int> = 0>
     static QByteArray mapSerializeHelper(V *value, const SerializationHandlers &handlers) {
         int mapIndex = num;
-        QByteArray result = handlers.serializer(QVariant::fromValue<V*>(value), mapIndex);
+        QByteArray result = handlers.serializer(QVariant::fromValue<V *>(value), mapIndex);
         if (mapIndex != NotUsedFieldIndex
                 && handlers.type != UnknownWireType) {
             result.prepend(encodeHeader(mapIndex, handlers.type));
@@ -450,7 +450,7 @@ public:
     static QVariant deserializeBasic(SelfcheckIterator &it) {
         qProtoDebug() << __func__ << "currentByte:" << QString::number((*it), 16);
 
-        QVariant newPropertyValue(QVariant::fromValue(*(V*)((QByteArray::const_iterator&)it)));
+        QVariant newPropertyValue(QVariant::fromValue(*(V *)((QByteArray::const_iterator&)it)));
         it += sizeof(V);
         return newPropertyValue;
     }
@@ -532,7 +532,7 @@ public:
     static QVariant deserializeList(SelfcheckIterator &it) {
         qProtoDebug() << __func__ << "currentByte:" << QString::number((*it), 16);
         QVariant newValue;
-        serializers.at(qMetaTypeId<V*>()).deserializer(it, newValue);//Throws exception if not found
+        serializers.at(qMetaTypeId<V *>()).deserializer(it, newValue);//Throws exception if not found
         return newValue;
     }
 
@@ -592,7 +592,7 @@ public:
         WireTypes type = WireTypes::UnknownWireType;
 
         K key;
-        V* value;
+        V *value;
 
         unsigned int count = deserializeBasic<uint32>(it).toUInt();
         qProtoDebug() << __func__ << "count:" << count;
@@ -647,7 +647,7 @@ public:
     static QVariant deserializeComplexType(SelfcheckIterator &it) {
         T *value = new T;
         value->deserialize(ProtobufObjectPrivate::deserializeLengthDelimited(it));
-        return QVariant::fromValue<T*>(value);
+        return QVariant::fromValue<T *>(value);
     }
 
     template <typename T,
@@ -662,7 +662,7 @@ public:
     static void deserializeComplexListType(SelfcheckIterator &it, QVariant &previous) {
         QList<QSharedPointer<T>> previousList = previous.value<QList<QSharedPointer<T>>>();
         QVariant newMember = ProtobufObjectPrivate::deserializeList<T>(it);
-        previousList.append(QSharedPointer<T>(newMember.value<T*>()));
+        previousList.append(QSharedPointer<T>(newMember.value<T *>()));
         previous.setValue(previousList);
     }
 
@@ -685,7 +685,7 @@ public:
     }
 
     template<typename T>
-    static void deserialize(QObject* object, const QByteArray &array) {
+    static void deserialize(QObject *object, const QByteArray &array) {
         qProtoDebug() << T::staticMetaObject.className() << "deserialize";
 
         for (SelfcheckIterator it(array); it != array.end();) {
@@ -744,7 +744,7 @@ public:
     }
 
     template<typename T>
-    static QQmlListProperty<T> constructQmlListProperty(QObject* p, QList<QSharedPointer<T>> *data)
+    static QQmlListProperty<T> constructQmlListProperty(QObject *p, QList<QSharedPointer<T>> *data)
     {
         return QQmlListProperty<T>(p, data, qmllistpropertyAppend<T>, qmllistpropertyCount<T>,
                                    qmllistpropertyAt<T>, qmllistpropertyReset<T>);

+ 2 - 2
src/protobuf/qtprotobuftypes.h

@@ -45,9 +45,9 @@ template<typename T, int = 0>
 struct transparent {
     transparent(T t = T()) : _t(t){}
     T _t;
-    operator T&(){ return _t; }
+    operator T &(){ return _t; }
     operator T() const { return _t; }
-    transparent& operator =(const T& t) { _t = t; return *this; }
+    transparent &operator =(const T &t) { _t = t; return *this; }
 };
 
 using int32 = transparent<int32_t>;

+ 4 - 4
src/protobuf/selfcheckiterator.h

@@ -102,19 +102,19 @@ public:
         return *this;
     }
 
-    bool operator ==(const SelfcheckIterator& other) const {
+    bool operator ==(const SelfcheckIterator &other) const {
         return other.m_it == m_it;
     }
 
-    bool operator !=(const SelfcheckIterator& other) const {
+    bool operator !=(const SelfcheckIterator &other) const {
         return other.m_it != m_it;
     }
 
-    bool operator ==(const QByteArray::const_iterator& other) const {
+    bool operator ==(const QByteArray::const_iterator &other) const {
         return other == m_it;
     }
 
-    bool operator !=(const QByteArray::const_iterator& other) const {
+    bool operator !=(const QByteArray::const_iterator &other) const {
         return other != m_it;
     }
 private:

+ 5 - 5
tests/test_grpc/clienttest.cpp

@@ -60,7 +60,7 @@ TEST_F(ClientTest, CheckMethodsGeneration)
     QPointer<SimpleStringMessage> result(new SimpleStringMessage);
     testClient.testMethod(request, result);
     testClient.testMethod(request);
-    testClient.testMethod(request, &testClient, [](AsyncReply*){});
+    testClient.testMethod(request, &testClient, [](AsyncReply *){});
     delete result;
 }
 
@@ -85,7 +85,7 @@ TEST_F(ClientTest, StringEchoAsyncTest)
     request.setTestFieldString("Hello beach!");
     QEventLoop waiter;
 
-    AsyncReply* reply = testClient.testMethod(request);
+    AsyncReply *reply = testClient.testMethod(request);
     QObject::connect(reply, &AsyncReply::finished, &m_app, [reply, &result, &waiter, &testClient]() {
         if (testClient.lastError() == AbstractChannel::StatusCodes::Ok) {
             result = reply->read<SimpleStringMessage>();
@@ -126,7 +126,7 @@ TEST_F(ClientTest, StringEchoAsyncAbortTest)
     QEventLoop waiter;
 
     bool errorCalled = false;
-    AsyncReply* reply = testClient.testMethod(request);
+    AsyncReply *reply = testClient.testMethod(request);
     result.setTestFieldString("Result not changed by echo");
     QObject::connect(reply, &AsyncReply::finished, &m_app, [reply, &result, &waiter, &testClient]() {
         if (testClient.lastError() == AbstractChannel::StatusCodes::Ok) {
@@ -180,7 +180,7 @@ TEST_F(ClientTest, StringEchoStreamTest)
     QEventLoop waiter;
 
     int i = 0;
-    QObject::connect(&testClient, &TestServiceClient::testMethodServerStreamUpdated, &m_app, [&result, &i, &waiter](const SimpleStringMessage& ret) {
+    QObject::connect(&testClient, &TestServiceClient::testMethodServerStreamUpdated, &m_app, [&result, &i, &waiter](const SimpleStringMessage &ret) {
         ++i;
 
         result.setTestFieldString(result.testFieldString() + ret.testFieldString());
@@ -240,7 +240,7 @@ TEST_F(ClientTest, HugeBlobEchoStreamTest)
     QByteArray dataHash = QCryptographicHash::hash(request.testBytes(), QCryptographicHash::Sha256);
     QEventLoop waiter;
 
-    QObject::connect(&testClient, &TestServiceClient::testMethodBlobServerStreamUpdated, &m_app, [&result, &waiter](const BlobMessage& ret) {
+    QObject::connect(&testClient, &TestServiceClient::testMethodBlobServerStreamUpdated, &m_app, [&result, &waiter](const BlobMessage &ret) {
         result.setTestBytes(ret.testBytes());
         waiter.quit();
     });

+ 38 - 38
tests/test_protobuf/simpletest.cpp

@@ -98,7 +98,7 @@ public:
 
 TEST_F(SimpleTest, SimpleBoolMessageTest)
 {
-    const char* propertyName = "testFieldBool";
+    const char *propertyName = "testFieldBool";
     assertMessagePropertyRegistered<SimpleBoolMessage, bool>(1, "bool", propertyName);
 
     SimpleBoolMessage test;
@@ -109,7 +109,7 @@ TEST_F(SimpleTest, SimpleBoolMessageTest)
 
 TEST_F(SimpleTest, SimpleIntMessageTest)
 {
-    const char* propertyName = "testFieldInt";
+    const char *propertyName = "testFieldInt";
     assertMessagePropertyRegistered<SimpleIntMessage, int32>(1, "qtprotobuf::int32", propertyName);
 
     SimpleIntMessage test;
@@ -120,7 +120,7 @@ TEST_F(SimpleTest, SimpleIntMessageTest)
 
 TEST_F(SimpleTest, SimpleSIntMessageTest)
 {
-    const char* propertyName = "testFieldInt";
+    const char *propertyName = "testFieldInt";
     assertMessagePropertyRegistered<SimpleSIntMessage, sint32>(1, "qtprotobuf::sint32", propertyName);
 
     SimpleSIntMessage test;
@@ -131,7 +131,7 @@ TEST_F(SimpleTest, SimpleSIntMessageTest)
 
 TEST_F(SimpleTest, SimpleUIntMessageTest)
 {
-    const char* propertyName = "testFieldInt";
+    const char *propertyName = "testFieldInt";
     assertMessagePropertyRegistered<SimpleUIntMessage, uint32>(1, "qtprotobuf::uint32", propertyName);
 
     SimpleUIntMessage test;
@@ -142,7 +142,7 @@ TEST_F(SimpleTest, SimpleUIntMessageTest)
 
 TEST_F(SimpleTest, SimpleInt64MessageTest)
 {
-    const char* propertyName = "testFieldInt";
+    const char *propertyName = "testFieldInt";
     assertMessagePropertyRegistered<SimpleInt64Message, int64>(1, "qtprotobuf::int64", propertyName);
 
     SimpleInt64Message test;
@@ -153,7 +153,7 @@ TEST_F(SimpleTest, SimpleInt64MessageTest)
 
 TEST_F(SimpleTest, SimpleSInt64MessageTest)
 {
-    const char* propertyName = "testFieldInt";
+    const char *propertyName = "testFieldInt";
     assertMessagePropertyRegistered<SimpleSInt64Message, sint64>(1, "qtprotobuf::sint64", propertyName);
 
     SimpleSInt64Message test;
@@ -164,7 +164,7 @@ TEST_F(SimpleTest, SimpleSInt64MessageTest)
 
 TEST_F(SimpleTest, SimpleUInt64MessageTest)
 {
-    const char* propertyName = "testFieldInt";
+    const char *propertyName = "testFieldInt";
     assertMessagePropertyRegistered<SimpleUInt64Message, uint64>(1, "qtprotobuf::uint64", propertyName);
 
     SimpleUInt64Message test;
@@ -175,7 +175,7 @@ TEST_F(SimpleTest, SimpleUInt64MessageTest)
 
 TEST_F(SimpleTest, SimpleFixedInt32MessageTest)
 {
-    const char* propertyName = "testFieldFixedInt32";
+    const char *propertyName = "testFieldFixedInt32";
     assertMessagePropertyRegistered<SimpleFixedInt32Message, fixed32>(1, "qtprotobuf::fixed32", propertyName);
 
     SimpleFixedInt32Message test;
@@ -186,7 +186,7 @@ TEST_F(SimpleTest, SimpleFixedInt32MessageTest)
 
 TEST_F(SimpleTest, SimpleFixedInt64MessageTest)
 {
-    const char* propertyName = "testFieldFixedInt64";
+    const char *propertyName = "testFieldFixedInt64";
     assertMessagePropertyRegistered<SimpleFixedInt64Message, fixed64>(1, "qtprotobuf::fixed64", propertyName);
 
     SimpleFixedInt64Message test;
@@ -197,7 +197,7 @@ TEST_F(SimpleTest, SimpleFixedInt64MessageTest)
 
 TEST_F(SimpleTest, SimpleSFixedInt32MessageTest)
 {
-    const char* propertyName = "testFieldFixedInt32";
+    const char *propertyName = "testFieldFixedInt32";
     assertMessagePropertyRegistered<SimpleSFixedInt32Message, sfixed32>(1, "qtprotobuf::sfixed32", propertyName);
 
     SimpleSFixedInt32Message test;
@@ -208,7 +208,7 @@ TEST_F(SimpleTest, SimpleSFixedInt32MessageTest)
 
 TEST_F(SimpleTest, SimpleSFixedInt64MessageTest)
 {
-    const char* propertyName = "testFieldFixedInt64";
+    const char *propertyName = "testFieldFixedInt64";
     assertMessagePropertyRegistered<SimpleSFixedInt64Message, sfixed64>(1, "qtprotobuf::sfixed64", propertyName);
 
     SimpleSFixedInt64Message test;
@@ -219,7 +219,7 @@ TEST_F(SimpleTest, SimpleSFixedInt64MessageTest)
 
 TEST_F(SimpleTest, SimpleStringMessageTest)
 {
-    const char* propertyName = "testFieldString";
+    const char *propertyName = "testFieldString";
     SimpleStringMessage test;
     int propertyNumber = SimpleStringMessage::propertyOrdering.at(6); //See simpletest.proto
     ASSERT_EQ(SimpleStringMessage::staticMetaObject.property(propertyNumber).type(), QMetaType::QString);
@@ -231,7 +231,7 @@ TEST_F(SimpleTest, SimpleStringMessageTest)
 
 TEST_F(SimpleTest, SimpleFloatMessageTest)
 {
-    const char* propertyName = "testFieldFloat";
+    const char *propertyName = "testFieldFloat";
     SimpleFloatMessage test;
     int propertyNumber = SimpleFloatMessage::propertyOrdering.at(7); //See simpletest.proto
     ASSERT_EQ(SimpleFloatMessage::staticMetaObject.property(propertyNumber).type(), QMetaType::Float);
@@ -245,7 +245,7 @@ TEST_F(SimpleTest, SimpleFloatMessageTest)
 
 TEST_F(SimpleTest, SimpleDoubleMessageTest)
 {
-    const char* propertyName = "testFieldDouble";
+    const char *propertyName = "testFieldDouble";
     SimpleDoubleMessage test;
     int propertyNumber = SimpleDoubleMessage::propertyOrdering.at(8); //See simpletest.proto
     ASSERT_EQ(SimpleDoubleMessage::staticMetaObject.property(propertyNumber).type(), QMetaType::Double);
@@ -284,7 +284,7 @@ TEST_F(SimpleTest, SimpleLocalEnumListTest)
 {
     ASSERT_GT(SimpleEnumListMessage::staticMetaObject.enumeratorCount(), 0);
 
-    const char* propertyName = "localEnumList";
+    const char *propertyName = "localEnumList";
     assertMessagePropertyRegistered<SimpleEnumListMessage, SimpleEnumListMessage::LocalEnumList>(1,  "SimpleEnumListMessage::LocalEnumList", propertyName);
 
     SimpleEnumListMessage::LocalEnumList value({SimpleEnumListMessage::LOCAL_ENUM_VALUE2,
@@ -302,7 +302,7 @@ TEST_F(SimpleTest, SimpleExternalEnumMessageTest)
 {
     using ExternalGlobalEnums = qtprotobufnamespace1::externaltests::GlobalEnums;
 
-    const char* propertyName = "externalEnum";
+    const char *propertyName = "externalEnum";
     assertMessagePropertyRegistered<SimpleExternalEnumMessage, ExternalGlobalEnums::ExternalTestEnum>(1, "qtprotobufnamespace1::externaltests::GlobalEnums::ExternalTestEnum", propertyName);
 
     SimpleExternalEnumMessage test;
@@ -338,7 +338,7 @@ TEST_F(SimpleTest, SimpleEnumsTest)
 
 TEST_F(SimpleTest, SimpleFileEnumsTest)
 {
-    const char* propertyName = "globalEnumList";
+    const char *propertyName = "globalEnumList";
     assertMessagePropertyRegistered<SimpleFileEnumMessage, GlobalEnums::TestEnumList>(2, "qtprotobufnamespace::tests::GlobalEnums::TestEnumList", propertyName);
 
     GlobalEnums::TestEnumList value({GlobalEnums::TEST_ENUM_VALUE1,
@@ -359,7 +359,7 @@ TEST_F(SimpleTest, ComplexMessageTest)
 
 TEST_F(SimpleTest, SimpleBytesMessageTest)
 {
-    const char* propertyName = "testFieldBytes";
+    const char *propertyName = "testFieldBytes";
     SimpleBytesMessage test;
     int propertyNumber = SimpleBytesMessage::propertyOrdering.at(1); //See simpletest.proto
     ASSERT_EQ(SimpleBytesMessage::staticMetaObject.property(propertyNumber).type(), QMetaType::QByteArray);
@@ -371,7 +371,7 @@ TEST_F(SimpleTest, SimpleBytesMessageTest)
 
 TEST_F(SimpleTest, SimpleExternalComplexMessageTest)
 {
-    const char* propertyName = "localList";
+    const char *propertyName = "localList";
     assertMessagePropertyRegistered<qtprotobufnamespace1::externaltests::SimpleExternalMessage, int32List>(
                 1, "qtprotobuf::int32List", propertyName);
 
@@ -383,7 +383,7 @@ TEST_F(SimpleTest, SimpleExternalComplexMessageTest)
 
 TEST_F(SimpleTest, RepeatedExternalComplexMessageTest)
 {
-    const char* propertyName = "testExternalComplex";
+    const char *propertyName = "testExternalComplex";
     assertMessagePropertyRegistered<RepeatedExternalComplexMessage, qtprotobufnamespace1::externaltests::ExternalComplexMessageList>(
                 1, "qtprotobufnamespace1::externaltests::ExternalComplexMessageList", propertyName);
 
@@ -404,7 +404,7 @@ TEST_F(SimpleTest, RepeatedExternalComplexMessageTest)
 
 TEST_F(SimpleTest, RepeatedStringMessageTest)
 {
-    const char* propertyName = "testRepeatedString";
+    const char *propertyName = "testRepeatedString";
     assertMessagePropertyRegistered<RepeatedStringMessage, QStringList>(1, "QStringList", propertyName);
 
     RepeatedStringMessage test;
@@ -415,7 +415,7 @@ TEST_F(SimpleTest, RepeatedStringMessageTest)
 
 TEST_F(SimpleTest, RepeatedIntMessageTest)
 {
-    const char* propertyName = "testRepeatedInt";
+    const char *propertyName = "testRepeatedInt";
     assertMessagePropertyRegistered<RepeatedIntMessage, int32List>(1, "qtprotobuf::int32List", propertyName);
 
     RepeatedIntMessage test;
@@ -432,7 +432,7 @@ TEST_F(SimpleTest, RepeatedIntMessageTest)
 
 TEST_F(SimpleTest, RepeatedDoubleMessageTest)
 {
-    const char* propertyName = "testRepeatedDouble";
+    const char *propertyName = "testRepeatedDouble";
     assertMessagePropertyRegistered<RepeatedDoubleMessage, DoubleList>(1, "qtprotobuf::DoubleList", propertyName);
 
     RepeatedDoubleMessage test;
@@ -449,7 +449,7 @@ TEST_F(SimpleTest, RepeatedDoubleMessageTest)
 
 TEST_F(SimpleTest, RepeatedFloatMessageTest)
 {
-    const char* propertyName = "testRepeatedFloat";
+    const char *propertyName = "testRepeatedFloat";
     assertMessagePropertyRegistered<RepeatedFloatMessage, FloatList>(1, "qtprotobuf::FloatList", propertyName);
 
     RepeatedFloatMessage test;
@@ -466,7 +466,7 @@ TEST_F(SimpleTest, RepeatedFloatMessageTest)
 
 TEST_F(SimpleTest, RepeatedBytesMessageTest)
 {
-    const char* propertyName = "testRepeatedBytes";
+    const char *propertyName = "testRepeatedBytes";
     assertMessagePropertyRegistered<RepeatedBytesMessage, QByteArrayList>(1, "QByteArrayList", propertyName);
 
     QByteArrayList bList;
@@ -489,7 +489,7 @@ TEST_F(SimpleTest, RepeatedBytesMessageTest)
 
 TEST_F(SimpleTest, RepeatedSIntMessageTest)
 {
-    const char* propertyName = "testRepeatedInt";
+    const char *propertyName = "testRepeatedInt";
     assertMessagePropertyRegistered<RepeatedSIntMessage, sint32List>(1, "qtprotobuf::sint32List", propertyName);
 
     RepeatedSIntMessage test;
@@ -506,7 +506,7 @@ TEST_F(SimpleTest, RepeatedSIntMessageTest)
 
 TEST_F(SimpleTest, RepeatedUIntMessageTest)
 {
-    const char* propertyName = "testRepeatedInt";
+    const char *propertyName = "testRepeatedInt";
     assertMessagePropertyRegistered<RepeatedUIntMessage, uint32List>(1, "qtprotobuf::uint32List", propertyName);
 
     RepeatedUIntMessage test;
@@ -523,7 +523,7 @@ TEST_F(SimpleTest, RepeatedUIntMessageTest)
 
 TEST_F(SimpleTest, RepeatedInt64MessageTest)
 {
-    const char* propertyName = "testRepeatedInt";
+    const char *propertyName = "testRepeatedInt";
     assertMessagePropertyRegistered<RepeatedInt64Message, int64List>(1, "qtprotobuf::int64List", propertyName);
 
     RepeatedInt64Message test;
@@ -540,7 +540,7 @@ TEST_F(SimpleTest, RepeatedInt64MessageTest)
 
 TEST_F(SimpleTest, RepeatedSInt64MessageTest)
 {
-    const char* propertyName = "testRepeatedInt";
+    const char *propertyName = "testRepeatedInt";
     assertMessagePropertyRegistered<RepeatedSInt64Message, sint64List>(1, "qtprotobuf::sint64List", propertyName);
 
     RepeatedSInt64Message test;
@@ -557,7 +557,7 @@ TEST_F(SimpleTest, RepeatedSInt64MessageTest)
 
 TEST_F(SimpleTest, RepeatedUInt64MessageTest)
 {
-    const char* propertyName = "testRepeatedInt";
+    const char *propertyName = "testRepeatedInt";
     assertMessagePropertyRegistered<RepeatedUInt64Message, uint64List>(1, "qtprotobuf::uint64List", propertyName);
 
     RepeatedUInt64Message test;
@@ -574,7 +574,7 @@ TEST_F(SimpleTest, RepeatedUInt64MessageTest)
 
 TEST_F(SimpleTest, RepeatedFixedIntMessageTest)
 {
-    const char* propertyName = "testRepeatedInt";
+    const char *propertyName = "testRepeatedInt";
     assertMessagePropertyRegistered<RepeatedFixedIntMessage, fixed32List>(1, "qtprotobuf::fixed32List", propertyName);
 
     RepeatedFixedIntMessage test;
@@ -591,7 +591,7 @@ TEST_F(SimpleTest, RepeatedFixedIntMessageTest)
 
 TEST_F(SimpleTest, RepeatedFixedInt64MessageTest)
 {
-    const char* propertyName = "testRepeatedInt";
+    const char *propertyName = "testRepeatedInt";
     assertMessagePropertyRegistered<RepeatedFixedInt64Message, fixed64List>(1, "qtprotobuf::fixed64List", propertyName);
 
     RepeatedFixedInt64Message test;
@@ -608,7 +608,7 @@ TEST_F(SimpleTest, RepeatedFixedInt64MessageTest)
 
 TEST_F(SimpleTest, RepeatedSFixedIntMessageTest)
 {
-    const char* propertyName = "testRepeatedInt";
+    const char *propertyName = "testRepeatedInt";
     assertMessagePropertyRegistered<RepeatedSFixedIntMessage, sfixed32List>(1, "qtprotobuf::sfixed32List", propertyName);
 
     RepeatedSFixedIntMessage test;
@@ -625,7 +625,7 @@ TEST_F(SimpleTest, RepeatedSFixedIntMessageTest)
 
 TEST_F(SimpleTest, RepeatedSFixedInt64MessageTest)
 {
-    const char* propertyName = "testRepeatedInt";
+    const char *propertyName = "testRepeatedInt";
     assertMessagePropertyRegistered<RepeatedSFixedInt64Message, qtprotobuf::sfixed64List>(1, "qtprotobuf::sfixed64List", propertyName);
 
     RepeatedSFixedInt64Message test;
@@ -642,7 +642,7 @@ TEST_F(SimpleTest, RepeatedSFixedInt64MessageTest)
 
 TEST_F(SimpleTest, StepChildEnumMessageTest)
 {
-    const char* propertyName = "localStepChildEnum";
+    const char *propertyName = "localStepChildEnum";
     assertMessagePropertyRegistered<StepChildEnumMessage, SimpleEnumMessage::LocalEnum>(1, "qtprotobufnamespace::tests::SimpleEnumMessage::LocalEnum", propertyName);
 
     StepChildEnumMessage test;
@@ -653,7 +653,7 @@ TEST_F(SimpleTest, StepChildEnumMessageTest)
 
 TEST_F(SimpleTest, StepChildEnumListMessageTest)
 {
-    const char* propertyName = "localStepChildList";
+    const char *propertyName = "localStepChildList";
     assertMessagePropertyRegistered<StepChildEnumMessage, SimpleEnumMessage::LocalEnumList>(2, "qtprotobufnamespace::tests::SimpleEnumMessage::LocalEnumList", propertyName);
 
     SimpleEnumMessage::LocalEnumList value({SimpleEnumMessage::LOCAL_ENUM_VALUE2,
@@ -669,7 +669,7 @@ TEST_F(SimpleTest, StepChildEnumListMessageTest)
 
 TEST_F(SimpleTest, SimpleSInt32StringMapMessageTest)
 {
-    const char* propertyName = "mapField";
+    const char *propertyName = "mapField";
     assertMessagePropertyRegistered<SimpleSInt32StringMapMessage, SimpleSInt32StringMapMessage::MapFieldEntry>(1, "SimpleSInt32StringMapMessage::MapFieldEntry", propertyName);
 
     ASSERT_TRUE(QMetaType::isRegistered(qMetaTypeId<SimpleSInt32StringMapMessage::MapFieldEntry>()));
@@ -692,7 +692,7 @@ TEST_F(SimpleTest, SimpleSInt32StringMapMessageTest)
 
 TEST_F(SimpleTest, SimpleStringStringMapMessageTest)
 {
-    const char* propertyName = "mapField";
+    const char *propertyName = "mapField";
     assertMessagePropertyRegistered<SimpleStringStringMapMessage, SimpleStringStringMapMessage::MapFieldEntry>(13, "SimpleStringStringMapMessage::MapFieldEntry", propertyName);
 
     ASSERT_TRUE(QMetaType::isRegistered(qMetaTypeId<SimpleStringStringMapMessage::MapFieldEntry>()));