datacommsserver/esockserver/test/te_mecunittest/src/metaextensioncontainerspy.cpp
equal
deleted
inserted
replaced
|
1 // Copyright (c) 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 // metaextensioncontainerspy.cpp |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 */ |
|
21 |
|
22 #include "metaextensioncontainerspy.h" |
|
23 |
|
24 TUint32 TMetaExtensionContainerSpy::ChainLength(const ESock::RMetaExtensionContainerC& aMec) |
|
25 { |
|
26 ASSERT(aMec.Container()); |
|
27 ASSERT(aMec.Container()->Type() == ESock::CMetaExtensionContainerImplBase::EMetaExtensionContainer); |
|
28 const ESock::CMetaExtensionContainer* mecImpl = static_cast<const ESock::CMetaExtensionContainer*>(aMec.Container()); |
|
29 TUint32 length = 0; |
|
30 while (mecImpl) |
|
31 { |
|
32 ++length; |
|
33 if (mecImpl->iBaseContainer |
|
34 && mecImpl->iBaseContainer->Type() == ESock::CMetaExtensionContainerImplBase::EMetaExtensionContainer) |
|
35 { |
|
36 mecImpl = static_cast<const ESock::CMetaExtensionContainer*>(mecImpl->iBaseContainer); |
|
37 } |
|
38 else |
|
39 { |
|
40 mecImpl = NULL; |
|
41 } |
|
42 } |
|
43 |
|
44 return length; |
|
45 } |
|
46 |