be_visitor_decl.cpp

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

CPP
107
字号
//
// be_visitor_decl.cpp,v 1.8 2003/03/12 16:50:32 parsons Exp
//

// ============================================================================
//
// = LIBRARY
//    TAO IDL
//
// = FILENAME
//    be_visitor_decl.cpp
//
// = DESCRIPTION
//    Visitor for the base be_decl node. This serves to maintain the current
//    state (context) of code generation for the derived visitor.
//
// = AUTHOR
//    Aniruddha Gokhale
//
// ============================================================================

#include "be_visitor_decl.h"
#include "be_visitor_sequence.h"
#include "be_visitor_context.h"
#include "be_typedef.h"
#include "be_type.h"
#include "ace/Log_Msg.h"

ACE_RCSID (be, 
           be_visitor_decl, 
           "be_visitor_decl.cpp,v 1.8 2003/03/12 16:50:32 parsons Exp")


// Root visitor for client header
be_visitor_decl::be_visitor_decl (be_visitor_context *ctx)
  : ctx_ (ctx)
{
}

be_visitor_decl::~be_visitor_decl (void)
{
//  delete this->ctx_;
}

int
be_visitor_decl::gen_anonymous_base_type (be_type *bt,
                                          TAO_CodeGen::CG_STATE cg_state)
{
  be_typedef *tdef = be_typedef::narrow_from_decl (bt);

  if (!tdef)
    {
      be_visitor_context ctx (*this->ctx_);
      ctx.state (cg_state);

      // In case our container was typedef'd.
      ctx.tdef (0);

      int status = 0;

      switch (cg_state)
      {
        case TAO_CodeGen::TAO_ROOT_CH:
          {
            be_visitor_sequence_ch visitor (&ctx);
            status = bt->accept (&visitor);
            break;
          }
        case TAO_CodeGen::TAO_ROOT_CI:
          {
            be_visitor_sequence_ci visitor (&ctx);
            status = bt->accept (&visitor);
            break;
          }
        case TAO_CodeGen::TAO_ROOT_CS:
          {
            be_visitor_sequence_cs visitor (&ctx);
            status = bt->accept (&visitor);
            break;
          }
        case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
          {
            be_visitor_sequence_cdr_op_cs visitor (&ctx);
            status = bt->accept (&visitor);
            break;
          }
        default:
          ACE_ERROR_RETURN ((LM_ERROR,
                             "(%N:%l) be_visitor_decl::"
                             "gen_anonymous_base_type - "
                             "bad context state\n"),
                            -1);
      }

      if (status == -1)
        {
          ACE_ERROR_RETURN ((LM_ERROR,
                             "(%N:%l) be_visitor_decl::"
                             "gen_anonymous_base_type - "
                             "anonymous base type codegen failed\n"),
                            -1);
        }
    }

  return 0;
}

⌨️ 快捷键说明

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