Wikia

Indus Communities

Watchlist Recent changes

Events

The Events style of composition uses the ?? Operator. Ports of type Event are represented as

  • Event EventName = boolean methodName(parameterlist)
Component EventTester{

	Event Evt = boolean Trigger(int num);
	//Event Evt = public boolean Trigger(int num); 
             //won't work - modifiers are not allowed
	//Event Evt = void Trigger(int num); 
             //won't work - event return type cannot be void
	//Event Evt = int Trigger(int num); 
             //won't work - event return type can only be boolean
	Event Evt = boolean Trigger( );

	Handler Hnd = int Processor(int number);
	Sink Snk = void Pit(int finalnumber);
}

?? represents the event connector to implement the following compositions

* HandlerName  ??  EventName
* SinkName ?? EventName
* ?? EventName 
  {
 	/* logic implementation */
  }

In the first case, either of the following will then apply

  • result = HandlerName ?? EventName
  • conditional checking of returned values

In the third case, the value of the trapped event is returned in the form of __returnvalue which again may need to be type casted to the required type.

An example using the Events style of composition is given here.


Next : Event test case (covers negative test cases also)

Pages on Indus Communities

Add a Page
48pages on
this wiki
Advertisement | Your ad here

Latest Photos

Add a Photo
2photos on this wiki

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki