EOEvent
- Inherits from:
- NSObject
Declared in:
- EOControl/EOEvent.h
Class Description
EOEvent is an abstract class that provides concrete subclasses with a structure for storing information (such as duration) about a logged event.
Subclasses of EOEvent don't need to override any inherited methods or implement any methods at all. You can customize the behavior if you want, but the EOEvent implementations are sufficient for most cases. Generally, to create a subclass of EOEvent, you merely declare it and create a description file that defines the events your subclass logs. The class itself usually declares no instance variables and implements no methods. The abstract implementation gets all the information it needs from the description file. For more information on the description file, see the eventTypeDescriptions method description.
Most of the work involved in logging custom events is instrumenting your code. For more information on that and on the event logging system itself, see the EOEventCenter class specification.
Constants
In EOEvent.h, EOControl defines the int
type EOEventSignatureType
which
is the argument type for the methods signatureOfType:, aggregateEvents:bySignatureOfType:,
and groupEvents:bySignatureOfType:. EOEvent.h also
defines the following enumeration constant as a possible signature type
to be used as the argument to these methods.
Additionally, EOEvent.h defines
the following NSString constant to be used as a key into the dictionary returned
by eventTypeDescriptions.
The EOEventGroupName
entry
provides the description of the family of events represented by
the event class.
Method Types
- Defining an event type
- + eventTypeDescriptions
- + description
- Accessing information about the event
- - description
- - title
- - startDate
- - duration
- - durationWithoutSubevents
- - setType:
- - type
- - setInfo:
- - info
- - comment
- Grouping and Aggregating Events
- + aggregateEvents:bySignatureOfType:
- + groupEvents:bySignatureOfType:
- - signatureOfType:
- Displaying event information
- - displayComponentName
- Traversing the event hierarchy
- - parentEvent
- - subevents
- Logging events
- - markAtomicWithInfo:
- - markEnd
- - markStartWithInfo:
Class Methods
aggregateEvents:bySignatureOfType:
+ (NSArray *)aggregateEvents:(NSArray
*)events
bySignatureOfType:(EOEventSignatureType)tag
This method is for use by the WOEventDisplay page. For more information, see "WOEventDisplay page" .
description
+ (NSString *)description
eventTypeDescriptions
+ (NSDictionary *)eventTypeDescriptions
EOEvent's implementation reads the event types and their descriptions from a file. To define the types your event class represents, create a description file for your event and add it to your project's Resources folder. An event's description file defines the event categories and subcategories used in the WOEventDisplay page. The file's contents is a dictionary in plist format.
For example, consider the ODBCAdaptorEvent that logs events for the ODBC adaptor. ODBCAdaptorEvent is a subclass of EOEvent. It uses EOEvent's implementation of eventTypeDescriptions. The name of its description file is ODBCAdaptorEvent.description, and it looks like this:
{ EOEventGroupName = "ODBC Adaptor Event"; connect = "Connect"; openChannel = "Open Channel"; evaluateExpression = "Evaluate Expression"; fetchRow = "Fetch Row"; commitTransaction = "Commit Transaction"; }
Using the EOEvent
implementation, the EOEventGroupName entry
is mandatory; it describes the family of events logged by the event
class. Any other keys are defined by the event class itself. In
the ODBCAdaptorEvent class, the other keys (connect
, openChannel
,
and so on) are the types of the events ODBCAdaptorEvent
logs.
If the file doesn't exist or if there's an
error reading the file, EOEvent creates a dictionary with a single entry;
the entry's key is EOEventGroupName
and
the value is the name of the event class (such as ODBCAdaptorEvent).
groupEvents:bySignatureOfType:
+ (NSArray *)groupEvents:(NSArray
*)events
bySignatureOfType:(EOEventSignatureType)tag
This method is for use by the WOEventDisplay page. For more information, see "WOEventDisplay page" .
Instance Methods
comment
- (NSString *)comment
description
- (NSString *)description
displayComponentName
- (NSString *)displayComponentName
duration
- (int)duration
durationWithoutSubevents
- (int)durationWithoutSubevents
info
- (id)info
markAtomicWithInfo:
- (void)markAtomicWithInfo:(id)info
Note: Don't invoke this method directly. Use the corresponding function defined in EOEventCenter.h instead. |
markEnd
- (void)markEnd
Note: Don't invoke this method directly. Use the corresponding function defined in EOEventCenter.h instead. |
markStartWithInfo:
- (void)markStartWithInfo:(id)info
Note: Don't invoke this method directly. Use the corresponding function defined in EOEventCenter.h instead. |
parentEvent
- (EOEvent *)parentEvent
setInfo:
- (void)setInfo:(id)info
setType:
- (void)setType:(NSString
*)type
signatureOfType:
- (id)signatureOfType:(EOEventSignatureType)tag
See Also: + aggregateEvents:bySignatureOfType:, + groupEvents:bySignatureOfType:
startDate
- (NSCalendarDate *)startDate
subevents
- (NSArray *)subevents
title
- (NSString *)title
type
- (NSString *)type