blob: 0d4b6f3d6062adea81be8c056a707217f010c468 (
plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
/* -*- c++ -*- */
#ifndef JAWS_POLICY_H
#define JAWS_POLICY_H
#include "JAWS/Export.h"
#include "JAWS/Concurrency.h"
class JAWS_IO;
class JAWS_IO_Handler;
class JAWS_IO_Handler_Factory;
/**
* Policy mechanism for choosing different concurrency models.
*
* Given some (unspecified) state, decides what the concurrency
* model should be. (For now, we always return the same model.)
*/
class JAWS_Export JAWS_Dispatch_Policy
{
public:
JAWS_Dispatch_Policy (void);
virtual ~JAWS_Dispatch_Policy (void);
virtual int ratio (void) = 0;
virtual JAWS_IO * io (void) = 0;
virtual JAWS_IO_Handler_Factory *ioh_factory (void) = 0;
virtual JAWS_IO_Acceptor *acceptor (void) = 0;
virtual JAWS_Concurrency_Base * concurrency (void) = 0;
virtual void ratio (int r) = 0;
virtual void io (JAWS_IO *iop) = 0;
virtual void ioh_factory (JAWS_IO_Handler_Factory *factoryp) = 0;
virtual void acceptor (JAWS_IO_Acceptor *acceptorp) = 0;
virtual void concurrency (JAWS_Concurrency_Base *concp) = 0;
};
class JAWS_Export JAWS_Default_Dispatch_Policy : public JAWS_Dispatch_Policy
{
public:
JAWS_Default_Dispatch_Policy (void);
virtual ~JAWS_Default_Dispatch_Policy (void);
virtual int ratio (void);
virtual JAWS_IO *io (void);
virtual JAWS_IO_Handler_Factory *ioh_factory (void);
virtual JAWS_IO_Acceptor *acceptor (void);
virtual JAWS_Concurrency_Base *concurrency (void);
virtual void ratio (int r);
virtual void io (JAWS_IO *iop);
virtual void ioh_factory (JAWS_IO_Handler_Factory *factoryp);
virtual void acceptor (JAWS_IO_Acceptor *acceptorp);
virtual void concurrency (JAWS_Concurrency_Base *concp);
private:
int ratio_;
JAWS_Concurrency_Base *concurrency_;
JAWS_IO_Handler_Factory *ioh_factory_;
JAWS_IO_Acceptor *acceptor_;
JAWS_IO *io_;
};
#endif /* !defined (JAWS_POLICY_H) */
|