⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 psdl_node.cpp

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 CPP
📖 第 1 页 / 共 5 页
字号:
// -*- C++ -*-
// PSDL_Node.cpp,v 1.3 2003/10/28 18:34:04 bala Exp

#include "PSDL_Node.h"
#include "PSDL_Scope.h"
#include "PSDL_Scope_Visitor.h"
#include "PSDL_Node_Visitor.h"
#include "PSDL_y.h"

#include "PSDL_Stream.h"
#include "tao/CORBA_String.h"

ACE_RCSID (PSS, PSDL_Node, "PSDL_Node.cpp,v 1.3 2003/10/28 18:34:04 bala Exp")

TAO_PSDL_Node::TAO_PSDL_Node (void)
  : identifiers_ (),
    count_ (0),
    predefined_type_ (0),
    psdl_scope_ (0),
    psdl_scope_visitor_ (0)
{
}

TAO_PSDL_Node::~TAO_PSDL_Node (void)
{
}

int
TAO_PSDL_Node::type_of_node (void) const
{
  return this->type_;
}


TAO_PSDL_Scope_Visitor *
TAO_PSDL_Node::psdl_scope_visitor (void)
{
  if (this->psdl_scope_visitor_ == 0)
    this->psdl_scope_visitor_ = new TAO_PSDL_Scope_Visitor (this);

  return this->psdl_scope_visitor_;
}

TAO_PSDL_Scope *
TAO_PSDL_Node::psdl_scope (void)
{
  this->psdl_scope_ = TAO_PSDL_Scope::instance ()->pop_top_scope ();

  return this->psdl_scope_;
}

ACE_CString
TAO_PSDL_Node::get_identifier_type (void)
{
  // We are going to save such that the first element is the type of the
  // identifier and the second element is the actual identifier
  return this->identifiers_[0];
}

ACE_CString
TAO_PSDL_Node::get_identifier_value (void)
{
  // We are going to save such as the first element is the type of the
  // identifier and
  // the second element is the actual identifier
  return this->identifiers_[1];
}

void
TAO_PSDL_Node::set_identifier (ACE_CString identifier)
{
  if (this->identifiers_.size () == 0)
    this->identifiers_.size (2);

  this->identifiers_[this->count_] = identifier;
  ++this->count_;
}

void
TAO_PSDL_Node::set_predefined_type (void)
{
  this->predefined_type_ = 1;
}

/// ****************************************************************

TAO_PSDL_Specification::TAO_PSDL_Specification (TAO_PSDL_Node *definition)
  : definition_ (definition),
    specification_ (0)
{
}

TAO_PSDL_Specification::TAO_PSDL_Specification (TAO_PSDL_Node *definition,
                                                TAO_PSDL_Node *specification)
  : definition_ (definition),
    specification_ (specification)
{
}

TAO_PSDL_Specification::~TAO_PSDL_Specification (void)
{
  delete this->definition_;
  delete this->specification_;
}

TAO_PSDL_Node *
TAO_PSDL_Specification::definition (void) const
{
  return this->definition_;
}

TAO_PSDL_Node *
TAO_PSDL_Specification::specification (void) const
{
  return this->specification_;
}

int
TAO_PSDL_Specification::accept (TAO_PSDL_Node_Visitor *visitor)
{
  int result = visitor->visit_specification (this);

  // The control goes back to psdl_tao now. So, put in the end stuff
  // to the header file.

  // Get a pointer to PSDL_Stream of the stub header.
  TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();

  *ps_sh << "#if defined (__ACE_INLINE__)"; ps_sh->nl ();
  *ps_sh << "#include \""
         << TAO_PSDL_Scope::instance ()->get_stub_prefix ()
         << "C.i\""; ps_sh->nl ();
  *ps_sh << "#endif /* defined INLINE */"; ps_sh->nl ();

  ps_sh->nl ();

  *ps_sh << "#if defined(_MSC_VER) && (_MSC_VER >= 1200)"; ps_sh->nl ();
  *ps_sh << "#pragma warning(pop)"; ps_sh->nl ();
  *ps_sh << "#endif /* _MSC_VER */"; ps_sh->nl ();

  *ps_sh << "#if defined (__BORLANDC__)"; ps_sh->nl ();
  *ps_sh << "#pragma option pop"; ps_sh->nl ();
  *ps_sh << "#endif /* __BORLANDC__ */"; ps_sh->nl ();

  ps_sh->nl ();

  *ps_sh << "#endif /* ifndef */"; ps_sh->nl ();

  return result;
}

