121 { |
121 { |
122 CItem* item = iItems[ aIndex ]; |
122 CItem* item = iItems[ aIndex ]; |
123 return TPtrC( item->Combined() ); |
123 return TPtrC( item->Combined() ); |
124 } |
124 } |
125 |
125 |
|
126 EXPORT_C TPtrC CMemSpyThreadInfoItemBase::Caption(TInt aIndex ) const |
|
127 { |
|
128 CItem* item = iItems[ aIndex ]; |
|
129 return TPtrC( item->Caption() ); |
|
130 } |
|
131 |
|
132 EXPORT_C TPtrC CMemSpyThreadInfoItemBase::Value(TInt aIndex ) const |
|
133 { |
|
134 CItem* item = iItems[ aIndex ]; |
|
135 return TPtrC( item->Value() ); |
|
136 } |
126 |
137 |
127 EXPORT_C CMemSpyEngine& CMemSpyThreadInfoItemBase::Engine() const |
138 EXPORT_C CMemSpyEngine& CMemSpyThreadInfoItemBase::Engine() const |
128 { |
139 { |
129 return iContainer.Engine(); |
140 return iContainer.Engine(); |
130 } |
141 } |
1689 #ifdef _DEBUG |
1700 #ifdef _DEBUG |
1690 RDebug::Print( _L("CMemSpyThreadInfoSession::ConnectionCount() - START - aName: %S"), &aName ); |
1701 RDebug::Print( _L("CMemSpyThreadInfoSession::ConnectionCount() - START - aName: %S"), &aName ); |
1691 #endif |
1702 #endif |
1692 |
1703 |
1693 // See if we have an entry with that name... |
1704 // See if we have an entry with that name... |
|
1705 TInt foundIndex = 0; |
|
1706 TRAP(ret, foundIndex = FindServerL(aName)); |
|
1707 |
|
1708 if (ret == KErrNone) |
|
1709 { |
|
1710 // If we did, get the count |
|
1711 if ( foundIndex >=0 && foundIndex < iServerNames.Count() ) |
|
1712 { |
|
1713 ret = iServerNames[ foundIndex ]->iCount; |
|
1714 } |
|
1715 } |
|
1716 |
|
1717 #ifdef _DEBUG |
|
1718 RDebug::Printf( "CMemSpyThreadInfoSession::ConnectionCount() - END - ret: %d", ret ); |
|
1719 #endif |
|
1720 // |
|
1721 return ret; |
|
1722 } |
|
1723 |
|
1724 TInt CMemSpyThreadInfoSession::FindServerL( const TDesC& aName ) const |
|
1725 { |
1694 TIdentityRelation<CSessionInfoEntry> comparer( CompareEntries ); |
1726 TIdentityRelation<CSessionInfoEntry> comparer( CompareEntries ); |
1695 HBufC* name = aName.AllocLC(); |
1727 HBufC* name = aName.AllocLC(); |
1696 CSessionInfoEntry* entry = new(ELeave) CSessionInfoEntry( name ); |
1728 CSessionInfoEntry* entry = new(ELeave) CSessionInfoEntry( name ); |
1697 CleanupStack::Pop( name ); |
1729 CleanupStack::Pop( name ); // don't destroy it as name is now owned by entry |
1698 CleanupStack::PushL( entry ); |
1730 CleanupStack::PushL( entry ); |
1699 const TInt foundIndex = iServerNames.Find( entry, comparer ); |
1731 const TInt foundIndex = iServerNames.Find( entry, comparer ); |
|
1732 User::LeaveIfError(foundIndex); // so we only return a real index |
1700 CleanupStack::PopAndDestroy( entry ); |
1733 CleanupStack::PopAndDestroy( entry ); |
1701 |
1734 return foundIndex; |
1702 // If we did, get the count |
1735 } |
1703 if ( foundIndex >=0 && foundIndex < iServerNames.Count() ) |
|
1704 { |
|
1705 ret = iServerNames[ foundIndex ]->iCount; |
|
1706 } |
|
1707 // |
|
1708 #ifdef _DEBUG |
|
1709 RDebug::Printf( "CMemSpyThreadInfoSession::ConnectionCount() - END - ret: %d", ret ); |
|
1710 #endif |
|
1711 // |
|
1712 return ret; |
|
1713 } |
|
1714 |
|
1715 |
1736 |
1716 void CMemSpyThreadInfoSession::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& aItem, TInt /*aRefCount*/, TDes& aFullName ) |
1737 void CMemSpyThreadInfoSession::HandleContainerItemL( TMemSpyDriverHandleInfoGeneric& aItem, TInt /*aRefCount*/, TDes& aFullName ) |
1717 { |
1738 { |
1718 // Check whether we have the item already? |
1739 // Check whether we have the item already |
1719 TIdentityRelation<CSessionInfoEntry> comparer( CompareEntries ); |
1740 TIdentityRelation<CSessionInfoEntry> comparer( CompareEntries ); |
1720 |
1741 |
1721 // Prepare object, just in case we don't find it... |
1742 // Prepare object, just in case we don't find it... |
1722 HBufC* name = aFullName.AllocLC(); |
1743 HBufC* name = aFullName.AllocLC(); |
1723 |
1744 |