Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. can any body explain what is meaning of below statment

can any body explain what is meaning of below statment

Scheduled Pinned Locked Moved Solved C++ Gurus
9 Posts 4 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by Qt embedded developer
    #1

    commerceResult = commerce->getPlatForm()->requestPaymentAsync(txnContext);

    i want to understand what happen sequence wise function call. which function get first executed.

    i have not used this types of function call any where. i want to know concept about it.

    JonBJ 1 Reply Last reply
    0
    • Q Qt embedded developer

      @jsulm means commerce->getPlatForm() will particular class pointer object which can call its member member function like platform->requestPaymentAsync(txnContext);

      am i right ?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #8

      @Qt-embedded-developer commerce->getPlatForm() returns a pointer to an object. Then requestPaymentAsync(txnContext) is called on this object (via the returned pointer). Nothing special, really.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • Q Qt embedded developer

        commerceResult = commerce->getPlatForm()->requestPaymentAsync(txnContext);

        i want to understand what happen sequence wise function call. which function get first executed.

        i have not used this types of function call any where. i want to know concept about it.

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #2

        @Qt-embedded-developer said in can any body explain what is meaning of below statment:

        i want to understand what happen sequence wise function call. which function get first executed.

        What do you mean by this?

        commerce->getPlatForm() gets executed right now. And function requestPaymentAsync() gets executed right now too.

        The requestPaymentAsync(), guessing by its name, starts some asynchronous (thread?) operation? Maybe commerceResult is not the actual result yet, it's a "handle" which can be used later to get the result when it's available. Like QFuture and "Promises"...?

        Q 1 Reply Last reply
        0
        • JonBJ JonB

          @Qt-embedded-developer said in can any body explain what is meaning of below statment:

          i want to understand what happen sequence wise function call. which function get first executed.

          What do you mean by this?

          commerce->getPlatForm() gets executed right now. And function requestPaymentAsync() gets executed right now too.

          The requestPaymentAsync(), guessing by its name, starts some asynchronous (thread?) operation? Maybe commerceResult is not the actual result yet, it's a "handle" which can be used later to get the result when it's available. Like QFuture and "Promises"...?

          Q Offline
          Q Offline
          Qt embedded developer
          wrote on last edited by
          #3

          @JonB i want to understand meaning of this line? What happens first ?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

            Hi,

            It's executed left to right.

            getPlatform() returns a pointer to some object.
            requestPaymentAsync is immediately called on said object.
            The result of that method is stored in commerceResult.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            Q 1 Reply Last reply
            1
            • SGaistS SGaist

              Hi,

              It's executed left to right.

              getPlatform() returns a pointer to some object.
              requestPaymentAsync is immediately called on said object.
              The result of that method is stored in commerceResult.

              Q Offline
              Q Offline
              Qt embedded developer
              wrote on last edited by
              #5

              @SGaist Thanks for explaining.

              can any body tell me which c++ concept will help me to understand this types of statement ?

              jsulmJ 1 Reply Last reply
              0
              • Q Qt embedded developer

                @SGaist Thanks for explaining.

                can any body tell me which c++ concept will help me to understand this types of statement ?

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by jsulm
                #6

                @Qt-embedded-developer said in can any body explain what is meaning of below statment:

                can any body tell me which c++ concept will help me to understand this types of statement ?

                Method calling on a pointer to object...

                SomeClass *obj = new SomeClass();
                obj->someMethod();
                

                The line you were asking can also be written as:

                auto platform = commerce->getPlatForm();
                commerceResult = platform->requestPaymentAsync(txnContext);
                

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                Q 1 Reply Last reply
                3
                • jsulmJ jsulm

                  @Qt-embedded-developer said in can any body explain what is meaning of below statment:

                  can any body tell me which c++ concept will help me to understand this types of statement ?

                  Method calling on a pointer to object...

                  SomeClass *obj = new SomeClass();
                  obj->someMethod();
                  

                  The line you were asking can also be written as:

                  auto platform = commerce->getPlatForm();
                  commerceResult = platform->requestPaymentAsync(txnContext);
                  
                  Q Offline
                  Q Offline
                  Qt embedded developer
                  wrote on last edited by
                  #7

                  @jsulm means commerce->getPlatForm() will particular class pointer object which can call its member member function like platform->requestPaymentAsync(txnContext);

                  am i right ?

                  jsulmJ JonBJ 2 Replies Last reply
                  0
                  • Q Qt embedded developer

                    @jsulm means commerce->getPlatForm() will particular class pointer object which can call its member member function like platform->requestPaymentAsync(txnContext);

                    am i right ?

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #8

                    @Qt-embedded-developer commerce->getPlatForm() returns a pointer to an object. Then requestPaymentAsync(txnContext) is called on this object (via the returned pointer). Nothing special, really.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    2
                    • Q Qt embedded developer

                      @jsulm means commerce->getPlatForm() will particular class pointer object which can call its member member function like platform->requestPaymentAsync(txnContext);

                      am i right ?

                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote on last edited by
                      #9

                      @Qt-embedded-developer
                      Not sure what your issue/lack of understanding is here.

                      In C++ any expression like a->b.c->d().e()->f or similar is simply evaluated left-to-right, one element at a time. How else but that could it be done? So that's all you have to think of.

                      1 Reply Last reply
                      2

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved