library/src/events/BP-Events.cc
//! Lookup an event processor by name.
Lookup an event processor by name.
Lookup an event processor by name .
P_BP_EVENT_PROCESSOR BP_EventMgrLookupProcessorByName(P_BP_EVENT_MANAGER event_manager, char *processor_name)
{
	BP_EVENTMGR_VALIDATE_WORKING_ENVIRONMENT(NULL);
	if(!event_manager)
		return NULL;
	if(!event_manager->name)
		return NULL;
	if(!BP_StringIsReasonablePrintableString(processor_name, bpstrlen(processor_name), BP_FALSE, BP_FALSE))
		return NULL;
	BP_GHT_ENTER_CRITICAL_SECTION;
	char * table_path_actual[10] = {0};
	BP_HASH_TABLE_TRAVERSAL_PATH table_path = (char **) &table_path_actual;
	table_path[0] = "system";
	table_path[1] = "event_managment";
	table_path[2] = event_manager->name;
	table_path[3] = "processors";
	table_path[4] = processor_name;
	table_path[5] = "entry";
	table_path[6] = NULL;
	P_BP_HASH_TABLE_KEYED_ENTRY processor_table_lookup = BP_HashRegLookupTableEntryByPath(NULL, table_path);
	if(!processor_table_lookup)
		BP_GHT_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(NULL);
	if(!processor_table_lookup->data)
		BP_GHT_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(NULL);
	P_BP_EVENT_PROCESSOR processor = (P_BP_EVENT_PROCESSOR) processor_table_lookup->data;
	BP_GHT_LEAVE_CRITICAL_SECTION;
	return processor;
}
P_BP_EVENT_PROCESSOR BP_EventMgrLookupProcessorByName ( P_BP_EVENT_MANAGER event_manager , char * processor_name ) { BP_EVENTMGR_VALIDATE_WORKING_ENVIRONMENT ( NULL ) ; if ( ! event_manager ) return NULL ; if ( ! event_manager -> name ) return NULL ; if ( ! BP_StringIsReasonablePrintableString ( processor_name , bpstrlen ( processor_name ) , BP_FALSE , BP_FALSE ) ) return NULL ; BP_GHT_ENTER_CRITICAL_SECTION ; char * table_path_actual [ 10 ] = { 0 } ; BP_HASH_TABLE_TRAVERSAL_PATH table_path = ( char * * ) & table_path_actual ; table_path [ 0 ] = " " ; table_path [ 1 ] = " " ; table_path [ 2 ] = event_manager -> name ; table_path [ 3 ] = " " ; table_path [ 4 ] = processor_name ; table_path [ 5 ] = " " ; table_path [ 6 ] = NULL ; P_BP_HASH_TABLE_KEYED_ENTRY processor_table_lookup = BP_HashRegLookupTableEntryByPath ( NULL , table_path ) ; if ( ! processor_table_lookup ) BP_GHT_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( NULL ) ; if ( ! processor_table_lookup -> data ) BP_GHT_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( NULL ) ; P_BP_EVENT_PROCESSOR processor = ( P_BP_EVENT_PROCESSOR ) processor_table_lookup -> data ; BP_GHT_LEAVE_CRITICAL_SECTION ; return processor ; }
Lookup an event processor by name.
Lookup an event processor by name .
// ensure we have a correct working environment within the event manager // ensure we have a manager // manager name is necessary for lookup // ensure string is reasonable/printable // enter critical section before lookup // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Attempt to Lookup Processors Table for Manager %%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // create a table path on the stack for ease of use // reference to the local stack // set path // attempt lookup for the processor // If we can't lookup the workers table, we somehow have a corrupt table.  Return // immediately. // extract the processor from the lookup; create reference // leave the critical section before exiting routine // return the processor table table