|
1 // Copyright (c) 2010 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 // Tier Manager |
|
15 // (management plane) |
|
16 // |
|
17 // |
|
18 // This is a 3-plane comms layer implementation example, which has been customised to be a test layer which gobbles and releases ESOCK MBUFs. |
|
19 // The MBuf gobbling functionality can be disabled by undefining the macro SYMBIAN_COMMSFW_MBUF_GOBBLER which is specified in mbufgobblerproviders.mmp. |
|
20 // When SYMBIAN_COMMSFW_MBUF_GOBBLER is undefined, the source code specified by mbufgobblerproviders.mmp becomes a pass through layer i.e. it passes the data |
|
21 // through to the layer above or below without altering it. This makes it useful as a starting point for implementing your own layers / providers; |
|
22 // useful documentation on how to customise your own passthrough layer can be found in ..\docs\MbufGobblerLayer.doc |
|
23 // |
|
24 |
|
25 /** |
|
26 @file |
|
27 @internalComponent |
|
28 */ |
|
29 |
|
30 #include "mbufgobblertiermanager.h" |
|
31 #include "mbufgobblertiermanageractivities.h" |
|
32 #include "mbufgobblerlog.h" |
|
33 #include "mbufgobblertestflags.h" |
|
34 |
|
35 #include <comms-infras/coretiermanageractivities.h> |
|
36 |
|
37 #include "mbufgobblerproviderselector.h" |
|
38 |
|
39 _LIT8(KNodeName, "CMbufGobblerTierManager"); |
|
40 |
|
41 CMbufGobblerTierManager* CMbufGobblerTierManager::NewL(ESock::CTierManagerFactoryBase& aFactory) |
|
42 { |
|
43 CMbufGobblerTierManager* self = new (ELeave) CMbufGobblerTierManager(aFactory); |
|
44 CleanupStack::PushL(self); |
|
45 self->ConstructL(); |
|
46 CleanupStack::Pop(self); |
|
47 return self; |
|
48 } |
|
49 |
|
50 CMbufGobblerTierManager::CMbufGobblerTierManager(ESock::CTierManagerFactoryBase& aFactory) |
|
51 : CCoreTierManager(aFactory,MbufGobblerTMActivities::MbufGobblerTMActivitiesMap::Self()) |
|
52 { |
|
53 MBUFGOBBLER_LOG_NODE_CREATE(KMbufGobblerTierSubTag, CMbufGobblerTierManager, KNodeName, this->NodeId().Ptr()); |
|
54 } |
|
55 |
|
56 void CMbufGobblerTierManager::ConstructL() |
|
57 { |
|
58 CCoreTierManager::ConstructL(); |
|
59 MBUFGOBBLER_TEST_DATA_INIT |
|
60 MBUFGOBBLER_TEST_POINT(KTierUp,KErrNone) |
|
61 } |
|
62 |
|
63 CMbufGobblerTierManager::~CMbufGobblerTierManager() |
|
64 { |
|
65 MBUFGOBBLER_LOG_NODE_DESTROY(KMbufGobblerTierSubTag, CMbufGobblerTierManager, KNodeName, this->NodeId().Ptr()); |
|
66 } |
|
67 |
|
68 ESock::MProviderSelector* CMbufGobblerTierManager::DoCreateProviderSelectorL(const Meta::SMetaData& aSelectionPreferences) |
|
69 { |
|
70 return CMbufGobblerProviderSelector::NewL(aSelectionPreferences); |
|
71 } |
|
72 |
|
73 void CMbufGobblerTierManager::ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage) |
|
74 { |
|
75 LOGMESSAGE(KMbufGobblerTierSubTag, KNodeName, this, aSender, aRecipient, aMessage); |
|
76 LOG_NODE_INFO(KMbufGobblerTierSubTag, KNodeName, *this, iClientCount); |
|
77 MeshMachine::TNodeContext<CMbufGobblerTierManager> ctx(*this, aMessage, aSender, aRecipient); |
|
78 CCoreTierManager::Received(ctx); |
|
79 User::LeaveIfError(ctx.iReturn); |
|
80 } |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |