Пример #1
0
void
OCI_APT::ArgList::prepare_request(CORBA::NVList_ptr args,
				  CORBA::TypeCode_ptr &result_tc,
				  bool &is_oneway)
{
	is_oneway = this->is_oneway_;
	if (!is_oneway)
		result_tc = CORBA::TypeCode::_duplicate (this->result_.tc_);
	for (CORBA::ULong i = 0; i < this->num_args_; i++)
	{
		TAO::Unknown_IDL_Type *ut = 0;
		ACE_NEW(ut, TAO::Unknown_IDL_Type(this->args_[i].tc_));
		CORBA::Any_var value = new CORBA::Any;
		value->replace(ut);
		args->add_value("",value.in(), this->args_[i].mode_);
	}
}
Пример #2
0
int
TAO_Log_Constraint_Visitor::visit_in (
    ETCL_Binary_Expr *binary)
{
  int return_value = -1;
  ETCL_Constraint *lhs = binary->lhs ();

  // Determine if the left operand is contained in the right.

  if (lhs->accept (this) == 0)
    {
      TAO_ETCL_Literal_Constraint left;
      this->queue_.dequeue_head (left);

      ETCL_Constraint *rhs = binary->rhs ();

      if (rhs->accept (this) == 0)
        {
          TAO_ETCL_Literal_Constraint bag;
          this->queue_.dequeue_head (bag);

          if (bag.expr_type () == ETCL_COMPONENT)
            {
              CORBA::Any_ptr any_ptr = 0;
              ACE_NEW_RETURN (any_ptr,
                              CORBA::Any,
                              -1);

              CORBA::Any_var component = any_ptr;
              component->replace (bag);
              component->impl ()->_add_ref ();
              CORBA::TCKind kind = CORBA::tk_null;

              try
                {
                  CORBA::TypeCode_var tc = component->type ();
                  kind = TAO_DynAnyFactory::unalias (tc.in ());
                }
              catch (const CORBA::Exception&)
                {
                  return return_value;
                }

              CORBA::Boolean result = 0;

              switch (kind)
              {
                case CORBA::tk_sequence:
                  result = this->sequence_does_contain (&component.in (),
                                                        left);
                  break;
                case CORBA::tk_array:
                  result = this->array_does_contain (&component.in (),
                                                     left);
                  break;
                case CORBA::tk_struct:
                  result = this->struct_does_contain (&component.in (),
                                                      left);
                  break;
                case CORBA::tk_union:
                  result = this->union_does_contain (&component.in (),
                                                     left);
                  break;
                case CORBA::tk_any:
                  result = this->any_does_contain (&component.in (),
                                                   left);
                  break;
                default:
                  return return_value;
              }

              this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
              return_value = 0;
            }
        }
    }

  return return_value;
}