1 martin 1.57 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.58 //
|
3 martin 1.57 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.58 //
|
10 martin 1.57 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.58 //
|
17 martin 1.57 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.58 //
|
20 martin 1.57 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.58 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.57 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.58 //
|
28 martin 1.57 //////////////////////////////////////////////////////////////////////////
|
29 mday 1.1 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
|
32 kumpf 1.49 #ifndef Pegasus_ModuleController_h
33 #define Pegasus_ModuleController_h
|
34 mday 1.1
35 #include <Pegasus/Common/Config.h>
|
36 kumpf 1.49 #include <Pegasus/Common/Linkage.h>
|
37 mday 1.19 #include <Pegasus/Common/Constants.h>
|
38 kumpf 1.49 #include <Pegasus/Common/List.h>
|
39 mday 1.1 #include <Pegasus/Common/Message.h>
|
40 kumpf 1.49 #include <Pegasus/Common/MessageQueueService.h>
|
41 mday 1.1 #include <Pegasus/Common/AsyncOpNode.h>
|
42 david.dillard 1.42 #include <Pegasus/Common/AutoPtr.h>
|
43 mday 1.11
|
44 mday 1.1 PEGASUS_NAMESPACE_BEGIN
45
|
46 kumpf 1.49 class PEGASUS_COMMON_LINKAGE RegisteredModuleHandle : public Linkable
|
47 mday 1.9 {
|
48 david.dillard 1.42 public:
|
49 kumpf 1.49 RegisteredModuleHandle(
50 const String& name,
51 void* module_address,
|
52 venkat.puvvada 1.56 Message* (*receive_message)(Message *, void *));
|
53 david.dillard 1.42
|
54 kumpf 1.49 virtual ~RegisteredModuleHandle();
|
55 david.dillard 1.42
|
56 kumpf 1.51 const String& get_name() const;
|
57 david.dillard 1.42
58 private:
59
|
60 kumpf 1.49 RegisteredModuleHandle();
61 RegisteredModuleHandle(const RegisteredModuleHandle&);
62 RegisteredModuleHandle& operator=(const RegisteredModuleHandle&);
63
64 Message* _receive_message(Message* msg);
65 String _name;
66 void* _module_address;
67 Message* (*_module_receive_message)(Message *, void *);
|
68 david.dillard 1.42
69 friend class ModuleController;
|
70 mday 1.5 };
|
71 mday 1.4
72
|
73 mday 1.1 class PEGASUS_COMMON_LINKAGE ModuleController : public MessageQueueService
74 {
|
75 david.dillard 1.42 public:
76 typedef MessageQueueService Base;
77 ModuleController(const char *name);
78
79 ~ModuleController();
80
|
81 venkat.puvvada 1.56 void register_module(
|
82 kumpf 1.49 const String& module_name,
83 void* module_address,
|
84 venkat.puvvada 1.56 Message* (*receive_message)(Message *, void *));
|
85 david.dillard 1.42
|
86 kumpf 1.47 static ModuleController* getModuleController();
|
87 david.dillard 1.42
88 // send a message to another service
|
89 kumpf 1.49 AsyncReply* ClientSendWait(
90 Uint32 destination_q,
91 AsyncRequest* request);
|
92 david.dillard 1.42
|
93 kumpf 1.47 Boolean ClientSendForget(
|
94 kumpf 1.49 Uint32 destination_q,
95 AsyncRequest* message);
|
96 david.dillard 1.42
97 protected:
98 // ATTN-RK-P2-20010322: These methods are pure virtual in superclass
99 virtual void handleEnqueue() {}
100 virtual void handleEnqueue(Message *) {}
101 virtual void _handle_async_request(AsyncRequest *rq);
102 virtual void _handle_async_callback(AsyncOpNode *op);
103
104 private:
|
105 venkat.puvvada 1.56 typedef List<RegisteredModuleHandle, Mutex> RegisteredModulesList;
106 RegisteredModulesList _modules;
|
107 mday 1.2 };
|
108 mday 1.35
|
109 mday 1.1 PEGASUS_NAMESPACE_END
110
|
111 kumpf 1.49 #endif // Pegasus_ModuleController_h
|