5 #include "JAWS/Export.h"
6 #include "JAWS/Concurrency.h"
10 class JAWS_IO_Handler_Factory
;
13 * Policy mechanism for choosing different concurrency models.
15 * Given some (unspecified) state, decides what the concurrency
16 * model should be. (For now, we always return the same model.)
18 class JAWS_Export JAWS_Dispatch_Policy
21 JAWS_Dispatch_Policy ();
22 virtual ~JAWS_Dispatch_Policy ();
24 virtual int ratio () = 0;
25 virtual JAWS_IO
* io () = 0;
26 virtual JAWS_IO_Handler_Factory
*ioh_factory () = 0;
27 virtual JAWS_IO_Acceptor
*acceptor () = 0;
28 virtual JAWS_Concurrency_Base
* concurrency () = 0;
30 virtual void ratio (int r
) = 0;
31 virtual void io (JAWS_IO
*iop
) = 0;
32 virtual void ioh_factory (JAWS_IO_Handler_Factory
*factoryp
) = 0;
33 virtual void acceptor (JAWS_IO_Acceptor
*acceptorp
) = 0;
34 virtual void concurrency (JAWS_Concurrency_Base
*concp
) = 0;
37 class JAWS_Export JAWS_Default_Dispatch_Policy
: public JAWS_Dispatch_Policy
40 JAWS_Default_Dispatch_Policy ();
41 virtual ~JAWS_Default_Dispatch_Policy ();
44 virtual JAWS_IO
*io ();
45 virtual JAWS_IO_Handler_Factory
*ioh_factory ();
46 virtual JAWS_IO_Acceptor
*acceptor ();
47 virtual JAWS_Concurrency_Base
*concurrency ();
49 virtual void ratio (int r
);
50 virtual void io (JAWS_IO
*iop
);
51 virtual void ioh_factory (JAWS_IO_Handler_Factory
*factoryp
);
52 virtual void acceptor (JAWS_IO_Acceptor
*acceptorp
);
53 virtual void concurrency (JAWS_Concurrency_Base
*concp
);
57 JAWS_Concurrency_Base
*concurrency_
;
58 JAWS_IO_Handler_Factory
*ioh_factory_
;
59 JAWS_IO_Acceptor
*acceptor_
;
63 #endif /* !defined (JAWS_POLICY_H) */