/*! Notifies all interested listeners of this transaction about the \a event. If \a event is a closing event (ie. TRANSACTION_ENDED, and TRANSACTION_ABORTED), all listeners except those listening to TRANSACTION_WRITTEN will be removed. */ static void notify_transaction_listeners(block_cache* cache, cache_transaction* transaction, int32_t event) { bool isClosing = is_closing_event(event); bool isWritten = is_written_event(event); ListenerList::Iterator iterator = transaction->listeners.GetIterator(); while (iterator.HasNext()) { cache_listener* listener = iterator.Next(); bool remove = (isClosing && !is_written_event(listener->events)) || (isWritten && is_written_event(listener->events)); if (remove) iterator.Remove(); if ((listener->events & event) != 0) add_notification(cache, listener, event, remove); else if (remove) delete_notification(listener); } // This must work asynchronously in the kernel, but since we're not using // most transaction events, we can do it here. flush_pending_notifications(cache); }
void Team::_NotifyTeamRenamed() { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->TeamRenamed(Event(TEAM_EVENT_TEAM_RENAMED, this)); } }
void Team::_NotifyThreadRemoved(Thread* thread) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->ThreadRemoved(ThreadEvent(TEAM_EVENT_THREAD_REMOVED, thread)); } }
void Team::_NotifyImageRemoved(Image* image) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->ImageRemoved(ImageEvent(TEAM_EVENT_IMAGE_REMOVED, image)); } }
void TeamsWindow::_NotifySelectedInterfaceChanged(TargetHostInterface* interface) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->SelectedInterfaceChanged(interface); } }
/* * vislib::net::TcpServer::fireServerStopped */ void vislib::net::TcpServer::fireServerStopped(void) { this->lock.Lock(); ListenerList::Iterator it = this->listeners.GetIterator(); while (it.HasNext()) { it.Next()->OnServerStopped(); } this->lock.Unlock(); }
void StackFrame::NotifyValueRetrieved(Variable* variable, TypeComponentPath* path) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->StackFrameValueRetrieved(this, variable, path); } }
void Team::NotifyStopImageNameAdded(const BString& name) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->StopOnImageLoadNameAdded( ImageLoadNameEvent(TEAM_EVENT_IMAGE_LOAD_NAME_ADDED, this, name)); } }
void Team::NotifyImageDebugInfoChanged(Image* image) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->ImageDebugInfoChanged( ImageEvent(TEAM_EVENT_IMAGE_DEBUG_INFO_CHANGED, image)); } }
void Team::NotifyThreadStackTraceChanged(Thread* thread) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->ThreadStackTraceChanged( ThreadEvent(TEAM_EVENT_THREAD_STACK_TRACE_CHANGED, thread)); } }
void Team::NotifyThreadCpuStateChanged(Thread* thread) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->ThreadCpuStateChanged( ThreadEvent(TEAM_EVENT_THREAD_CPU_STATE_CHANGED, thread)); } }
/* * vislib::net::CommServer::fireServerStarted */ void vislib::net::CommServer::fireServerStarted(void) { VLSTACKTRACE("CommServer::fireServerStarted", __FILE__, __LINE__); this->listeners.Lock(); ListenerList::Iterator it = this->listeners.GetIterator(); while (it.HasNext()) { it.Next()->OnServerStarted(*this); } this->listeners.Unlock(); }
void Team::NotifyMemoryChanged(target_addr_t address, target_size_t size) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->MemoryChanged(MemoryChangedEvent( TEAM_EVENT_MEMORY_CHANGED, this, address, size)); } }
void Team::NotifyUserBreakpointChanged(UserBreakpoint* breakpoint) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->UserBreakpointChanged(UserBreakpointEvent( TEAM_EVENT_USER_BREAKPOINT_CHANGED, this, breakpoint)); } }
void Team::NotifyCoreFileChanged(const char* targetPath) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->CoreFileChanged(CoreFileChangedEvent( TEAM_EVENT_CORE_FILE_CHANGED, this, targetPath)); } }
void Team::NotifyDebugReportChanged(const char* reportPath) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->DebugReportChanged(DebugReportEvent( TEAM_EVENT_DEBUG_REPORT_CHANGED, this, reportPath)); } }
void Team::NotifyWatchpointChanged(Watchpoint* watchpoint) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->WatchpointChanged(WatchpointEvent( TEAM_EVENT_WATCHPOINT_CHANGED, this, watchpoint)); } }
void Team::NotifyStopOnImageLoadChanged(bool enabled, bool useImageNameList) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->StopOnImageLoadSettingsChanged( ImageLoadEvent(TEAM_EVENT_IMAGE_LOAD_SETTINGS_CHANGED, this, enabled, useImageNameList)); } }
void Team::NotifyConsoleOutputReceived(int32 fd, const BString& output) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->ConsoleOutputReceived( ConsoleOutputEvent(TEAM_EVENT_CONSOLE_OUTPUT_RECEIVED, this, fd, output)); } }
/*! Removes and deletes all listeners that are still monitoring this transaction. */ static void remove_transaction_listeners(block_cache* cache, cache_transaction* transaction) { ListenerList::Iterator iterator = transaction->listeners.GetIterator(); while (iterator.HasNext()) { cache_listener* listener = iterator.Next(); iterator.Remove(); delete_notification(listener); } }
void Team::NotifyDefaultSignalDispositionChanged(int32 disposition) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->DefaultSignalDispositionChanged( DefaultSignalDispositionEvent( TEAM_EVENT_DEFAULT_SIGNAL_DISPOSITION_CHANGED, this, disposition)); } }
void Team::NotifyCustomSignalDispositionChanged(int32 signal, int32 disposition) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->CustomSignalDispositionChanged( CustomSignalDispositionEvent( TEAM_EVENT_CUSTOM_SIGNAL_DISPOSITION_CHANGED, this, signal, disposition)); } }
void Team::NotifyCustomSignalDispositionRemoved(int32 signal) { for (ListenerList::Iterator it = fListeners.GetIterator(); Listener* listener = it.Next();) { listener->CustomSignalDispositionRemoved( CustomSignalDispositionEvent( TEAM_EVENT_CUSTOM_SIGNAL_DISPOSITION_REMOVED, this, signal, SIGNAL_DISPOSITION_IGNORE)); } }
/* * vislib::net::TcpServer::fireNewConnection */ bool vislib::net::TcpServer::fireNewConnection(Socket& socket, const IPEndPoint& addr) { bool retval = false; this->lock.Lock(); ListenerList::Iterator it = this->listeners.GetIterator(); while (it.HasNext()) { if ((retval = it.Next()->OnNewConnection(socket, addr))) { break; } } this->lock.Unlock(); return retval; }
/* * vislib::net::CommServer::fireServerError */ bool vislib::net::CommServer::fireServerError( const vislib::Exception& exception) { VLSTACKTRACE("CommServer::fireServerError", __FILE__, __LINE__); bool retval = true; this->listeners.Lock(); ListenerList::Iterator it = this->listeners.GetIterator(); while (it.HasNext()) { retval = it.Next()->OnServerError(*this, exception) && retval; } this->listeners.Unlock(); VLTRACE(Trace::LEVEL_VL_ANNOYINGLY_VERBOSE, "CommServer " "received exit request from registered error listener: %s\n", !retval ? "yes" : "no"); return retval; }
/* * vislib::net::CommServer::fireNewConnection */ bool vislib::net::CommServer::fireNewConnection( SmartRef<AbstractCommClientChannel>& channel) { VLSTACKTRACE("CommServer::fireNewConnection", __FILE__, __LINE__); bool retval = false; this->listeners.Lock(); ListenerList::Iterator it = this->listeners.GetIterator(); while (it.HasNext()) { if (it.Next()->OnNewConnection(*this, channel)) { retval = true; break; } } this->listeners.Unlock(); VLTRACE(Trace::LEVEL_VL_ANNOYINGLY_VERBOSE, "CommServer informed " "listeners about new connection. Was accepted: %s\n", retval ? "yes" : "no"); return retval; }
static fssh_status_t add_transaction_listener(block_cache* cache, cache_transaction* transaction, int32_t events, fssh_transaction_notification_hook hookFunction, void* data) { ListenerList::Iterator iterator = transaction->listeners.GetIterator(); while (iterator.HasNext()) { cache_listener* listener = iterator.Next(); if (listener->data == data && listener->hook == hookFunction) { // this listener already exists, just update it listener->events |= events; return FSSH_B_OK; } } cache_listener* listener = new(std::nothrow) cache_listener; if (listener == NULL) return FSSH_B_NO_MEMORY; set_notification(transaction, *listener, events, hookFunction, data); transaction->listeners.Add(listener); return FSSH_B_OK; }