/// ****************************************************************

TAO_PSDL_Definition::TAO_PSDL_Definition (TAO_PSDL_Node *definition_type)
  : definition_type_ (definition_type)
{
}

TAO_PSDL_Definition::~TAO_PSDL_Definition (void)
{
  delete this->definition_type_;
}

TAO_PSDL_Node *
TAO_PSDL_Definition::definition_type (void) const
{
  return this->definition_type_;
}

int
TAO_PSDL_Definition::accept (TAO_PSDL_Node_Visitor *visitor)
{
  return visitor->visit_definition (this);
}

/// ****************************************************************

TAO_PSDL_Module::TAO_PSDL_Module (int type,
                                  TAO_PSDL_Node *identifier,
                                  TAO_PSDL_Node *specification)
  : identifier_ (identifier),
    specification_ (specification)
{
  this->type_ = type;
}

TAO_PSDL_Module::~TAO_PSDL_Module (void)
{
  delete this->identifier_;
  delete this->specification_;
}

TAO_PSDL_Node *
TAO_PSDL_Module::identifier (void) const
{
  return this->identifier_;
}

TAO_PSDL_Node *
TAO_PSDL_Module::specification (void) const
{
  return this->specification_;
}

void
TAO_PSDL_Module::set_identifier_name (ACE_CString identifier_name)
{
  this->module_name_ = identifier_name;
}

ACE_CString
TAO_PSDL_Module::identifier_name (void) const
{
  return this->module_name_;
}

int
TAO_PSDL_Module::accept (TAO_PSDL_Node_Visitor *visitor)
{
  return visitor->visit_module (this);
}

/// ***************************************************************

TAO_PSDL_Abstract_Storagetype::TAO_PSDL_Abstract_Storagetype (TAO_PSDL_Node *storagetype_dcl)
  : storagetype_dcl_ (storagetype_dcl)
{
}

TAO_PSDL_Abstract_Storagetype::~TAO_PSDL_Abstract_Storagetype (void)
{
  delete this->storagetype_dcl_;
}

TAO_PSDL_Node *
TAO_PSDL_Abstract_Storagetype::storagetype_dcl (void) const
{
  return this->storagetype_dcl_;
}

int
TAO_PSDL_Abstract_Storagetype::accept (TAO_PSDL_Node_Visitor *visitor)
{
  return visitor->visit_abstract_storagetype (this);
}

/// ****************************************************************

TAO_PSDL_Abstract_Storagetype_Dcl::TAO_PSDL_Abstract_Storagetype_Dcl (
     TAO_PSDL_Node *abs_storagetype_header)
  : abs_storagetype_header_ (abs_storagetype_header),
    abs_storagetype_body_ (0)
{
}

TAO_PSDL_Abstract_Storagetype_Dcl::TAO_PSDL_Abstract_Storagetype_Dcl (
     TAO_PSDL_Node *abs_storagetype_header,
     TAO_PSDL_Node *abs_storagetype_body)
  : abs_storagetype_header_ (abs_storagetype_header),
    abs_storagetype_body_ (abs_storagetype_body)
{
}

TAO_PSDL_Abstract_Storagetype_Dcl::~TAO_PSDL_Abstract_Storagetype_Dcl (void)
{
  delete this->abs_storagetype_header_;
  if (this->abs_storagetype_body_ != 0)
    delete this->abs_storagetype_body_;
}

TAO_PSDL_Node *
TAO_PSDL_Abstract_Storagetype_Dcl::abs_storagetype_header (void) const
{
  return this->abs_storagetype_header_;
}

TAO_PSDL_Node *
TAO_PSDL_Abstract_Storagetype_Dcl::abs_storagetype_body (void) const
{
  return this->abs_storagetype_body_;
}

