#include <ETCL_Filter.h>
Collaboration diagram for TAO_Notify_ETCL_Filter:
|
A list of the constraints stored in this filter.
Definition at line 108 of file ETCL_Filter.h. |
|
Constuctor.
Definition at line 15 of file ETCL_Filter.cpp.
00016 :constraint_expr_ids_ (0) 00017 { 00018 } |
|
Destructor.
Definition at line 20 of file ETCL_Filter.cpp. References ACE_DEBUG, LM_DEBUG, remove_all_constraints(), and TAO_debug_level.
00021 { 00022 try 00023 { 00024 this->remove_all_constraints (); 00025 } 00026 catch (const CORBA::Exception&) 00027 { 00028 if (TAO_debug_level) 00029 ACE_DEBUG ((LM_DEBUG, "Error in Filter dtor\n")); 00030 00031 // @@ eat exception. 00032 } 00033 00034 if (TAO_debug_level > 1) 00035 ACE_DEBUG ((LM_DEBUG, "Filter Destroyed\n")); 00036 } |
|
Definition at line 78 of file ETCL_Filter.cpp. References ACE_DEBUG, ACE_GUARD_THROW_EX, ACE_NEW_THROW_EX, add_constraints_i(), CosNotifyFilter::ConstraintExpSeq, CosNotifyFilter::ConstraintInfoSeq, LM_DEBUG, TAO_debug_level, and TAO_SYNCH_MUTEX.
00080 { 00081 ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 00082 CORBA::INTERNAL ()); 00083 00084 CORBA::ULong constraint_length = constraint_list.length (); 00085 00086 if (TAO_debug_level > 0) 00087 ACE_DEBUG ((LM_DEBUG, "constraint_length = %d\n", 00088 constraint_length)); 00089 00090 // Create the list that goes out. 00091 CosNotifyFilter::ConstraintInfoSeq* infoseq_ptr; 00092 ACE_NEW_THROW_EX (infoseq_ptr, 00093 CosNotifyFilter::ConstraintInfoSeq (constraint_length), 00094 CORBA::NO_MEMORY ()); 00095 00096 CosNotifyFilter::ConstraintInfoSeq_var infoseq (infoseq_ptr); 00097 infoseq->length (constraint_length); 00098 00099 // Populate infoseq. 00100 for (CORBA::ULong pop_index = 0; pop_index < constraint_length; ++pop_index) 00101 { 00102 infoseq[pop_index].constraint_expression = 00103 constraint_list [pop_index]; 00104 00105 if (TAO_debug_level > 0) 00106 { 00107 ACE_DEBUG ((LM_DEBUG, 00108 "Adding constraint %d, %s\n", 00109 pop_index, 00110 constraint_list [pop_index].constraint_expr.in ())); 00111 } 00112 } 00113 00114 this->add_constraints_i (infoseq.in ()); 00115 00116 return infoseq._retn (); 00117 } |
|
Definition at line 45 of file ETCL_Filter.cpp. References ACE_DEBUG, ACE_NEW_THROW_EX, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::bind(), TAO_Notify_ETCL_Filter::TAO_Notify_Constraint_Expr::constr_expr, CosNotifyFilter::ConstraintExp::constraint_expr, constraint_expr_ids_, constraint_expr_list_, CosNotifyFilter::ConstraintID, CosNotifyFilter::ConstraintInfoSeq, TAO_Notify_ETCL_Filter::TAO_Notify_Constraint_Expr::interpreter, LM_DEBUG, ACE_Auto_Basic_Ptr< X >::release(), and TAO_debug_level. Referenced by add_constraints(), and modify_constraints().
00047 { 00048 for (CORBA::ULong index = 0; index < constraint_info_seq.length (); ++index) 00049 { 00050 TAO_Notify_Constraint_Expr* notify_constr_expr; 00051 00052 ACE_NEW_THROW_EX (notify_constr_expr, 00053 TAO_Notify_Constraint_Expr (), 00054 CORBA::NO_MEMORY ()); 00055 auto_ptr <TAO_Notify_Constraint_Expr> auto_expr (notify_constr_expr); 00056 00057 const CosNotifyFilter::ConstraintExp& expr = 00058 constraint_info_seq[index].constraint_expression; 00059 00060 notify_constr_expr->interpreter. 00061 build_tree (expr.constraint_expr.in ()); 00062 00063 notify_constr_expr->constr_expr = expr; 00064 00065 CosNotifyFilter::ConstraintID cnstr_id = ++constraint_expr_ids_; 00066 00067 if (this->constraint_expr_list_.bind (cnstr_id, notify_constr_expr) == -1) 00068 throw CORBA::INTERNAL (); 00069 00070 if (TAO_debug_level > 1) 00071 ACE_DEBUG ((LM_DEBUG, "Added constraint to filter %x\n", this, expr.constraint_expr.in ())); 00072 00073 auto_expr.release (); 00074 } 00075 } |
|
Definition at line 363 of file ETCL_Filter.cpp.
00366 {
00367 throw CORBA::NO_IMPLEMENT ();
00368 }
|
|
Definition at line 39 of file ETCL_Filter.cpp. References CORBA::string_dup().
00040 { 00041 return CORBA::string_dup ("ETCL"); 00042 } |
|
Definition at line 301 of file ETCL_Filter.cpp. References ACE_GUARD_THROW_EX, remove_all_constraints_i(), and TAO_SYNCH_MUTEX.
00302 { 00303 ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 00304 CORBA::INTERNAL ()); 00305 00306 this->remove_all_constraints_i (); 00307 00308 PortableServer::POA_var my_POA = _default_POA (); 00309 00310 PortableServer::ObjectId_var refTemp = my_POA->servant_to_id (this); 00311 00312 my_POA->deactivate_object (refTemp.in ()); 00313 } |
|
Definition at line 371 of file ETCL_Filter.cpp. References CosNotifyFilter::CallbackID.
00374 {
00375 throw CORBA::NO_IMPLEMENT ();
00376 }
|
|
Definition at line 233 of file ETCL_Filter.cpp. References ACE_GUARD_THROW_EX, ACE_NEW_THROW_EX, constraint_expr_list_, CosNotifyFilter::ConstraintInfoSeq, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::current_size(), and TAO_SYNCH_MUTEX.
00234 { 00235 ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 00236 CORBA::INTERNAL ()); 00237 00238 CORBA::ULong current_size = static_cast<CORBA::ULong> (this->constraint_expr_list_.current_size ()); 00239 00240 // Create the list that goes out. 00241 CosNotifyFilter::ConstraintInfoSeq *infoseq_ptr; 00242 ACE_NEW_THROW_EX (infoseq_ptr, 00243 CosNotifyFilter::ConstraintInfoSeq (current_size), 00244 CORBA::NO_MEMORY ()); 00245 00246 CosNotifyFilter::ConstraintInfoSeq_var infoseq (infoseq_ptr); 00247 00248 infoseq->length (current_size); 00249 00250 CONSTRAINT_EXPR_LIST::ITERATOR iter (this->constraint_expr_list_); 00251 CONSTRAINT_EXPR_LIST::ENTRY *entry; 00252 00253 for (u_int index = 0; iter.done () == 0; iter.advance (), ++index) 00254 { 00255 if (iter.next (entry) != 0) 00256 { 00257 // Why do we cast to a const object? 00258 // We want to force the TAO::String_Manager to make a 00259 // copy of the string. It wouldn't unless we coax it to use 00260 // the correct assignment operator. 00261 infoseq[index].constraint_expression = 00262 static_cast<const CosNotifyFilter::ConstraintExp> (entry->int_id_->constr_expr); 00263 00264 infoseq[index].constraint_id = entry->ext_id_; 00265 } 00266 } 00267 00268 return infoseq._retn (); 00269 } |
|
Definition at line 379 of file ETCL_Filter.cpp.
00380 {
00381 throw CORBA::NO_IMPLEMENT ();
00382 }
|
|
Definition at line 200 of file ETCL_Filter.cpp. References ACE_GUARD_THROW_EX, ACE_NEW_THROW_EX, TAO_Notify_ETCL_Filter::TAO_Notify_Constraint_Expr::constr_expr, constraint_expr_list_, CosNotifyFilter::ConstraintIDSeq, CosNotifyFilter::ConstraintInfoSeq, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::find(), and TAO_SYNCH_MUTEX.
00202 { 00203 ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 00204 CORBA::INTERNAL ()); 00205 00206 // Create the list that goes out. 00207 CosNotifyFilter::ConstraintInfoSeq *infoseq_ptr; 00208 ACE_NEW_THROW_EX (infoseq_ptr, 00209 CosNotifyFilter::ConstraintInfoSeq (id_list.length ()), 00210 CORBA::NO_MEMORY ()); 00211 00212 CosNotifyFilter::ConstraintInfoSeq_var infoseq (infoseq_ptr); 00213 00214 TAO_Notify_Constraint_Expr *notify_constr_expr = 0; 00215 00216 for (u_int index = 0; index < id_list.length (); ++index) 00217 { 00218 if (this->constraint_expr_list_.find (id_list[index], 00219 notify_constr_expr) == -1) 00220 throw CosNotifyFilter::ConstraintNotFound (id_list[index]); 00221 00222 infoseq[index].constraint_expression = 00223 notify_constr_expr->constr_expr; 00224 00225 // Get an id. 00226 infoseq[index].constraint_id = id_list[index]; 00227 } 00228 00229 return infoseq._retn (); 00230 } |
|
Definition at line 316 of file ETCL_Filter.cpp.
00317 {
00318 throw CORBA::NO_IMPLEMENT ();
00319 }
|
|
Definition at line 322 of file ETCL_Filter.cpp. References ACE_GUARD_THROW_EX, TAO_Notify_Constraint_Visitor::bind_structured_event(), and TAO_SYNCH_MUTEX.
00324 { 00325 ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 00326 CORBA::INTERNAL ()); 00327 00328 // We want to return true if at least one constraint matches. 00329 CONSTRAINT_EXPR_LIST::ITERATOR iter (this->constraint_expr_list_); 00330 CONSTRAINT_EXPR_LIST::ENTRY *entry; 00331 00332 TAO_Notify_Constraint_Visitor visitor; 00333 00334 if (visitor.bind_structured_event (filterable_data) != 0) 00335 { 00336 // Maybe throw some kind of exception here, or lower down, 00337 return 0; 00338 } 00339 00340 for (; iter.done () == 0; iter.advance ()) 00341 { 00342 if (iter.next (entry) != 0) 00343 { 00344 if (entry->int_id_->interpreter.evaluate (visitor) == 1) 00345 { 00346 return 1; 00347 } 00348 } 00349 } 00350 00351 return 0; 00352 } |
|
Definition at line 355 of file ETCL_Filter.cpp. References CosNotification::PropertySeq.
00358 {
00359 throw CORBA::NO_IMPLEMENT ();
00360 }
|
|
Definition at line 120 of file ETCL_Filter.cpp. References ACE_GUARD_THROW_EX, add_constraints_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::bind(), constraint_expr_ids_, constraint_expr_list_, CosNotifyFilter::ConstraintID, CosNotifyFilter::ConstraintIDSeq, CosNotifyFilter::ConstraintInfoSeq, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::find(), ACE_Array_Base< T >::max_size(), TAO_SYNCH_MUTEX, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::unbind().
00123 { 00124 ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 00125 CORBA::INTERNAL ()); 00126 00127 // First check if all the ids are valid. 00128 u_int index; 00129 00130 for (index = 0; index < del_list.length (); ++index) 00131 { 00132 if (this->constraint_expr_list_.find (del_list [index]) == -1) 00133 { 00134 throw CosNotifyFilter::ConstraintNotFound (del_list [index]); 00135 } 00136 } 00137 00138 for (index = 0; index < modify_list.length (); ++index) 00139 { 00140 if (this->constraint_expr_list_.find (modify_list [index].constraint_id) == -1) 00141 { 00142 throw CosNotifyFilter::ConstraintNotFound ( 00143 modify_list [index].constraint_id); 00144 } 00145 } 00146 00147 // Remove previous entries and save them in case we need to reinstate them. 00148 ACE_Array<TAO_Notify_Constraint_Expr*> constr_saved (modify_list.length ()); 00149 TAO_Notify_Constraint_Expr* constr_expr = 0; 00150 00151 for (index = 0; index < modify_list.length (); ++index) 00152 { 00153 CosNotifyFilter::ConstraintID cnstr_id = 00154 modify_list [index].constraint_id; 00155 00156 if (this->constraint_expr_list_.unbind (cnstr_id, constr_expr) != -1) 00157 { 00158 constr_saved[index] = constr_expr; 00159 } 00160 } 00161 00162 // Now add the new entries. 00163 // Keep a list of ids generated in this session. 00164 try 00165 { 00166 this->add_constraints_i (modify_list); 00167 } 00168 catch (const CORBA::Exception&) 00169 { 00170 // Restore, 00171 for (index = 0; index < modify_list.length (); ++index) 00172 { 00173 CosNotifyFilter::ConstraintID cnstr_id = ++this->constraint_expr_ids_; 00174 00175 if (constraint_expr_list_.bind (cnstr_id, constr_saved[index]) == -1) 00176 throw CORBA::NO_RESOURCES (); 00177 } 00178 00179 throw; 00180 } 00181 00182 // Now go around deleting... 00183 // for the del_list. 00184 for (index = 0; index < del_list.length (); ++index) 00185 { 00186 if (this->constraint_expr_list_.unbind (del_list [index], constr_expr) != -1) 00187 { 00188 delete constr_expr; 00189 } 00190 } 00191 00192 // Delete the old constraints. 00193 for (index = 0; index < constr_saved.max_size (); ++index) 00194 { 00195 delete constr_saved[index]; 00196 } 00197 } |
|
Definition at line 272 of file ETCL_Filter.cpp. References ACE_GUARD_THROW_EX, remove_all_constraints_i(), and TAO_SYNCH_MUTEX. Referenced by ~TAO_Notify_ETCL_Filter().
00273 { 00274 ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 00275 CORBA::INTERNAL ()); 00276 00277 this->remove_all_constraints_i (); 00278 } |
|
Definition at line 281 of file ETCL_Filter.cpp. References constraint_expr_list_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >::unbind_all(). Referenced by destroy(), and remove_all_constraints().
00282 { 00283 CONSTRAINT_EXPR_LIST::ITERATOR iter (this->constraint_expr_list_); 00284 CONSTRAINT_EXPR_LIST::ENTRY *entry; 00285 00286 u_int index; 00287 00288 for (index = 0; iter.done () == 0; iter.advance (), ++index) 00289 { 00290 if (iter.next (entry) != 0) 00291 { 00292 delete entry->int_id_; 00293 entry->int_id_ = 0; 00294 } 00295 } 00296 00297 this->constraint_expr_list_.unbind_all (); 00298 } |
|
Id generator for ConstraintInfo's.
Definition at line 102 of file ETCL_Filter.h. Referenced by add_constraints_i(), and modify_constraints(). |
|
Definition at line 110 of file ETCL_Filter.h. Referenced by add_constraints_i(), get_all_constraints(), get_constraints(), modify_constraints(), and remove_all_constraints_i(). |
|
Lock to serialize access to data members.
Definition at line 99 of file ETCL_Filter.h. |