rettype_return_cs.cpp

来自「这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用」· C++ 代码 · 共 238 行

CPP
238
字号
//
// rettype_return_cs.cpp,v 1.11 2002/09/25 16:25:36 parsons Exp
//

// ============================================================================
//
// = LIBRARY
//    TAO IDL
//
// = FILENAME
//    rettype_return_cs.cpp
//
// = DESCRIPTION
//    Visitor generating code for returning the return type variable.
//
// = AUTHOR
//    Aniruddha Gokhale
//
// ============================================================================

ACE_RCSID (be_visitor_operation, 
           rettype_return_cs, 
           "rettype_return_cs.cpp,v 1.11 2002/09/25 16:25:36 parsons Exp")

// ************************************************************
//    be_visitor_operation_rettype_return_cs
//
//    code to generate the return statement of the stub.
// ************************************************************

be_visitor_operation_rettype_return_cs::
be_visitor_operation_rettype_return_cs (be_visitor_context *ctx)
  : be_visitor_decl (ctx)
{
}

be_visitor_operation_rettype_return_cs::
~be_visitor_operation_rettype_return_cs (void)
{
}

int
be_visitor_operation_rettype_return_cs::visit_array (be_array *)
{
  TAO_OutStream *os = this->ctx_->stream ();

  *os << "_tao_retval._retn ()";

  return 0;
}

int
be_visitor_operation_rettype_return_cs::visit_enum (be_enum *)
{
  TAO_OutStream *os = this->ctx_->stream ();

  *os << "_tao_retval";

  return 0;
}

int
be_visitor_operation_rettype_return_cs::visit_interface (be_interface *)
{
  TAO_OutStream *os = this->ctx_->stream ();

  *os << "_tao_retval._retn ()";

  return 0;
}

int
be_visitor_operation_rettype_return_cs::visit_interface_fwd (be_interface_fwd *)
{
  TAO_OutStream *os = this->ctx_->stream ();

  *os << "_tao_retval";

  return 0;
}

int
be_visitor_operation_rettype_return_cs::visit_valuetype (be_valuetype *)
{
  TAO_OutStream *os = this->ctx_->stream ();

  *os << "_tao_retval._retn ()";

  return 0;
}

int
be_visitor_operation_rettype_return_cs::visit_valuetype_fwd (be_valuetype_fwd *)
{
  TAO_OutStream *os = this->ctx_->stream ();

  *os << "_tao_retval._retn ()";

  return 0;
}

int
be_visitor_operation_rettype_return_cs::visit_predefined_type (
    be_predefined_type *node
  )
{
  TAO_OutStream *os = this->ctx_->stream ();

  switch (node->pt ())
    {
    case AST_PredefinedType::PT_pseudo:
    case AST_PredefinedType::PT_object:
      *os << "_tao_retval._retn ()";

      break;
    case AST_PredefinedType::PT_any:
      *os << "_tao_retval._retn ()";

      break;
    case AST_PredefinedType::PT_void:
      break;
    default:
      *os << "_tao_retval";

      break;
    }

  return 0;
}

int
be_visitor_operation_rettype_return_cs::visit_sequence (be_sequence *)
{
  TAO_OutStream *os = this->ctx_->stream ();

  *os << "_tao_retval._retn ()";

  return 0;
}

int
be_visitor_operation_rettype_return_cs::visit_string (be_string *)
{
  TAO_OutStream *os = this->ctx_->stream ();

  *os << "_tao_retval._retn ()";

  return 0;
}

int
be_visitor_operation_rettype_return_cs::visit_structure (be_structure *node)
{
  TAO_OutStream *os = this->ctx_->stream ();

  if (node->size_type () == AST_Type::VARIABLE)
    {
      *os << "_tao_retval._retn ()";
    }
  else
    {
      *os << "_tao_retval";
    }

  return 0;
}

int
be_visitor_operation_rettype_return_cs::visit_typedef (be_typedef *node)
{
  this->ctx_->alias (node);

  if (node->primitive_base_type ()->accept (this) == -1)
    {
      ACE_ERROR_RETURN ((LM_ERROR,
                         "be_visitor_operation_rettype_return_cs::"
                         "visit_typedef - "
                         "accept on primitive type failed\n"),
                        -1);
    }

  this->ctx_->alias (0);
  return 0;
}

int
be_visitor_operation_rettype_return_cs::visit_union (be_union *node)
{
  TAO_OutStream *os = this->ctx_->stream ();

  if (node->size_type () == AST_Type::VARIABLE)
    {
      *os << "_tao_retval._retn ()";
    }
  else
    {
      *os << "_tao_retval";
    }
  
  return 0;
}

int
be_visitor_operation_rettype_return_cs::visit_component (be_component *node)
{
  return this->visit_interface (node);
}

int
be_visitor_operation_rettype_return_cs::visit_component_fwd (
    be_component_fwd *node
  )
{
  return this->visit_interface_fwd (node);
}

int
be_visitor_operation_rettype_return_cs::visit_eventtype (be_eventtype *node)
{
  return this->visit_valuetype (node);
}

int
be_visitor_operation_rettype_return_cs::visit_eventtype_fwd (
    be_eventtype_fwd *node
  )
{
  return this->visit_valuetype_fwd (node);
}

int
be_visitor_operation_rettype_return_cs::visit_home (be_home *node)
{
  return this->visit_interface (node);
}


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?