memspy/MemSpyClient/src/memspyapikernelobjectitem.cpp
branchRCL_3
changeset 59 8ad140f3dd41
parent 49 7fdc9a71d314
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include <memspy/api/memspyapikernelobjectitem.h>
       
    19 #include <memspy/driver/memspydriverobjectsshared.h>
       
    20 
       
    21 EXPORT_C CMemSpyApiKernelObjectItem::~CMemSpyApiKernelObjectItem()
       
    22 	{
       
    23 	delete iItem;
       
    24 	}
       
    25 
       
    26 
       
    27 CMemSpyApiKernelObjectItem::CMemSpyApiKernelObjectItem() : iItem(0)
       
    28 	{
       
    29 	}
       
    30 
       
    31 CMemSpyApiKernelObjectItem* CMemSpyApiKernelObjectItem::NewL(const TMemSpyDriverHandleInfoGeneric& aData)
       
    32 	{
       
    33 	CMemSpyApiKernelObjectItem* self = CMemSpyApiKernelObjectItem::NewLC(aData);
       
    34 	CleanupStack::Pop(self);
       
    35 	return (self);
       
    36 	}
       
    37 
       
    38 CMemSpyApiKernelObjectItem* CMemSpyApiKernelObjectItem::NewLC(const TMemSpyDriverHandleInfoGeneric& aData)
       
    39 	{
       
    40 	CMemSpyApiKernelObjectItem* self = new (ELeave) CMemSpyApiKernelObjectItem;
       
    41 	CleanupStack::PushL(self);
       
    42 	self->ConstructL(aData);
       
    43 	return (self);
       
    44 	}
       
    45 
       
    46 void CMemSpyApiKernelObjectItem::ConstructL(const TMemSpyDriverHandleInfoGeneric& aData)
       
    47 	{
       
    48 	iItem = new (ELeave) TMemSpyDriverHandleInfoGeneric(aData);
       
    49 	}
       
    50 
       
    51 EXPORT_C const TDesC8& CMemSpyApiKernelObjectItem::Name() const
       
    52 	{
       
    53 	/*
       
    54 	TBuf<KMaxName> ret;	
       
    55 	ret.Copy( iItem->iName );
       
    56 	return ret;
       
    57 	*/
       
    58 	return iItem->iName;
       
    59 	}
       
    60 
       
    61 EXPORT_C TAny* CMemSpyApiKernelObjectItem::Handle() const
       
    62 	{	
       
    63 	return iItem->iHandle;
       
    64 	}
       
    65 
       
    66 EXPORT_C TMemSpyDriverContainerType CMemSpyApiKernelObjectItem::Type() const
       
    67 	{
       
    68 	return iItem->iType;
       
    69 	}
       
    70 
       
    71 // For Process, thread, chunk (owning process id), server (owning thread id)
       
    72 EXPORT_C TInt CMemSpyApiKernelObjectItem::Id() const
       
    73 	{
       
    74 	return iItem->iId;
       
    75 	}
       
    76 
       
    77 // For Chunk, Library
       
    78 EXPORT_C TUint32 CMemSpyApiKernelObjectItem::Size() const
       
    79 	{
       
    80 	return iItem->iSize;
       
    81 	}
       
    82 
       
    83 // For Semaphore, Mutex, Server
       
    84 EXPORT_C TInt CMemSpyApiKernelObjectItem::Count() const
       
    85 	{
       
    86 	return iItem->iCount;
       
    87 	}
       
    88 
       
    89 // For Mutex
       
    90 EXPORT_C TInt CMemSpyApiKernelObjectItem::WaitCount() const
       
    91 	{
       
    92 	return iItem->iWaitCount;
       
    93 	}
       
    94 
       
    95 // For Server, Session
       
    96 EXPORT_C TIpcSessionType CMemSpyApiKernelObjectItem::SessionType() const
       
    97 	{
       
    98 	return iItem->iSessionType;
       
    99 	}
       
   100 
       
   101 // For Timer
       
   102 EXPORT_C TMemSpyDriverTimerType CMemSpyApiKernelObjectItem::TimerType() const
       
   103 	{
       
   104 	return iItem->iTimerType;
       
   105 	}
       
   106 
       
   107 EXPORT_C TMemSpyDriverTimerState CMemSpyApiKernelObjectItem::TimerState() const
       
   108 	{
       
   109 	return iItem->iTimerState;
       
   110 	}
       
   111 
       
   112 // For Logical channel
       
   113 EXPORT_C TInt CMemSpyApiKernelObjectItem::OpenChannels()
       
   114 	{
       
   115 	return iItem->iOpenChannels;
       
   116 	}
       
   117 
       
   118 // For most of the object types
       
   119 EXPORT_C const TDesC8& CMemSpyApiKernelObjectItem::NameDetail() const
       
   120 	{
       
   121 	/*
       
   122 	TBuf<KMaxName> ret;
       
   123 	ret.Copy( iItem->iNameDetail );
       
   124 	return ret;
       
   125 	*/
       
   126 	return iItem->iNameDetail;
       
   127 	}
       
   128 
       
   129 EXPORT_C TInt CMemSpyApiKernelObjectItem::AccessCount() const
       
   130 	{
       
   131 	return iItem->iAccessCount;
       
   132 	}
       
   133 
       
   134 EXPORT_C TInt CMemSpyApiKernelObjectItem::UniqueID() const
       
   135 	{
       
   136 	return iItem->iUniqueID;
       
   137 	}
       
   138 
       
   139 EXPORT_C TUint CMemSpyApiKernelObjectItem::Protection() const
       
   140 	{
       
   141 	return iItem->iProtection;
       
   142 	}
       
   143 		
       
   144 EXPORT_C TUint8* CMemSpyApiKernelObjectItem::AddressOfKernelOwner()
       
   145 	{
       
   146 	return iItem->iAddressOfKernelOwner;
       
   147 	}
       
   148 
       
   149 EXPORT_C TInt CMemSpyApiKernelObjectItem::Priority() const
       
   150 	{
       
   151 	return iItem->iPriority;
       
   152 	}
       
   153 
       
   154 EXPORT_C TUint8* CMemSpyApiKernelObjectItem::AddressOfOwningProcess()
       
   155 	{
       
   156 	return iItem->iAddressOfOwningProcess;
       
   157 	}
       
   158 
       
   159 EXPORT_C TUint CMemSpyApiKernelObjectItem::CreatorId() const
       
   160 	{
       
   161 	return iItem->iCreatorId;
       
   162 	}
       
   163 
       
   164 EXPORT_C TUint CMemSpyApiKernelObjectItem::SecurityZone() const
       
   165 	{
       
   166 	return iItem->iSecurityZone;
       
   167 	}
       
   168 
       
   169 EXPORT_C TInt CMemSpyApiKernelObjectItem::Attributes() const
       
   170 	{
       
   171 	return iItem->iAttributes;
       
   172 	}
       
   173 
       
   174 EXPORT_C TUint8* CMemSpyApiKernelObjectItem::AddressOfDataBssStackChunk()
       
   175 	{
       
   176 	return iItem->iAddressOfDataBssStackChunk;
       
   177 	}
       
   178 
       
   179 // For Server, Session
       
   180 EXPORT_C TUint8* CMemSpyApiKernelObjectItem::AddressOfOwningThread()
       
   181 	{
       
   182 	return iItem->iAddressOfOwningThread;
       
   183 	}
       
   184 
       
   185 EXPORT_C TUint8* CMemSpyApiKernelObjectItem::AddressOfServer()
       
   186 	{
       
   187 	return iItem->iAddressOfServer;
       
   188 	}
       
   189 
       
   190 EXPORT_C TUint16 CMemSpyApiKernelObjectItem::TotalAccessCount() const
       
   191 	{
       
   192 	return iItem->iTotalAccessCount;
       
   193 	}
       
   194 
       
   195 EXPORT_C TUint8 CMemSpyApiKernelObjectItem::SvrSessionType() const
       
   196 	{
       
   197 	return iItem->iSvrSessionType;
       
   198 	}
       
   199 
       
   200 EXPORT_C TInt CMemSpyApiKernelObjectItem::MsgCount() const
       
   201 	{
       
   202 	return iItem->iMsgCount;
       
   203 	}
       
   204 
       
   205 EXPORT_C TInt CMemSpyApiKernelObjectItem::MsgLimit() const
       
   206 	{
       
   207 	return iItem->iMsgLimit;
       
   208 	}
       
   209 
       
   210 // For chunk
       
   211 EXPORT_C TInt CMemSpyApiKernelObjectItem::MaxSize() const
       
   212 	{
       
   213 	return iItem->iMaxSize;
       
   214 	}
       
   215 
       
   216 EXPORT_C TInt CMemSpyApiKernelObjectItem::Bottom() const
       
   217 	{
       
   218 	return iItem->iBottom;
       
   219 	}
       
   220 
       
   221 EXPORT_C TInt CMemSpyApiKernelObjectItem::Top() const
       
   222 	{
       
   223 	return iItem->iTop;
       
   224 	}
       
   225 
       
   226 EXPORT_C TInt CMemSpyApiKernelObjectItem::StartPos() const
       
   227 	{
       
   228 	return iItem->iStartPos;
       
   229 	}
       
   230 
       
   231 EXPORT_C TUint CMemSpyApiKernelObjectItem::ControllingOwner() const
       
   232 	{
       
   233 	return iItem->iControllingOwner;
       
   234 	}
       
   235 
       
   236 EXPORT_C TUint CMemSpyApiKernelObjectItem::Restrictions() const
       
   237 	{
       
   238 	return iItem->iRestrictions;
       
   239 	}
       
   240 
       
   241 EXPORT_C TUint CMemSpyApiKernelObjectItem::MapAttr() const
       
   242 	{
       
   243 	return iItem->iMapAttr;
       
   244 	}
       
   245 
       
   246 EXPORT_C TUint CMemSpyApiKernelObjectItem::ChunkType() const
       
   247 	{
       
   248 	return iItem->iChunkType;
       
   249 	}
       
   250 
       
   251 EXPORT_C const TDesC8& CMemSpyApiKernelObjectItem::NameOfOwner() const
       
   252 	{
       
   253 	/*
       
   254 	TBuf<KMaxName> ret;
       
   255 	ret.Copy( iItem->iNameOfOwner );
       
   256 	return ret;
       
   257 	*/
       
   258 	return iItem->iNameOfOwner;
       
   259 	}
       
   260 
       
   261 // For library
       
   262 EXPORT_C TInt CMemSpyApiKernelObjectItem::MapCount() const
       
   263 	{
       
   264 	return iItem->iMapCount;
       
   265 	}
       
   266 
       
   267 EXPORT_C TUint8 CMemSpyApiKernelObjectItem::State() const
       
   268 	{
       
   269 	return iItem->iState;
       
   270 	}
       
   271 
       
   272 EXPORT_C TUint8* CMemSpyApiKernelObjectItem::AddressOfCodeSeg()
       
   273 	{
       
   274 	return iItem->iAddressOfCodeSeg;
       
   275 	}
       
   276 
       
   277 // Semaphore, mutex, condvar
       
   278 EXPORT_C TUint8 CMemSpyApiKernelObjectItem::Resetting() const
       
   279 	{
       
   280 	return iItem->iResetting;
       
   281 	}
       
   282 
       
   283 EXPORT_C TUint8 CMemSpyApiKernelObjectItem::Order() const
       
   284 	{
       
   285 	return iItem->iOrder;
       
   286 	}
       
   287 
       
   288 // For Logical/Physical device
       
   289 EXPORT_C TVersion CMemSpyApiKernelObjectItem::Version() const
       
   290 	{
       
   291 	return iItem->iVersion;
       
   292 	}
       
   293 
       
   294 EXPORT_C TUint CMemSpyApiKernelObjectItem::ParseMask() const
       
   295 	{
       
   296 	return iItem->iParseMask;	
       
   297 	}
       
   298 
       
   299 EXPORT_C TUint CMemSpyApiKernelObjectItem::UnitsMask() const
       
   300 	{
       
   301 	return iItem->iUnitsMask;
       
   302 	}
       
   303 
       
   304 // For change notifier
       
   305 EXPORT_C TUint CMemSpyApiKernelObjectItem::Changes() const
       
   306 	{
       
   307 	return iItem->iChanges;
       
   308 	}
       
   309