📄 be_interface_strategy.cpp
字号:
delete [] this->full_remote_proxy_impl_name_;
this->full_remote_proxy_impl_name_ = 0;
}
if (this->full_thruPOA_proxy_impl_name_ != 0)
{
delete [] this->full_thruPOA_proxy_impl_name_;
this->full_thruPOA_proxy_impl_name_ = 0;
}
if (this->full_direct_proxy_impl_name_ != 0)
{
delete [] this->full_direct_proxy_impl_name_;
this->full_direct_proxy_impl_name_ = 0;
}
if (this->base_proxy_broker_ != 0)
{
delete [] this->base_proxy_broker_;
this->base_proxy_broker_ = 0;
}
if (this->remote_proxy_broker_ != 0)
{
delete [] this->remote_proxy_broker_;
this->remote_proxy_broker_ = 0;
}
if (this->strategized_proxy_broker_ != 0)
{
delete [] this->strategized_proxy_broker_;
this->strategized_proxy_broker_ = 0;
}
if (this->full_base_proxy_broker_name_ != 0)
{
delete [] this->full_base_proxy_broker_name_;
this->full_base_proxy_broker_name_ = 0;
}
if (this->full_remote_proxy_broker_name_ != 0)
{
delete [] this->full_remote_proxy_broker_name_;
this->full_remote_proxy_broker_name_ = 0;
}
if (this->full_strategized_proxy_broker_name_ != 0)
{
delete [] this->full_strategized_proxy_broker_name_;
this->full_strategized_proxy_broker_name_ = 0;
}
if (this->client_scope_ != 0)
{
delete [] this->client_scope_;
this->client_scope_ = 0;
}
if (this->flat_client_scope_ != 0)
{
delete [] this->flat_client_scope_;
this->flat_client_scope_ = 0;
}
if (this->server_scope_ != 0)
{
delete [] this->server_scope_;
this->server_scope_ = 0;
}
if (this->flat_server_scope_ != 0)
{
delete [] this->flat_server_scope_;
this->flat_server_scope_ = 0;
}
}
const char *
be_interface_default_strategy::full_name (void)
{
if (this->full_name_ == 0)
{
size_t len = ACE_OS::strlen (node_->be_decl::full_name ());
ACE_NEW_RETURN (this->full_name_,
char[len + 1],
0);
ACE_OS::strcpy (this->full_name_,
node_->be_decl::full_name ());
}
return this->full_name_;
}
const char *
be_interface_default_strategy::local_name (void)
{
if (!this->local_name_)
{
size_t len =
ACE_OS::strlen (node_->AST_Interface::local_name ()->get_string ());
ACE_NEW_RETURN (this->local_name_,
char[len + 1],
0);
ACE_OS::strcpy (this->local_name_,
node_->AST_Interface::local_name ()->get_string ());
}
return this->local_name_;
}
const char *
be_interface_default_strategy::flat_name (void)
{
if (!this->flat_name_)
{
size_t len = ACE_OS::strlen (node_->be_decl::flat_name ());
ACE_NEW_RETURN (this->flat_name_,
char[len + 1],
0);
ACE_OS::strcpy (this->flat_name_,
node_->be_decl::flat_name ());
}
return this->flat_name_;
}
const char *
be_interface_default_strategy::repoID (void)
{
if (this->repoID_ == 0)
{
size_t len = ACE_OS::strlen (node_->be_decl::repoID ());
ACE_NEW_RETURN (this->repoID_,
char[len + 1],
0);
ACE_OS::strcpy (this->repoID_,
node_->be_decl::repoID ());
}
return this->repoID_;
}
const char *
be_interface_default_strategy::full_skel_name (void)
{
if (this->full_skel_name_ == 0)
{
// the following method is inherited from the base class
node_->compute_full_skel_name ("POA_",
this->full_skel_name_);
}
return this->full_skel_name_;
}
const char *
be_interface_default_strategy::full_coll_name (int type)
{
this->compute_coll_names (type,
0, // prefix
0); // suffix
return this->full_coll_name_;
}
const char *
be_interface_default_strategy::local_coll_name (int type)
{
this->compute_coll_names (type,
0, // prefix
0); // suffix
return this->local_coll_name_;
}
char *
be_interface_default_strategy::create_with_prefix_suffix (
const char *prefix,
const char *str,
const char *suffix,
const char *separator
)
{
char *cat_string = 0;
size_t length =
ACE_OS::strlen (str) +
ACE_OS::strlen (prefix) +
ACE_OS::strlen (suffix) +
ACE_OS::strlen (separator) +
1; // The '/0'
ACE_NEW_RETURN (cat_string,
char[length],
0);
ACE_OS::strcpy (cat_string, prefix);
ACE_OS::strcat (cat_string, str);
ACE_OS::strcat (cat_string, separator);
ACE_OS::strcat (cat_string, suffix);
return cat_string;
}
const char *
be_interface_default_strategy::base_proxy_impl_name (void)
{
if (this->base_proxy_impl_name_ != 0)
{
return this->base_proxy_impl_name_;
}
this->base_proxy_impl_name_ =
this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
this->node_->local_name (),
this->suffix_table_[PROXY_IMPL]);
return this->base_proxy_impl_name_;
}
const char *
be_interface_default_strategy::client_scope (void)
{
if (this->client_scope_ != 0)
{
return this->client_scope_;
}
const char *full_name = this->full_name ();
const char *name = this->local_name ();
size_t offset = ACE_OS::strlen (name);
size_t length = ACE_OS::strlen (full_name) - offset;
ACE_NEW_RETURN (this->client_scope_,
char[length + 1],
0);
ACE_OS::strncpy (this->client_scope_, full_name, length);
this->client_scope_[length] = '\0';
return this->client_scope_;
}
const char *
be_interface_default_strategy::flat_client_scope (void)
{
if (this->flat_client_scope_ != 0)
{
return this->flat_client_scope_;
}
const char *full_name = this->flat_name ();
const char *name = this->local_name ();
size_t offset = ACE_OS::strlen (name);
size_t length = ACE_OS::strlen (full_name) - offset;
ACE_NEW_RETURN (this->flat_client_scope_,
char[length + 1],
0);
ACE_OS::strncpy (this->flat_client_scope_, full_name, length);
this->flat_client_scope_[length] = '\0';
return this->flat_client_scope_;
}
const char *
be_interface_default_strategy::server_scope (void)
{
if (this->server_scope_ != 0)
{
return this->server_scope_;
}
const char *full_name =
this->node_->full_coll_name (be_interface::DIRECT);
const char *name = this->node_->local_coll_name (be_interface::DIRECT);
size_t offset = ACE_OS::strlen (name);
size_t length = ACE_OS::strlen (full_name) - offset;
ACE_NEW_RETURN (this->server_scope_,
char[length + 1],
0);
ACE_OS::strncpy (this->server_scope_, full_name, length);
this->server_scope_[length] = '\0';
return this->server_scope_;
}
const char *
be_interface_default_strategy::flat_server_scope (void)
{
if (this->flat_server_scope_ != 0)
{
return this->flat_server_scope_;
}
const char *full_name = this->flat_name ();
const char *name = this->local_name ();
size_t offset = ACE_OS::strlen (name);
size_t length = ACE_OS::strlen (full_name) - offset;
ACE_NEW_RETURN (this->flat_client_scope_,
char[length + 1],
0);
ACE_OS::strncpy (this->flat_server_scope_, full_name, length);
this->flat_server_scope_[length] = '\0';
return this->flat_server_scope_;
}
const char *
be_interface_default_strategy::full_base_proxy_impl_name (void)
{
if (this->full_base_proxy_impl_name_ != 0)
{
return this->full_base_proxy_impl_name_;
}
const char *scope = this->client_scope ();
const char *base_name = this->base_proxy_impl_name ();
size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
ACE_NEW_RETURN (this->full_base_proxy_impl_name_,
char[length + 1],
0);
ACE_OS::strcpy (this->full_base_proxy_impl_name_, scope);
ACE_OS::strcat (this->full_base_proxy_impl_name_, base_name);
return this->full_base_proxy_impl_name_;
}
const char *
be_interface_default_strategy::remote_proxy_impl_name (void)
{
if (this->remote_proxy_impl_name_ != 0)
{
return this->remote_proxy_impl_name_;
}
this->remote_proxy_impl_name_ =
this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
this->node_->local_name (),
this->suffix_table_[PROXY_IMPL],
this->tag_table_[REMOTE]);
return this->remote_proxy_impl_name_;
}
const char *
be_interface_default_strategy::full_remote_proxy_impl_name (void)
{
if (this->full_remote_proxy_impl_name_ != 0)
{
return this->full_remote_proxy_impl_name_;
}
const char *scope = this->client_scope ();
const char *base_name = this->remote_proxy_impl_name ();
size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
ACE_NEW_RETURN (this->full_remote_proxy_impl_name_,
char[length + 1],
0);
ACE_OS::strcpy (this->full_remote_proxy_impl_name_, scope);
ACE_OS::strcat (this->full_remote_proxy_impl_name_, base_name);
return this->full_remote_proxy_impl_name_;
}
const char *
be_interface_default_strategy::thru_poa_proxy_impl_name (void)
{
if (this->thruPOA_proxy_impl_name_ != 0)
{
return this->thruPOA_proxy_impl_name_;
}
this->thruPOA_proxy_impl_name_ =
this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
this->node_->local_name (),
this->suffix_table_[PROXY_IMPL],
this->tag_table_[THRU_POA]);
return this->thruPOA_proxy_impl_name_;
}
const char *
be_interface_default_strategy::full_thru_poa_proxy_impl_name (void)
{
if (this->full_thruPOA_proxy_impl_name_ != 0)
{
return this->full_thruPOA_proxy_impl_name_;
}
const char *scope = this->server_scope ();
const char *base_name = this->thru_poa_proxy_impl_name ();
size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
ACE_NEW_RETURN (this->full_thruPOA_proxy_impl_name_,
char[length + 1],
0);
ACE_OS::strcpy (this->full_thruPOA_proxy_impl_name_, scope);
ACE_OS::strcat (this->full_thruPOA_proxy_impl_name_, base_name);
return this->full_thruPOA_proxy_impl_name_;
}
const char *
be_interface_default_strategy::direct_proxy_impl_name (void)
{
if (this->direct_proxy_impl_name_ != 0)
{
return this->direct_proxy_impl_name_;
}
this->direct_proxy_impl_name_ =
this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
this->node_->local_name (),
this->suffix_table_[PROXY_IMPL],
this->tag_table_[DIRECT]);
return this->direct_proxy_impl_name_;
}
const char *
be_interface_default_strategy::full_direct_proxy_impl_name (void)
{
if (this->full_direct_proxy_impl_name_ != 0)
{
return this->full_direct_proxy_impl_name_;
}
const char *scope = this->server_scope ();
const char *base_name = this->direct_proxy_impl_name ();
size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
ACE_NEW_RETURN (this->full_direct_proxy_impl_name_,
char[length + 1],
0);
ACE_OS::strcpy (this->full_direct_proxy_impl_name_, scope);
ACE_OS::strcat (this->full_direct_proxy_impl_name_, base_name);
return this->full_direct_proxy_impl_name_;
}
const char *
be_interface_default_strategy::base_proxy_broker_name (void)
{
if (this->base_proxy_broker_ != 0)
{
return this->base_proxy_broker_;
}
this->base_proxy_broker_ =
this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
this->node_->local_name (),
this->suffix_table_[PROXY_BROKER]);
return this->base_proxy_broker_;
}
const char *
be_interface_default_strategy::full_base_proxy_broker_name (void)
{
if (this->full_base_proxy_broker_name_ != 0)
{
return this->full_base_proxy_broker_name_;
}
const char *scope = this->client_scope ();
const char *base_name = this->base_proxy_broker_name ();
size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
ACE_NEW_RETURN (this->full_base_proxy_broker_name_,
char[length + 1],
0);
ACE_OS::strcpy (this->full_base_proxy_broker_name_, scope);
ACE_OS::strcat (this->full_base_proxy_broker_name_, base_name);
return this->full_base_proxy_broker_name_;
}
const char *
be_interface_default_strategy::remote_proxy_broker_name (void)
{
if (this->remote_proxy_broker_ != 0)
{
return this->remote_proxy_broker_;
}
this->remote_proxy_broker_ =
this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
this->node_->local_name (),
this->suffix_table_[PROXY_BROKER],
this->tag_table_[REMOTE]);
return this->remote_proxy_broker_;
}
const char *
be_interface_default_strategy::full_remote_proxy_broker_name (void)
{
if (this->full_remote_proxy_broker_name_ != 0)
{
return this->full_remote_proxy_broker_name_;
}
const char *scope = this->client_scope ();
const char *base_name = this->remote_proxy_broker_name ();
size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
ACE_NEW_RETURN (this->full_remote_proxy_broker_name_,
char[length + 1],
0);
ACE_OS::strcpy (this->full_remote_proxy_broker_name_, scope);
ACE_OS::strcat (this->full_remote_proxy_broker_name_, base_name);
return this->full_remote_proxy_broker_name_;
}
const char *
be_interface_default_strategy::strategized_proxy_broker_name (void)
{
if (this->strategized_proxy_broker_ != 0)
{
return this->strategized_proxy_broker_;
}
this->strategized_proxy_broker_ =
this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
this->node_->local_name (),
this->suffix_table_[PROXY_BROKER],
this->tag_table_[STRATEGIZED]);
return this->strategized_proxy_broker_;
}
const char *
be_interface_default_strategy::full_strategized_proxy_broker_name (void)
{
if (this->full_strategized_proxy_broker_name_ != 0)
{
return this->full_strategized_proxy_broker_name_;
}
const char *scope = this->server_scope ();
const char *base_name = this->strategized_proxy_broker_name ();
size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
ACE_NEW_RETURN (this->full_strategized_proxy_broker_name_,
char[length + 1],
0);
ACE_OS::strcpy (this->full_strategized_proxy_broker_name_, scope);
ACE_OS::strcat (this->full_strategized_proxy_broker_name_, base_name);
return this->full_strategized_proxy_broker_name_;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -