Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: e32std.h
Link against: euser.lib

Class TFindSemaphore

TFindSemaphore

Support

Supported from 5.0

Description

Finds all global semaphores whose full names match a specified pattern.

The match pattern can be set into the TFindSemaphore object at construction; it can also be changed at any time after construction by using the Find() member function of the TFindHandleBase base class.

After construction, the Next() member function can be used repeatedly to find successive global semaphores whose full names match the current pattern.

A successful call to Next() means that a matching global semaphore has been found. To open a handle on this semaphore, call the RSemaphore::Open() function and pass a reference to this TFindSemaphore.

Pattern matching is part of descriptor behaviour. Names are folded for the purposes of matching; this means that for many locales, pattern matching is case insensitive.

Derivation

TFindHandleBaseBase class for searching for global Kernel objects
TFindSemaphoreFinds all global semaphores whose full names match a specified pattern

Defined in TFindSemaphore:
Next(), TFindSemaphore()

Inherited from TFindHandleBase:
Find(), Handle()


Construction and destruction


TFindSemaphore()

TFindSemaphore();

Description

Constructs the TFindSemaphore object with a default match pattern. The default match pattern, as implemented by the base class, is the single character ‘*’.

A new match pattern can be set after construction by calling the Find() member function of the TFindHandleBase base class.


TFindSemaphore()

TFindSemaphore(const TDesC& aMatch);

Description

Constructs the TFindSemaphore object with a specified match pattern.

A new match pattern can be set after construction by calling TFindHandleBase::Find().

Note:

Parameters

const TDesC& aMatch

A reference to the descriptor containing the match pattern.

[Top]


Find next matching global semaphore


Next()

TInt Next(TFullName& aResult);

Description

Finds the next global semaphore whose full name matches the match pattern.

If a global semaphore with a matching name is found, the function copies its full name into the descriptor aResult. It also saves the find-handle associated with the global semaphore into the TFindHandleBase part of this TFindSemaphore object.

Parameters

TFullName& aResult

A reference to a TBuf descriptor with a defined maximum length. If a matching global semaphore is found, its full name is set into this descriptor. If no matching global semaphore is found, the descriptor length is set to zero.

Return value

TInt

KErrNone if a matching global semaphore is found; KErrNotFound otherwise.