int
TAO_PSDL_Abstract_Storagetype_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
{
  return visitor->visit_abstract_storagetype_dcl (this);
}

/// ****************************************************************

TAO_PSDL_Abstract_Storagetype_Fwd_Dcl::TAO_PSDL_Abstract_Storagetype_Fwd_Dcl (
     TAO_PSDL_Node *identifier)
  : identifier_ (identifier)
{
}

TAO_PSDL_Abstract_Storagetype_Fwd_Dcl::~TAO_PSDL_Abstract_Storagetype_Fwd_Dcl (void)
{
  delete this->identifier_;
}

TAO_PSDL_Node *
TAO_PSDL_Abstract_Storagetype_Fwd_Dcl::identifier (void) const
{
  return this->identifier_;
}

int
TAO_PSDL_Abstract_Storagetype_Fwd_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
{
  return visitor->visit_abstract_storagetype_fwd_dcl (this);
}

/// ****************************************************************

TAO_PSDL_Abstract_Storagetype_Header::TAO_PSDL_Abstract_Storagetype_Header (TAO_PSDL_Node *identifier)
  : identifier_ (identifier)
{
}

TAO_PSDL_Abstract_Storagetype_Header::TAO_PSDL_Abstract_Storagetype_Header (
     TAO_PSDL_Node *identifier,
     TAO_PSDL_Node *abs_storagetype_inh_spec)
  : identifier_ (identifier),
    abs_storagetype_inh_spec_ (abs_storagetype_inh_spec)
{
}

TAO_PSDL_Abstract_Storagetype_Header::~TAO_PSDL_Abstract_Storagetype_Header (void)
{
  delete this->identifier_;
  delete this->abs_storagetype_inh_spec_;
}

TAO_PSDL_Node *
TAO_PSDL_Abstract_Storagetype_Header::identifier (void) const
{
  return this->identifier_;
}

TAO_PSDL_Node *
TAO_PSDL_Abstract_Storagetype_Header::abs_storagetype_inh_spec (void) const
{
  return this->abs_storagetype_inh_spec_;
}

int
TAO_PSDL_Abstract_Storagetype_Header::accept (TAO_PSDL_Node_Visitor *visitor)
{
  return visitor->visit_abstract_storagetype_header (this);
}

/// ****************************************************************

TAO_PSDL_Abstract_Storagetype_Body::TAO_PSDL_Abstract_Storagetype_Body (TAO_PSDL_Node *abs_storagetype_member)
  : abs_storagetype_member_ (abs_storagetype_member)
{
}

TAO_PSDL_Abstract_Storagetype_Body::TAO_PSDL_Abstract_Storagetype_Body (
     TAO_PSDL_Node *abs_storagetype_member,
     TAO_PSDL_Node *abs_storagetype_body)
  : abs_storagetype_member_ (abs_storagetype_member),
    abs_storagetype_body_ (abs_storagetype_body)
{
}

TAO_PSDL_Abstract_Storagetype_Body::~TAO_PSDL_Abstract_Storagetype_Body (void)
{
  delete this->abs_storagetype_member_;
  delete this->abs_storagetype_body_;
}

TAO_PSDL_Node *
TAO_PSDL_Abstract_Storagetype_Body::abs_storagetype_member (void) const
{
  return this->abs_storagetype_member_;
}

TAO_PSDL_Node *
TAO_PSDL_Abstract_Storagetype_Body::abs_storagetype_body (void) const
{
  return this->abs_storagetype_body_;
}

int
TAO_PSDL_Abstract_Storagetype_Body::accept (TAO_PSDL_Node_Visitor *visitor)
{
  return visitor->visit_abstract_storagetype_body (this);
}

/// ****************************************************************

TAO_PSDL_Abstract_Storagetype_Member::TAO_PSDL_Abstract_Storagetype_Member (TAO_PSDL_Node *declaration)
  : declaration_ (declaration)
{
}

TAO_PSDL_Abstract_Storagetype_Member::~TAO_PSDL_Abstract_Storagetype_Member (void)
{
  delete this->declaration_;
}

TAO_PSDL_Node *
TAO_PSDL_Abstract_Storagetype_Member::declaration (void) const
{
  return this->declaration_;
}

