lookupMeter Member Function

Creates a Meter object for a Container object or Event object of the Listener. This function creates a Meter object only when that object does not exist. If the object exists, the existing object is returned.

Attention: The application does not call delete on any objects that are returned by this function.

Syntax

Meter *lookupMeter(const char *meterName);
Meter *lookupMeter(const wchar_t *meterName);

Parameters

meterName
[in] Required pointer to a string, which provides the name of the Meter object. The string consists of UTF-8 or Unicode characters, which can contain any printable characters, excluding the newline character.

Example

Listener *listener = new Listener("sampleApp", "4.0", NULL, false);
Meter *cacheSize = listener->lookupMeter("cache size");
  - or -
Container *store = listener->lookupContainer("storeName");
Meter *cacheSize = store->lookupMeter("cache size");
  - or -
Event *creations = listener->lookupEvent(USER, "document creations");
Meter *creationSize = creations->lookupMeter("creation size");
...

See Also