// Remove a callback function for the specified event type.
194128
func (d *Dispatcher) Remove(etype Type, callback Callback) {
	d.Lock()
	defer d.Unlock()

	// Grab a reference to the function pointer
	ptr := reflect.ValueOf(callback).Pointer()

	// Find callback by pointer and remove it
	callbacks := d.callbacks[etype]
	for idx, cb := range callbacks {
		if reflect.ValueOf(cb).Pointer() == ptr {
			d.callbacks[etype] = append(callbacks[:idx], callbacks[idx+1:]...)
		}
	}
}
730822
func (d *Dispatcher) dispatch(etype Type, value interface{}) error {
	// Create the event
	e := &event{
		etype:  etype,
		source: d.source,
		value:  value,
	}

	// Dispatch the event to all callbacks
	for _, cb := range d.callbacks[etype] {
		if err := cb(e); err != nil {
			return err
		}
	}

	return nil
}
55969
func EventTypes() []string {
	es := make([]string, 0, len(eventTypes))
	for k := range eventTypes {
		es = append(es, k)
	}
	return es
}
824351
func (s Status) Event_type() string {
	switch s.String() {
	case TPL_HOSTINFOS_RUN:
		return OBCHOSTINFOSTPLRUN
	case TPL_HOSTINFOS_FINISHED:
		return OBCHOSTINFOSTPLFINISHED
	case CMD_GETCONFIG_BEGIN:
		return OBCHOSTINFOSCONFIGPARSING
	case CMD_GETCONFIG_END:
		return OBCHOSTINFOSCONFIGPARSED
	case CMD_KVMCHECK_BEGIN:
		return OBCHOSTINFOSKVMCHECKPARSING
	case CMD_KVMCHECK_END:
		return OBCHOSTINFOSKVMCHECKPARSED
	case TPL_VERTICE_RUN:
		return OBCVERTICETPLRUN
	case VERTICE_INSTALL_BEGIN:
		return OBCVERTICEINSTALLINGTYPE
	case VERTICE_INSTALL_END:
		return OBCVERTICEINSTALLEDTYPE
	case TPL_VERTICE_FINISHED:
		return OBCVERTICETPLFINISHED
	case TPL_VERTICEGATEWAY_RUN:
		return OBCVERTICEGATEWAYTPLRUN
	case GATEWAY_INSTALL_BEGIN:
		return OBCVERTICEGATEWAYINSTALLINGTYPE
	case GATEWAY_INSTALL_END:
		return OBCVERTICEGATEWAYINSTALLEDTYPE
	case TPL_VERTICEGATEWAY_FINISHED:
		return OBCVERTICEGATEWAYTPLFINISHED
	case TPL_VERTICENILAVU_RUN:
		return OBCVERTICENILAVUTPLRUN
	case NILAVU_INSTALL_BEGIN:
		return OBCVERTICENILAVUINSTALLINGTYPE
	case NILAVU_INSTALL_END:
		return OBCVERTICENILAVUINSTALLEDTYPE
	case TPL_VERTICENILAVU_FINISHED:
		return OBCVERTICENILAVUTPLFINISHED
	case TPL_ONEMASTER_RUN:
		return OBCONEMASTERTPLRUN
	case ONEMASTER_INSTALL_BEGIN:
		return OBCONEMASTERINSTALLINGTYPE
	case ONEMASTER_INSTALL_END:
		return OBCONEMASTERINSTALLEDTYPE
	case ONEMASTER_ACTIVATE_BEGIN:
		return OBCONEMASTERACTIVATINGTYPE
	case ONEMASTER_ACTIVATE_END:
		return OBCONEMASTERACTIVATEDTYPE
	case TPL_ONEMASTER_FINISHED:
		return OBCONEMASTERTPLFINISHED
	case TPL_ONEHOST_RUN:
		return OBCONEHOSTTPLRUN
	case ONEHOST_PEPARE_BEGIN:
		return OBCONEHOSTPEPARINGTYPE
	case ONEHOST_PREPARE_END:
		return OBCONEHOST_PREPAREDTYPE
	case ONEHOST_INSTALL_BEGIN:
		return OBCONEHOSTINSTALLINGTYPE
	case ONEHOST_INSTALL_END:
		return OBCONEHOSTINSTALLEDTYPE
	case TPL_ONEHOST_FINISHED:
		return OBCONEHOSTTPLFINISHEDTYPE
	case TPL_CEPHCLUSTER_RUN:
		return OBCCEPHCLUSTERTPLRUN
	case CEPHCLUSTER_PREPARE_BEGIN:
		return OBCCEPHCLUSTERPREPAREINSTALLINGTYPE
	case CEPHCLUSTER_PREPARE_END:
		return OBCCEPHCLUSTERPREPAREINSTALLEDTYPE
	case CEPHCLUSTER_INSTALL_BEIGIN:
		return OBCCEPHCLUSTERINSTALLINGTYPE
	case CEPHCLUSTER_INSTALL_END:
		return OBCCEPHCLUSTERINSTALLEDTYPE
	case CEPHCLUSTER_ACCESS_BEGIN:
		return OBCCEPHCLUSTERACCESSENABLINGTYPE
	case CEPHCLUSTER_ACCESS_END:
		return OBCCEPHCLUSTERACCESSENABLEDTYPE
	case CEPHCLUSTER_NEW_BEGIN:
		return OBCCEPHCLUSTERNEWCREATINGTYPE
	case CEPHCLUSTER_NEW_END:
		return OBCCEPHCLUSTERNEWCREATEDTYPE
	case CEPHCLUSTER_CONFIG_BEGIN:
		return OBCCEPHCLUSTERCONFIGURINGTYPE
	case CEPHCLUSTER_CONFIG_END:
		return OBCCEPHCLUSTERCONFIGUREDTYPE
	case CEPHCLUSTER_MON_BEGIN:
		return OBCCEPHCLUSTERMONINITIALINGTYPE
	case CEPHCLUSTER_MON_END:
		return OBCCEPHCLUSTERMONINITIALIZEDTYPE
	case CEPHCLUSTER_CREATEPOOL_BEGIN:
		return OBCCEPHCLUSTERPOOLCREATINGTYPE
	case CEPHCLUSTER_CREATEPOOL_END:
		return OBCCEPHCLUSTERPOOLCREATEDTYPE
	case TPL_CEPHCLUSTER_FINISHED:
		return OBCCEPHCLUSTERTPLFINISHED
	case TPL_CEPHCLIENT_RUN:
		return OBCCEPHCLIENTTPLRUN
	case CEPHCLIENT_INSTALL_BEGIN:
		return OBCCEPHCLIENTINSTALLING
	case CEPHCLIENT_INSTALL_END:
		return OBCCEPHCLIENTINSTALLED
	case TPL_CEPHCLIENT_FINISHED:
		return OBCCEPHCLIENTTPLFINISHED
	case TPL_ADDOSDS_RUN:
		return OBCADDOSDSTPLRUN
	case OSDS_ACTIVATE_BEGIN:
		return OBCOSDSACTIVATINGTYPE
	case OSDS_ACTIVATE_END:
		return OBCOSDSACTIVATEDTYPE
	case OSDS_PREPARE_BEGIN:
		return OBCOSDSPREPARINGTYPE
	case OSDS_PREPARE_END:
		return OBCOSDSPREPAREDTYPE
	case TPL_ADDOSDS_FINISHED:
		return OBCADDOSDSTPLFINISHED
	case TPL_DSCONNECTION_RUN:
		return OBCCEPHDSCONNECTIONTPLRUN
	case CEPHDS_AUTHKEY_BEGIN:
		return OBCCEPHDSAUTHKEYCREATINGTYPE
	case CEPHDS_AUTHKEY_END:
		return OBCCEPHDSAUTHKEYCREATEDTYPE
	case CEPHDS_DEFINEKEY_BEGIN:
		return OBCCEPHDSAUTHKEYDEFININGTYPE
	case CEPHDS_DEFINEKEY_END:
		return OBCCEPHDSAUTHKEYDEFINEDTYPE
	case TPL_DSCONNECTION_FINISHED:
		return OBCCEPHDSCONNECTIONTPLFINISHED
	case TPL_CEPHACCESS_RUN:
		return OBCCEPHACCESSTPLRUN
	case CEPHACCESS_PASSWORD_BEGIN:
		return OBCCEPHACCESSPASSAUTHENDICATINGTYPE
	case CEPHACCESS_PASSWORD_END:
		return OBCCEPHACCESSPASSAUTHENDICATEDTYPE
	case CEPHACCESS_KEY_BEGIN:
		return OBCCEPHACCESSKEYAUTHENDICATINGTYPE
	case CEPHACCESS_KEY_END:
		return OBCCEPHACCESSKEYAUTHENDICATEDTYPE
	case TPL_CEPHACCESS_FINISHED:
		return OBCCEPHACCESSTPLFINISHED
	case TPL_ZAPDISK_RUN:
		return OBCZAPDISKTPLRUN
	case ZAPDISKS_CLEAN_BEGIN:
		return OBCZAPDISKSCLEANINGTYPE
	case ZAPDISKS_CLEAN_END:
		return OBCZAPDISKSCLEANEDTYPE
	case TPL_ZAPDISK_FINISHED:
		return OBCZAPDISKTPLFINISHED
	case TPL_KVMNETWORK_RUN:
		return OBCKVMNETWORKTPLRUN
	case KVMNETWORK_CONFIG_BEGIN:
		return OBCKVMNETWORKCONFIGURINGTYPE
	case KVMNETWORK_CONFIG_END:
		return OBCKVMNETWORKCONFIGUREDTYPE
	case TPL_KVMNETWORK_FINISHED:
		return OBCKVMNETWORKTPLFINISHED
	case TPL_LVMINSTALL_RUN:
		return OBCLVMTPLRUN
	case LVM_INSTALL_BEGIN:
		return OBCLVM_INSTALLINGTYPE
	case LVM_INSTALL_END:
		return OBCLVMINSTALLEDTYPE
	case TPL_LVMINSTALL_FINISHED:
		return OBCLVMTPLFINISHED
	case TPL_NETWORKINFO_RUN:
		return OBCNETWORKINFOTPLRUN
	case GETNETWORK_INFOS_BEGIN:
		return OBCGETNETWORKINFOSGATHERINGTYPE
	case GETNETWORK_INFOS_END:
		return OBCGETNETWORKINFOSGATHEREDTYPE
	case TPL_NETWORKINFO_FINISHED:
		return OBCNETWORKINFOTPLFINISHED
	case RUNNING:
		return OBCHOSTINSTALLRUNNINGTYPE
	case HOSTRUNNING:
		return OBCHOSTINSTALLRUNNINGTYPE
	case MASTERRUNNING:
		return OBCHOSTINSTALLRUNNINGTYPE
	case NETWORKERROR:
		return OBCNETWORKERRORTYPE
	case STORAGEERROR:
		return OBCSTORAGEERRORTYPE
	case COMPUTEERROR:
		return OBCCOMPUTEERRORTYPE
	case PREERROR:
		return OBCTEMPLATEPREERRORTYPE
	case POSTERROR:
		return OBCTEMPLATEPOSTERRORTYPE
	case ERROR:
		return OBCTEPMLATEERRORTYPE
	default:
		return "arrgh"
	}
}
859513
func (s *EventService) DeleteEvents(p *DeleteEventsParams) (*DeleteEventsResponse, error) {
	resp, err := s.cs.newRequest("deleteEvents", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeleteEventsResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
204888
func (e *RawV4Event) EventType() mysql_proto.LogEventType_Type {
	return mysql_proto.LogEventType_Type(e.header.EventType)
}
389458
func (em *EventManager) RemoveEvent(event string) {
	if !em.HasEvent(event) {
		return
	}

	ev, _ := em.GetEvent(event)
	ev.Offload()

	em.wo.Lock()
	delete(em.events, event)
	em.wo.Unlock()
}
974440
func (r *RecordList) Remove(ev EventBuilder, fn Listener) int {
	idx, rec := r.Find(ev.Name())
	if idx == -1 {
		return 0
	}

	// 1. Find the index of the listener in the list
	oldList := rec.getUnsafeList()
	spliceIndex := -1
	for i, l := range oldList {
		if l != nil && (*(*Listener)(l)) == fn {
			spliceIndex = i
			break
		}
	}

	if spliceIndex == -1 {
		return len(oldList)
	}

	newCount := len(oldList) - rec.inactiveItems - 1
	// 2. If that's the only listener, just remove that record entirely.
	if newCount == 0 {
		r.remove(idx)
		return 0
	}

	// 3. Otherwise, wipe the pointer, or make a new list copied from the parts
	// of the old if we wanted to compact it.
	if float32(rec.inactiveItems+1)/float32(len(oldList)) < compactionThreshold {
		rec.storeAtIndex(spliceIndex, nil)
		rec.inactiveItems++
		return newCount
	}

	newList := make([]unsafe.Pointer, 0, newCount)
	for i, ptr := range oldList {
		if ptr != nil && i != spliceIndex {
			newList = append(newList, ptr)
		}
	}
	rec.inactiveItems = 0
	rec.setList(newList)

	return newCount
}
1244578
func (b *Bus) RemoveListener(et EventType, lis Listener) bool {
	b.lock.Lock()
	defer b.lock.Unlock()

	removed := b.removeListeners(
		et,
		func(_ Command, _lis Listener) bool {
			return _lis == lis
		},
	)
	return len(removed) > 0
}
327869
func (sprite *sprite) RemoveAllTouchListener() {
	simlog.FuncIn()
	sprite.Sprite.RemoveAllTouchListener()
	simlog.FuncOut()
}
293101
func event(out io.Writer) {
	event_h := readHeader("event")

	// Event is implemented by hand in wrappers.go

	// Get all the pn_event_type_t enum values
	var etypes []eventType
	enums := findEnums(event_h)
	for _, e := range enums[0].Values {
		if skipEventRe.FindStringSubmatch(e) == nil {
			etypes = append(etypes, newEventType(e))
		}
	}

	doTemplate(out, etypes, `
type EventType int
const ({{range .}}
	 E{{.Name}} EventType = C.{{.Cname}}{{end}}
)
`)

	doTemplate(out, etypes, `
func (e EventType) String() string {
	switch e {
{{range .}}
	case C.{{.Cname}}: return "{{.Name}}"{{end}}
	}
	return "Unknown"
}
`)
}
285569
func (cp *CallbackProcessor) Remove(callbackName string) {
	log.Printf("[info] removing callback `%v` from %v\n", callbackName, fileWithLineNum())
	cp.name = callbackName
	cp.remove = true
	cp.parent.processors = append(cp.parent.processors, cp)
	cp.parent.reorder()
}
543309
func (c *DOMDebugger) RemoveEventListenerBreakpointWithParams(v *DOMDebuggerRemoveEventListenerBreakpointParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOMDebugger.removeEventListenerBreakpoint", Params: v})
}
886058
func (em *EventManager) DisconnectRemoved() {
	// send the dom out to all registered event subs for loadup
	em.EachEvent(func(es EventSubs) {
		if es.Removed() {
			// es.Offload()
			em.RemoveEvent(GetEventID(es))
		}
	})
}
54199
func streamEventCallback(st C.virStreamPtr, events int, callbackID int) {
	callbackFunc := getCallbackId(callbackID)

	callback, ok := callbackFunc.(StreamEventCallback)
	if !ok {
		panic("Incorrect stream event func callback")
	}

	callback(&Stream{ptr: st}, StreamEventType(events))
}
406958
func (s *Event) SetEventType(v string) *Event {
	s.EventType = &v
	return s
}
596811
func ValidateEventType(eventtype string) bool {
	switch eventtype {
	case v1.EventTypeNormal, v1.EventTypeWarning:
		return true
	}
	return false
}