Easemob Windows SDK
Public Types | Public Member Functions | List of all members
easemob::EMCallback Class Reference
Collaboration diagram for easemob::EMCallback:
Collaboration graph

Public Types

typedef std::function< bool()> EMSuccessCallback
 
typedef std::function< void(int)> EMProgressCallback
 
typedef std::function< bool(const easemob::EMErrorPtr)> EMFailCallback
 

Public Member Functions

 EMCallback (const EMCallbackObserverHandle &handle, const EMSuccessCallback success=[]() ->bool{ return false;}, const EMFailCallback fail=[](const easemob::EMErrorPtr) ->bool{ return false;}, const EMProgressCallback progress=[](int){})
 Callback's constructor. More...
 
virtual ~EMCallback ()
 Callback's destructor. More...
 
virtual bool onSuccess ()
 The success callback of async method. More...
 
virtual bool onFail (const EMErrorPtr error)
 The fail callback of async method. More...
 
virtual void onProgress (int progress)
 The progress callback of async method. More...
 

Constructor & Destructor Documentation

§ EMCallback()

easemob::EMCallback::EMCallback ( const EMCallbackObserverHandle handle,
const EMSuccessCallback  success = []()->bool{ return false; },
const EMFailCallback  fail = [](const easemob::EMErrorPtr)->bool{ return false; },
const EMProgressCallback  progress = [](int){} 
)
inline

Callback's constructor.

Parameters
Callbackovserver handle.
Successcallback.
Failcallback.
Progresscallback.
Returns
NA

§ ~EMCallback()

virtual easemob::EMCallback::~EMCallback ( )
inlinevirtual

Callback's destructor.

Parameters
NA
Returns
NA

Member Function Documentation

§ onFail()

virtual bool easemob::EMCallback::onFail ( const EMErrorPtr  error)
inlinevirtual

The fail callback of async method.

Note: SDK usually notify user by a global listener if this method return false.

Parameters
Theerror.
Returns
Whether callback has been completely processed.

§ onProgress()

virtual void easemob::EMCallback::onProgress ( int  progress)
inlinevirtual

The progress callback of async method.

Parameters
Theprogress.
Returns
NA

§ onSuccess()

virtual bool easemob::EMCallback::onSuccess ( )
inlinevirtual

The success callback of async method.

Note: SDK usually notify user by a global listener if this method return false.

Parameters
NA
Returns
Whether callback has been completely processed.

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