My Project
Classes | Public Types | Public Member Functions | List of all members
NPL::IAutoUpdaterClient Class Referenceabstract

auto updater interface. More...

#include <AutoUpdaterClient.h>

Inheritance diagram for NPL::IAutoUpdaterClient:
NPL::CAutoUpdaterClient

Classes

class  IAutoUpdaterCallback
 progress call back. More...
 
struct  ProgressMessage
 progress message More...
 

Public Types

enum  AutoUpdaterProgress {
  AUP_NOT_STARTED, AUP_STARTED, AUP_NOCHANGE, AUP_UNKNOWN,
  AUP_BROKENFILE, AUP_ERROR, AUP_PROGRESS, AUP_COMPLETED,
  AUP_DO_APPLY_PATCH
}
 auto update progress
 

Public Member Functions

virtual void SetUpdaterDllPath (const char *sDllPath=NULL)=0
 set the autoupdater.dll file path More...
 
virtual void OnProgress (AutoUpdaterProgress eventType, const char *msg=NULL, int finishcount=0, int allcount=0)=0
 This function is called for update progress.
 
virtual int BeginUpdate (const std::string &curVersion, const char *sUpdaterName=NULL)=0
 start updating the client in the current working directory. More...
 
virtual void ActivateAutoUpdater (const std::string &sMsg)=0
 call the auto updater. More...
 
virtual void OnMessageCallback (NPLInterface::NPLObjectProxy &msg)=0
 this function is called whenever we receive a message from autoupdater.dll
 
virtual AutoUpdaterProgress WaitForCompletion (IAutoUpdaterCallback *pCallback=0)=0
 this function returns until auto updater is finished. More...
 
virtual bool GetUpdaterMessage (ProgressMessage &msg)=0
 Get a progress message from the queue. More...
 
virtual bool PeekUpdaterMessage (ProgressMessage &msg)=0
 Peek a progress message from the queue. More...
 
virtual void ExitUpdater ()=0
 join all threads and unload dll. More...
 
virtual void ApplyPatch ()=0
 apply the recently downloaded patch
 

Detailed Description

auto updater interface.

Member Function Documentation

§ ActivateAutoUpdater()

virtual void NPL::IAutoUpdaterClient::ActivateAutoUpdater ( const std::string &  sMsg)
pure virtual

call the auto updater.

Implemented in NPL::CAutoUpdaterClient.

§ BeginUpdate()

virtual int NPL::IAutoUpdaterClient::BeginUpdate ( const std::string &  curVersion,
const char *  sUpdaterName = NULL 
)
pure virtual

start updating the client in the current working directory.

Parameters
curVersion0 is forcing full update, -1 is using the current version in the current working directory. or a version number like "0.2.70"
sUpdaterNamewe will keep temporary download file under update/[sUpdaterName]/[version] directory. if this is NULL, we will use the default name "web"
Returns
: S_OK if succeed, or E_FAIL.

Implemented in NPL::CAutoUpdaterClient.

§ ExitUpdater()

virtual void NPL::IAutoUpdaterClient::ExitUpdater ( )
pure virtual

join all threads and unload dll.

This function is automatically called when the interface is cleaned up.

Implemented in NPL::CAutoUpdaterClient.

§ GetUpdaterMessage()

virtual bool NPL::IAutoUpdaterClient::GetUpdaterMessage ( ProgressMessage msg)
pure virtual

Get a progress message from the queue.

This function will block until a message arrive, much like the Win32 API.

Implemented in NPL::CAutoUpdaterClient.

§ PeekUpdaterMessage()

virtual bool NPL::IAutoUpdaterClient::PeekUpdaterMessage ( ProgressMessage msg)
pure virtual

Peek a progress message from the queue.

This function will return false if there is no message in the queue, much like the Win32 API.

Implemented in NPL::CAutoUpdaterClient.

§ SetUpdaterDllPath()

virtual void NPL::IAutoUpdaterClient::SetUpdaterDllPath ( const char *  sDllPath = NULL)
pure virtual

set the autoupdater.dll file path

Parameters
sDllPathif not set, it will default to "AutoUpdater.dll" in the current working directory.

Implemented in NPL::CAutoUpdaterClient.

§ WaitForCompletion()

virtual AutoUpdaterProgress NPL::IAutoUpdaterClient::WaitForCompletion ( IAutoUpdaterCallback pCallback = 0)
pure virtual

this function returns until auto updater is finished.

One can use GetMessage() and PeekMessage() instead of this function.

Parameters
pCallbackthe caller can implement the interface. The callback will be called in the main thread. So there is no threading issues. return the last progress message.

Implemented in NPL::CAutoUpdaterClient.


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