|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @publishedPartner |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef _SS_MMNODE_H_ |
|
23 #define _SS_MMNODE_H_ |
|
24 |
|
25 #include <comms-infras/ss_commsprov.h> |
|
26 #include <comms-infras/ss_nodeinterfaces.h> |
|
27 #include <elements/mm_node.h> |
|
28 |
|
29 namespace PRStates |
|
30 { |
|
31 class TStoreProvision; |
|
32 } |
|
33 |
|
34 namespace ESock |
|
35 { |
|
36 /** |
|
37 Aggregation base class for mesh-machine based nodes specifically for networking |
|
38 mesh of nodes |
|
39 */ |
|
40 class ACFMMNodeBase : public MeshMachine::AMMNodeBase |
|
41 { |
|
42 protected: |
|
43 /** |
|
44 @param aActivityMap Map of activities this node will be able to perform |
|
45 @param aNodeId Id of this node |
|
46 */ |
|
47 explicit ACFMMNodeBase(const MeshMachine::TNodeActivityMap& aActivityMap, const Messages::TNodeId& aNodeId) |
|
48 : MeshMachine::AMMNodeBase(aActivityMap, aNodeId) |
|
49 { |
|
50 } |
|
51 |
|
52 /** |
|
53 Fetch the interface control for a given interface id |
|
54 @param aInterfaceId Interface id to fetch control for. |
|
55 @return Pointer to the interface control |
|
56 */ |
|
57 IMPORT_C virtual NetInterfaces::TInterfaceControl* FetchNodeInterfaceControlL(TInt aInterfaceId); |
|
58 |
|
59 public: |
|
60 |
|
61 /** |
|
62 The method returns the one and only service provider. The method accepts that 'this' can be in relation with |
|
63 many EServProviders (e.g.: like MCPRs are), but only one of them is conceptually the chosen (active) |
|
64 EServProvider. The method will assume the chosen one is the (first) one marked with TCFClientType::EActive. |
|
65 */ |
|
66 Messages::RNodeInterface* ServiceProvider() const |
|
67 { |
|
68 return GetFirstClient<Messages::TDefaultClientMatchPolicy>(Messages::TClientType(TCFClientType::EServProvider, TCFClientType::EActive), |
|
69 Messages::TClientType(TCFClientType::EServProvider, Messages::TClientType::ELeaving)); |
|
70 } |
|
71 |
|
72 /** |
|
73 Return the control provider. The control providers sits to the right of a node, and manages the lifetime of the node. |
|
74 |
|
75 @return pointer to the node interface for the control provider, or NULL if there is no control provider |
|
76 */ |
|
77 Messages::RNodeInterface* ControlProvider() const |
|
78 { |
|
79 return GetFirstClient<Messages::TDefaultClientMatchPolicy>(Messages::TClientType(TCFClientType::ECtrlProvider)); |
|
80 } |
|
81 |
|
82 protected: |
|
83 /** |
|
84 Handle a message that has been delivered to the node, but not picked up by any activity. |
|
85 @param aContext context in which the message was received |
|
86 */ |
|
87 IMPORT_C virtual void HandlePassThroughMessage(MeshMachine::TNodeContextBase& aContext); |
|
88 }; |
|
89 |
|
90 class ACFMMNodeIdBase : public Messages::ASimpleNodeIdBase, public ACFMMNodeBase |
|
91 { |
|
92 protected: |
|
93 explicit ACFMMNodeIdBase(const MeshMachine::TNodeActivityMap& aActivityMap) |
|
94 : ASimpleNodeIdBase(), |
|
95 ACFMMNodeBase(aActivityMap, Messages::ANodeId::Id()) |
|
96 { |
|
97 } |
|
98 |
|
99 IMPORT_C virtual NetInterfaces::TInterfaceControl* FetchNodeInterfaceControlL(TInt aInterfaceId); |
|
100 |
|
101 //this needs to be here provisionally - subclasses complain about imbiguous access to ::Id() |
|
102 public: |
|
103 /** |
|
104 @return the node id of this node |
|
105 */ |
|
106 const Messages::TNodeId& Id() const |
|
107 { |
|
108 return NodeId(); |
|
109 } |
|
110 }; |
|
111 } //namespace Esock |
|
112 |
|
113 |
|
114 #endif |
|
115 //_SS_NODEACTIVITIES_H_ |
|
116 |