int
TAO_PSDL_Abstract_Storagetype_Member::accept (TAO_PSDL_Node_Visitor *visitor)
{
  return visitor->visit_abstract_storagetype_member (this);
}

/// ****************************************************************

TAO_PSDL_Abstract_Storagetype_Inh_Spec::TAO_PSDL_Abstract_Storagetype_Inh_Spec (TAO_PSDL_Node *abs_storagetype_name)
  : abs_storagetype_name_ (abs_storagetype_name)
{
}

TAO_PSDL_Abstract_Storagetype_Inh_Spec::~TAO_PSDL_Abstract_Storagetype_Inh_Spec (void)
{
  delete this->abs_storagetype_name_;
}

TAO_PSDL_Node *
TAO_PSDL_Abstract_Storagetype_Inh_Spec::abs_storagetype_name (void) const
{
  return this->abs_storagetype_name_;
}

int
TAO_PSDL_Abstract_Storagetype_Inh_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
{
  return visitor->visit_abstract_storagetype_inh_spec (this);
}

/// ****************************************************************

TAO_PSDL_Abstract_Storagetype_Name::TAO_PSDL_Abstract_Storagetype_Name (TAO_PSDL_Node *scoped_name)
  : scoped_name_ (scoped_name),
    abs_storagetype_name_ (0)
{
}

TAO_PSDL_Abstract_Storagetype_Name::TAO_PSDL_Abstract_Storagetype_Name (
     TAO_PSDL_Node *scoped_name,
     TAO_PSDL_Node *abs_storagetype_name)
  : scoped_name_ (scoped_name),
    abs_storagetype_name_ (abs_storagetype_name)
{
}

TAO_PSDL_Abstract_Storagetype_Name::~TAO_PSDL_Abstract_Storagetype_Name (void)
{
  delete this->scoped_name_;
  if (this->abs_storagetype_name_ != 0)
    delete this->abs_storagetype_name_;
}

TAO_PSDL_Node *
TAO_PSDL_Abstract_Storagetype_Name::scoped_name (void) const
{
  return this->scoped_name_;
}

TAO_PSDL_Node *
TAO_PSDL_Abstract_Storagetype_Name::abs_storagetype_name (void) const
{
  return this->abs_storagetype_name_;
}

int
TAO_PSDL_Abstract_Storagetype_Name::accept (TAO_PSDL_Node_Visitor *visitor)
{
  return visitor->visit_abstract_storagetype_name (this);
}

/// ****************************************************************

TAO_PSDL_Psdl_State_Dcl::TAO_PSDL_Psdl_State_Dcl (TAO_PSDL_Node *key_word,
                                                  TAO_PSDL_Node *psdl_state_type_spec,
                                                  TAO_PSDL_Node *simple_declarator)
  : key_word_ (key_word),
    psdl_state_type_spec_ (psdl_state_type_spec),
    simple_declarator_ (simple_declarator)
{
}

TAO_PSDL_Psdl_State_Dcl::TAO_PSDL_Psdl_State_Dcl (TAO_PSDL_Node *psdl_state_type_spec,
                                                  TAO_PSDL_Node *simple_declarator)
  : key_word_ (0),
    psdl_state_type_spec_ (psdl_state_type_spec),
    simple_declarator_ (simple_declarator)
{
}

TAO_PSDL_Psdl_State_Dcl::~TAO_PSDL_Psdl_State_Dcl (void)
{
  if (this->key_word_ != 0)
    delete this->key_word_;
  delete this->psdl_state_type_spec_;
  delete this->simple_declarator_;
}

TAO_PSDL_Node *
TAO_PSDL_Psdl_State_Dcl::key_word (void) const
{
  return this->key_word_;
}

TAO_PSDL_Node *
TAO_PSDL_Psdl_State_Dcl::psdl_state_type_spec (void) const
{
  return this->psdl_state_type_spec_;
}

TAO_PSDL_Node *
TAO_PSDL_Psdl_State_Dcl::simple_declarator (void) const
{
  return this->simple_declarator_;
}

⌨️ 快捷键说明

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