Class: TEventSender

Declaration: Input.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

A hardware deviceÕs communication link to the Input system. It serves to define the lifetime of a device to the Input system. By definition, there is a one-to-one correspondence between the number of TEventSender objects in existence in the entire system and the number of input devices active on that system. Thus, when a program instantiates a TEventSender, the program becomes an input device. When that TEventSender is deleted, the program ceases to be an input device. TEventSender is used by any program that sends events. Because the communication linkage is very generic, the primary clients of TEventSender are other frameworks that define input device types, such as a keyboard framework or mouse framework. These frameworks will likely provide higher-level semantics on event sending than that provided by TEventSender. For example, a mouse framework can define protocol for sending a mouse-down event, allowing the client to specify the point at which the click occurred. The framework would package that into a stream of data which it would ask its TEventSender implementation to send. TEventSenders can be identified across tasks by TEventSenderSurrogates. TEventSenderSurrogates are lightweight objects whose sole purpose to is identify event senders across tasks. TEventSender has protocol for (1) registering and deregistering input devices with the Input system; and (2) sending a message to a deviceÕs TInputDevice object in a target application. TEventSender is a concrete class, and it is not intended to be derived. As such, it is designed so that clients can delegate to an instance of TEventSender rather than inheriting from it. This stems from the basic concept of TEventSender as a communication link; TEventSender generally doesn't know what information is being passed through it, just that information is flowing through it. This allows the device writer to determine the content of a message it passes from objects in a driver task to an TInputDevice object in an application task. Similarly, TEventSender is not streamable because its defined function has no persistent state.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TEventSender is not intended to be derived from.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TEventSender::TEventSender

  1. TEventSender (TInputDevice * adoptInputDevice)
  2. TEventSender (const TInputDevice & copyInputDevice)

Interface Category:

API.

Purpose:

  1. Creates a new event sender that adopts the specified input device. This constructor registers the new event sender with the Input system.
  2. Creates a new event sender that adopts a copy of the specified input device. This constructor registers the new event sender with the Input system.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

These constructors can indirectly cause an assertion during registration. An assertion is caused if the input device is NIL, or if the input device is already registered; in either case, registration does not take place.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TEventSender::~TEventSender

virtual ~ TEventSender ()

Interface Category:

API.

Purpose:

Destructor. This destructor deregisters the event sender with the Input system.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TEventSender::SendEvent

  1. virtual void SendEvent (TRandomAccessStream & message, ESyncLevel =kNormal)
  2. virtual void SendEvent (TRandomAccessStream & message, const TEventReceiverSurrogate & target, ESyncLevel =kNormal )
  3. virtual void SendEvent (TRandomAccessStream & message, TEventReceiverTargetter & target, ESyncLevel =kNormal )

Interface Category:

API.

Purpose:

  1. Sends the event specified in the random access stream to the Input system.
  2. Sends the event specified in the random access stream to the specified event receiver.
  3. Sends the event specified in the random access stream to the specified event receiver targeter.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.
  3. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.