Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

andhandler.h File Reference


Detailed Description

Sends a completion event when it has received at least 1 event from each registered event. This can be use as a control gate. For example, you might register an andhandler to receive completion events from 3 other handlers. The andhandler will send it's completion event when it receives the completion events from ALL the other handlers. In this way you can snychronize event triggering. State is reset after generating the complete event.

Wire keywords (standard handler keywords documented in Wire )

Example:

// when ALL $events are received THEN the $go event will be generated create handler and { complete: $go regevent: $events }

Events accepted:
TypeDescription
any Keep track of how many of each registered events are received

Complete Events Generated:
Event NameTypeDescription
complete AW_EVENT_TYPE_STRING Generate event when at least one of each registered events is received, value is desc:

Time Events Generated:
Event NameTypeDescription
time AW_EVENT_TYPE_INT32 Generate event on completion, value is execution time in usec

#include <stdio.h>
#include "monitor.h"
#include "wire.h"

Go to the source code of this file.

Data Structures

struct  aw_andhandler_cevents_t
 Events generated for sql completion. More...

struct  aw_andhandler_reg_t
 Indicator for event. More...

struct  aw_andhandler_state_t
 State info. More...

struct  aw_andhandler_t
 And handler object. More...


Functions

aw_andhandler_t * aw_create_andhandler (const aw_andhandler_cevents_t *cevents, const byte_t *desc, int32_t(*regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index), int32_t(*regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index), aw_logger_t *aware_logger)
 Create a and handler.

void aw_free_andhandler (aw_andhandler_t *h)
 Free handler and all associated resources.

aw_handler_t * aw_wire_andhandler (aw_wire_mkhandler_args_t *args)
 Create a andhandler using "wire". See header doc for keyword documentation.


Function Documentation

aw_andhandler_t* aw_create_andhandler (  const aw_andhandler_cevents_t *  cevents,
const byte_t *  desc,
int32_t(*  regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
int32_t(*  regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
aw_logger_t *  aware_logger
) 
 

Create a and handler.

aw_create_andhandler

Parameters:
cevents Completion event
desc Optional Description string
regevent Function pointer for event registration
regmaskevent Function pointer for event mask registration
aware_logger Aware logger object
Returns:
Handler object

void aw_free_andhandler (  aw_andhandler_t *  h  ) 
 

Free handler and all associated resources.

aw_free_andhandler

Parameters:
h The handler

aw_handler_t* aw_wire_andhandler (  aw_wire_mkhandler_args_t *  args  ) 
 

Create a andhandler using "wire". See header doc for keyword documentation.

aw_wire_andhandler

Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)