Merge branch 'master' into jwi-bcc64xsingletonwarning
[ACE_TAO.git] / ACE / apps / JAWS2 / JAWS / Policy.h
blobc7c234c8bf738336363579ade30e48e9ef8dc045
1 /* -*- c++ -*- */
2 #ifndef JAWS_POLICY_H
3 #define JAWS_POLICY_H
5 #include "JAWS/Export.h"
6 #include "JAWS/Concurrency.h"
8 class JAWS_IO;
9 class JAWS_IO_Handler;
10 class JAWS_IO_Handler_Factory;
12 /**
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
20 public:
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
39 public:
40 JAWS_Default_Dispatch_Policy ();
41 virtual ~JAWS_Default_Dispatch_Policy ();
43 virtual int ratio ();
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);
55 private:
56 int ratio_;
57 JAWS_Concurrency_Base *concurrency_;
58 JAWS_IO_Handler_Factory *ioh_factory_;
59 JAWS_IO_Acceptor *acceptor_;
60 JAWS_IO *io_;
63 #endif /* !defined (JAWS_POLICY_H) */