00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "Filter.h"
00025
00026 #include <assert.h>
00027
00028 #ifdef HAVE_OMNIORB4
00029 # define STR_MATCH(s1,s2) omni::strMatch((s1),(s2))
00030 #else
00031 # define STR_MATCH(s1,s2) (0==::strcmp((s1),(s2)))
00032 #endif
00033
00034 namespace OmniEvents {
00035
00036 bool FilterByRepositoryId::keep(const CORBA::Any& event) const
00037 {
00038 using namespace CORBA;
00039 CORBA::TypeCode_var tc=event.type();
00040 switch( tc->kind() )
00041 {
00042 #ifdef HAVE_OMNIORB4
00043 case _np_tk_indirect:
00044 assert(0);
00045 #endif
00046
00047
00048 case tk_objref:
00049 case tk_struct:
00050 case tk_union:
00051 case tk_enum:
00052 case tk_alias:
00053 case tk_except:
00054 return STR_MATCH( _rid.in(), tc->id() );
00055
00056
00057 case tk_sequence:
00058 case tk_array:
00059
00060
00061 case tk_null:
00062 case tk_void:
00063 case tk_short:
00064 case tk_long:
00065 case tk_ushort:
00066 case tk_ulong:
00067 case tk_float:
00068 case tk_double:
00069 case tk_boolean:
00070 case tk_char:
00071 case tk_octet:
00072 case tk_any:
00073 case tk_TypeCode:
00074 case tk_Principal:
00075 case tk_string:
00076 #ifdef HAS_LongLong
00077 case tk_longlong:
00078 case tk_ulonglong:
00079 #endif
00080 #ifdef HAS_LongDouble
00081 case tk_longdouble:
00082 #endif
00083 #ifndef HAVE_OMNIORB3
00084 case tk_wchar:
00085 case tk_wstring:
00086 case tk_fixed:
00087
00088
00089 case tk_value:
00090 case tk_value_box:
00091 case tk_native:
00092 case tk_abstract_interface:
00093 case tk_local_interface:
00094 #else
00095 default:
00096 #endif
00097 break;
00098 }
00099 return false;
00100 }
00101
00102 };