Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VsnetDownload::Client::Notify_f Class Reference

#include <vsnet_notify.h>

Inheritance diagram for VsnetDownload::Client::Notify_f:
VsnetDownload::Client::Notify

Public Types

typedef void(* NotifyFunction )(std::string str, State s, VSError e, int total, int offset)
 

Public Member Functions

 Notify_f (std::string filename, NotifyFunction fun)
 
virtual ~Notify_f ()
 
virtual void notify (State s, VSError e)
 
virtual void setTotalBytes (int sz)
 
virtual void addBytes (int sz)
 

Detailed Description

Definition at line 388 of file vsnet_notify.h.

Member Typedef Documentation

typedef void(* VsnetDownload::Client::Notify_f::NotifyFunction)(std::string str, State s, VSError e, int total, int offset)

Definition at line 391 of file vsnet_notify.h.

Constructor & Destructor Documentation

VsnetDownload::Client::Notify_f::Notify_f ( std::string  filename,
NotifyFunction  fun 
)

Definition at line 342 of file vsnet_notify.cpp.

342  :
343  _filename( filename )
344  , _fun( fun )
345  , _total( 0 )
346  , _offset( 0 )
347 {}
VsnetDownload::Client::Notify_f::~Notify_f ( )
virtual

Definition at line 349 of file vsnet_notify.cpp.

350 {}

Member Function Documentation

void VsnetDownload::Client::Notify_f::addBytes ( int  sz)
virtual

Reimplemented from VsnetDownload::Client::Notify.

Definition at line 362 of file vsnet_notify.cpp.

363 {
364  _offset += sz;
365 }
void VsnetDownload::Client::Notify_f::notify ( State  s,
VSError  e 
)
virtual

Implements VsnetDownload::Client::Notify.

Definition at line 352 of file vsnet_notify.cpp.

353 {
354  (*_fun)(_filename, s, e, _total, _offset);
355 }
void VsnetDownload::Client::Notify_f::setTotalBytes ( int  sz)
virtual

Reimplemented from VsnetDownload::Client::Notify.

Definition at line 357 of file vsnet_notify.cpp.

358 {
359  _total = sz;
360 }

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