언어 설정

Menu
Sites
Language
How to use AppControlSignal().Connect n Native UI pplication with Dali

I am launching my app from my service app, so to detect that new launch request, i need to implement - AppControlSignal()

So I am writing this piece of code - 

class ClientController : public ConnectionTracker
{
public:
 
  ClientController( Application& application )
  : mApplication( application )
  {
    mApplication.InitSignal().Connect( this, &ClientController::Create );
    mApplication.ResumeSignal().Connect(this, &ClientController::Resume);
    mApplication.PauseSignal().Connect(this, &ClientController::Pause);
    mApplication.AppControlSignal().Connect(this ,&ClientController::AppControl);
 
  }
 
  ~ClientController()
  {
  dlog_print(DLOG_INFO, "Ankur", "ClientController");
  }
 
  void AppControl( Application& application )
      {
    dlog_print(DLOG_INFO, "Ankur", "Connect");
      }

 

 

But this is giving compilation error -

D:/Tizen/tools/smart-build-interface/../../platforms/tizen-4.0/mobile/rootstraps/mobile-4.0-emulator.core/usr/include\dali/public-api/signals/callback.h:698:5: error: called object type 'Dali::Signal<void (Dali::Application &, void *)> (ClientController::*)(Dali::Application &)' is not a function or function pointer

    (*object)( param1, param2 );

    ^~~~~~~~~

D:/Tizen/tools/smart-build-interface/../../platforms/tizen-4.0/mobile/rootstraps/mobile-4.0-emulator.core/usr/include\dali/public-api/signals/callback.h:1275:95: note: in instantiation of member function 'Dali::FunctorDispatcher2<Dali::Signal<void (Dali::Application &, void *)> (ClientController::*)(Dali::Application &), Dali::Application &, void *>::Dispatch' requested here

                  reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcher2<T,P1,P2>::Dispatch ),

                                                                                              ^

D:/Tizen/tools/smart-build-interface/../../platforms/tizen-4.0/mobile/rootstraps/mobile-4.0-emulator.core/usr/include/dali\public-api/signals/dali-signal.h:941:45: note: in instantiation of member function 'Dali::CallbackFunctor2<Dali::Signal<void (Dali::Application &, void *)> (ClientController::*)(Dali::Application &), Dali::Application &, void *>::CallbackFunctor2' requested here

    mImpl.OnConnect( connectionTracker, new CallbackFunctor2< X, Arg0, Arg1 >( func ) );

                                            ^

../src/main.cpp:44:37: note: in instantiation of function template specialization 'Dali::Signal<void (Dali::Application &, void *)>::Connect<Dali::Signal<void (Dali::Application &, void *)> (ClientController::*)(Dali::Application &)>' requested here

    mApplication.AppControlSignal().Connect(this,&ClientController::AppControl);

                                    ^

4 warnings and 1 error generated.

ninja: build stopped: subcommand failed.

Responses

1 댓글
K Johnson

So far I could understand, Connect() method signature for AppControlSignal() is different from the signature for InitSignal(). If you go through the declaration then you'll find that,

For InitSignal() it is like,

 void Connect( X* obj, void (X::*func)( Arg0 arg0 ) )
  {
    //related works.
  }

For AppControlSignal() it is like,

void Connect( ConnectionTrackerInterface* connectionTracker, const X& func )
  {
    //related works.
  }

In this scenario, I would like to suggest you to modify your below line of code accordingly.

 mApplication.AppControlSignal().Connect(this ,&ClientController::AppControl);