diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp | 72 |
1 files changed, 33 insertions, 39 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp b/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp index f49d421f8da..a1d68620aea 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp @@ -27,7 +27,7 @@ TAO_Notify_Constraint_Expr::~TAO_Notify_Constraint_Expr () } -void +void TAO_Notify_Constraint_Expr::save_persistent ( TAO_Notify::Topology_Saver& saver) { @@ -46,7 +46,7 @@ TAO_Notify_Constraint_Expr::save_persistent ( } -void +void TAO_Notify_Constraint_Expr::load_attrs( const TAO_Notify::NVPList& attrs) { @@ -62,7 +62,7 @@ TAO_Notify_Constraint_Expr::load_attrs( TAO_Notify::Topology_Object* TAO_Notify_Constraint_Expr::load_child ( const ACE_CString &type, - CORBA::Long id, + CORBA::Long id, const TAO_Notify::NVPList& attrs) { ACE_UNUSED_ARG (id); @@ -75,7 +75,7 @@ TAO_Notify_Constraint_Expr::load_child ( attrs.find ("Type", type); CORBA::ULong len = this->constr_expr.event_types.length (); - if (DEBUG_LEVEL) + if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) reload EventType %d \n"), len + 1)); @@ -156,7 +156,7 @@ TAO_Notify_ETCL_Filter::add_constraint_i (CosNotifyFilter::ConstraintID cnstr_id auto_ptr <TAO_Notify_Constraint_Expr> auto_expr (notify_constr_expr); if (TAO_debug_level > 1) - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Added an empty constraint to filter\n"))); if (this->constraint_expr_list_.bind (cnstr_id, notify_constr_expr) == -1) @@ -171,8 +171,7 @@ TAO_Notify_ETCL_Filter::add_constraint_i (CosNotifyFilter::ConstraintID cnstr_id void TAO_Notify_ETCL_Filter::add_constraint_i (const CosNotifyFilter::ConstraintInfo& constraint, - CosNotifyFilter::ConstraintID cnstr_id - ) + CosNotifyFilter::ConstraintID cnstr_id) { TAO_Notify_Constraint_Expr* notify_constr_expr = 0; @@ -181,19 +180,18 @@ TAO_Notify_ETCL_Filter::add_constraint_i CORBA::NO_MEMORY ()); auto_ptr <TAO_Notify_Constraint_Expr> auto_expr (notify_constr_expr); - const CosNotifyFilter::ConstraintExp& expr = + CosNotifyFilter::ConstraintExp const & expr = constraint.constraint_expression; - notify_constr_expr->interpreter. - build_tree (expr); + notify_constr_expr->interpreter.build_tree (expr); notify_constr_expr->constr_expr = expr; if (cnstr_id == 0) { if (TAO_debug_level > 1) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Added constraint %s to filter %d\n"), + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Added constraint %C to filter %d\n"), expr.constraint_expr.in (), this->id_)); cnstr_id = ++constraint_expr_ids_; @@ -201,8 +199,8 @@ TAO_Notify_ETCL_Filter::add_constraint_i else { if (TAO_debug_level > 1) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Loaded constraint %s to filter %d\n"), + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Loaded constraint %C to filter %d\n"), expr.constraint_expr.in (), this->id_)); } @@ -220,10 +218,10 @@ TAO_Notify_ETCL_Filter::add_constraints ( ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, CORBA::INTERNAL ()); - CORBA::ULong constraint_length = constraint_list.length (); + CORBA::ULong const constraint_length = constraint_list.length (); if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("constraint_length = %d\n"), constraint_length)); @@ -265,7 +263,7 @@ TAO_Notify_ETCL_Filter::modify_constraints ( CORBA::INTERNAL ()); // First check if all the ids are valid. - u_int index; + CORBA::ULong index; for (index = 0; index < del_list.length (); ++index) { @@ -355,7 +353,7 @@ TAO_Notify_ETCL_Filter::get_constraints ( TAO_Notify_Constraint_Expr *notify_constr_expr = 0; - for (u_int index = 0; index < id_list.length (); ++index) + for (CORBA::ULong index = 0; index < id_list.length (); ++index) { if (this->constraint_expr_list_.find (id_list[index], notify_constr_expr) == -1) @@ -377,7 +375,8 @@ TAO_Notify_ETCL_Filter::get_all_constraints (void) ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, CORBA::INTERNAL ()); - CORBA::ULong current_size = static_cast<CORBA::ULong> (this->constraint_expr_list_.current_size ()); + CORBA::ULong const current_size = + static_cast<CORBA::ULong> (this->constraint_expr_list_.current_size ()); // Create the list that goes out. CosNotifyFilter::ConstraintInfoSeq *infoseq_ptr; @@ -425,9 +424,7 @@ TAO_Notify_ETCL_Filter::remove_all_constraints_i (void) CONSTRAINT_EXPR_LIST::ITERATOR iter (this->constraint_expr_list_); CONSTRAINT_EXPR_LIST::ENTRY *entry; - u_int index; - - for (index = 0; iter.done () == 0; iter.advance (), ++index) + for (CORBA::ULong index = 0; iter.done () == 0; iter.advance (), ++index) { if (iter.next (entry) != 0) { @@ -445,14 +442,14 @@ TAO_Notify_ETCL_Filter::destroy (void) ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, CORBA::INTERNAL ()); - if (CORBA::is_nil (this->poa_.in())) - return; - - this->remove_all_constraints_i (); + if (!CORBA::is_nil (this->poa_.in())) + { + this->remove_all_constraints_i (); - PortableServer::ObjectId_var refTemp = this->poa_->servant_to_id (this); - this->poa_->deactivate_object (refTemp.in ()); - this->poa_ = PortableServer::POA::_nil(); + PortableServer::ObjectId_var refTemp = this->poa_->servant_to_id (this); + this->poa_->deactivate_object (refTemp.in ()); + this->poa_ = PortableServer::POA::_nil(); + } } CORBA::Boolean @@ -496,8 +493,7 @@ TAO_Notify_ETCL_Filter::match_structured ( CORBA::Boolean TAO_Notify_ETCL_Filter::match_typed ( - const CosNotification::PropertySeq & /* filterable_data */ - ) + const CosNotification::PropertySeq & /* filterable_data */) { throw CORBA::NO_IMPLEMENT (); } @@ -523,7 +519,7 @@ TAO_Notify_ETCL_Filter::get_callbacks (void) } -void +void TAO_Notify_ETCL_Filter::save_persistent (TAO_Notify::Topology_Saver& saver) { TAO_Notify::NVPList attrs; @@ -543,10 +539,10 @@ TAO_Notify_ETCL_Filter::save_persistent (TAO_Notify::Topology_Saver& saver) TAO_Notify::NVPList attrs; bool changed = true; attrs.push_back(TAO_Notify::NVP("ConstraintId", entry->ext_id_)); - attrs.push_back(TAO_Notify::NVP("Expression", + attrs.push_back(TAO_Notify::NVP("Expression", entry->int_id_->constr_expr.constraint_expr.in ())); saver.begin_object(0, "constraint", attrs, changed); - + entry->int_id_->save_persistent (saver); saver.end_object(0, "constraint"); @@ -583,10 +579,8 @@ TAO_Notify_ETCL_Filter::load_attrs(const TAO_Notify::NVPList& attrs) TAO_Notify::Topology_Object* TAO_Notify_ETCL_Filter::load_child (const ACE_CString &type, - CORBA::Long id, const TAO_Notify::NVPList& attrs) + CORBA::Long, const TAO_Notify::NVPList& attrs) { - ACE_UNUSED_ARG (id); - TAO_Notify::Topology_Object* result = this; if (type == "constraint") { @@ -596,12 +590,12 @@ TAO_Notify_ETCL_Filter::load_child (const ACE_CString &type, TAO_Notify_Object::ID id = ACE_OS::atoi (value); constraint_expr_ids_ = id; - if (DEBUG_LEVEL) + if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) reload filter %d constraint %d\n"), static_cast<int> (this->id_), static_cast<int> (id))); - TAO_Notify_Constraint_Expr* expr + TAO_Notify_Constraint_Expr* expr = this->add_constraint_i (id); expr->load_attrs (attrs); |