File: fgactioni.h

package info (click to toggle)
ftpgrab 0.1.2r-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 376 kB
  • ctags: 335
  • sloc: cpp: 2,790; makefile: 26
file content (31 lines) | stat: -rw-r--r-- 799 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _FGACTIONI_H
#define _FGACTIONI_H

// fgactioni.h
//
// FGActionInterface
//
// Interface to individual actions e.g. "get" "delete" etc.
// Very simple :-)

class FGConnectionInterface;

class FGActionInterface {
public:
  // Need virtual destructor for the mm
  virtual ~FGActionInterface();

  // Non-virtual method which basically delegates to VirtualDo() but
  // handles exceptions by automatically calling abort and re-throwing
  void Do(void) const;

  virtual void VirtualDo(void) const = 0;

  // Abort: called if operation exits abnormally
  // Example: we are downloading a file when we lose the connection. In
  // this case we call Abort() and the specific cleanup is to delete the
  // partially downloaded file
  virtual void Abort(void) const = 0;
};

#endif // _FGACTIONI_H