当前位置: 首页>>代码示例>>C++>>正文


C++ ACE_Service_Type::name方法代码示例

本文整理汇总了C++中ACE_Service_Type::name方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_Service_Type::name方法的具体用法?C++ ACE_Service_Type::name怎么用?C++ ACE_Service_Type::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ACE_Service_Type的用法示例。


在下文中一共展示了ACE_Service_Type::name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

int
ACE_Service_Repository::relocate_i (size_t begin,
                                    size_t end,
                                    const ACE_DLL& adll)
{
    ACE_SHLIB_HANDLE new_handle = adll.get_handle (0);

    for (size_t i = begin; i < end; i++)
    {
        ACE_Service_Type *type =
            const_cast<ACE_Service_Type *> (this->service_vector_[i]);

        ACE_SHLIB_HANDLE old_handle = (type == 0) ? ACE_SHLIB_INVALID_HANDLE
                                      : type->dll ().get_handle (0);

#ifndef ACE_NLOGGING
        if (ACE::debug ())
        {
            if (type == 0)
                ACE_DEBUG ((LM_DEBUG,
                            ACE_TEXT ("ACE (%P|%t) SR::relocate_i - repo=%@ [%d] (size=%d)")
                            ACE_TEXT (": skipping empty slot\n"),
                            this,
                            i,
                            this->total_size_));
            else
                ACE_DEBUG ((LM_DEBUG,
                            ACE_TEXT ("ACE (%P|%t) SR::relocate_i - repo=%@ [%d] (size=%d)")
                            ACE_TEXT (": trying name=%s, handle: %d -> %d\n"),
                            this,
                            i,
                            this->total_size_,
                            type->name (),
                            old_handle,
                            new_handle));
        }
#endif

        if (type != 0  // skip any gaps
                && old_handle == ACE_SHLIB_INVALID_HANDLE
                && new_handle != old_handle)
        {
#ifndef ACE_NLOGGING
            if (ACE::debug ())
                ACE_DEBUG ((LM_DEBUG,
                            ACE_TEXT ("ACE (%P|%t) SR::relocate_i - repo=%@ [%d] (size=%d)")
                            ACE_TEXT (": relocating name=%s, handle: %d -> %d\n"),
                            this,
                            i,
                            this->total_size_,
                            type->name (),
                            old_handle,
                            new_handle));
#endif
            type->dll (adll); // ups the refcount on adll
        }
    }

    return 0;
}
开发者ID:avesoft,项目名称:diamondcore2,代码行数:60,代码来源:Service_Repository.cpp

示例2: return

int
ACE_Service_Repository::fini (void)
{
    ACE_TRACE ("ACE_Service_Repository::fini");
    ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1));

    if (this->service_vector_ == 0)
        return 0;

    int retval = 0;

    // Do not be tempted to use the prefix decrement operator.  Use
    // postfix decrement operator since the index is unsigned and may
    // wrap around the 0
    for (size_t i = this->current_size_; i-- != 0;)
    {
        // <fini> the services in reverse order.
        ACE_Service_Type *s =
            const_cast<ACE_Service_Type *> (this->service_vector_[i]);

#ifndef ACE_NLOGGING
        if (ACE::debug ())
        {
            if (s != 0)
                ACE_DEBUG ((LM_DEBUG,
                            ACE_TEXT ("ACE (%P|%t) SR::fini, repo=%@ [%d] (%d), ")
                            ACE_TEXT ("name=%s, type=%@, object=%@, active=%d\n"),
                            this,
                            i,
                            this->total_size_,
                            s->name(),
                            s->type (),
                            (s->type () != 0) ? s->type ()->object () : 0,
                            s->active ()));
            else
                ACE_DEBUG ((LM_DEBUG,
                            ACE_TEXT ("ACE (%P|%t) SR::fini, repo=%@ [%d] (%d) -> 0\n"),
                            this,
                            i,
                            this->total_size_));
        }
#endif

        // Collect any errors.
        if (s != 0)
            retval += s->fini ();
    }

    return (retval == 0) ? 0 : -1;
}
开发者ID:avesoft,项目名称:diamondcore2,代码行数:50,代码来源:Service_Repository.cpp

示例3: return

int
ACE_Service_Repository::fini (void)
{
  ACE_TRACE ("ACE_Service_Repository::fini");
  ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1));

  int retval = 0;
  // Do not be tempted to use the prefix decrement operator.  Use
  // postfix decrement operator since the index is unsigned and may
  // wrap around the 0
  //
  // debug output for empty service entries
#ifndef ACE_NLOGGING
  if (ACE::debug ())
  {
    for (size_t i = this->service_array_.size (); i-- != 0;)
    {
      ACE_Service_Type *s =
        const_cast<ACE_Service_Type *> (this->service_array_[i]);
      if (s == 0)
        ACE_DEBUG ((LM_DEBUG,
                    ACE_TEXT ("ACE (%P|%t) SR::fini, repo=%@ [%d] -> 0\n"),
                    this,
                    i));
    }
  }
#endif
  //
  // Remove all the Service_Object and Stream instances
  //
  for (size_t i = this->service_array_.size (); i-- != 0;)
  {
    // <fini> the services in reverse order.
    ACE_Service_Type *s =
      const_cast<ACE_Service_Type *> (this->service_array_[i]);

    if (s != 0 &&
        s->type () != 0 &&
        (s->type ()->service_type () != ACE_Service_Type::MODULE))
    {
#ifndef ACE_NLOGGING
      if (ACE::debug ())
      {
        ACE_DEBUG ((LM_DEBUG,
                    ACE_TEXT ("ACE (%P|%t) SR::fini, repo=%@ [%d], ")
                    ACE_TEXT ("name=%s, type=%@, object=%@, active=%d\n"),
                    this,
                    i,
                    s->name (),
                    s->type (),
                    (s->type () != 0) ? s->type ()->object () : 0,
                    s->active ()));
      }
#endif

      // Collect any errors.
      retval += s->fini ();
    }
  }
  //
  // Remove all the Module instances
  //
  for (size_t i = this->service_array_.size (); i-- != 0;)
  {
    // <fini> the services in reverse order.
    ACE_Service_Type *s =
      const_cast<ACE_Service_Type *> (this->service_array_[i]);

    if (s != 0 &&
        s->type () != 0 &&
        (s->type ()->service_type () == ACE_Service_Type::MODULE))
    {
#ifndef ACE_NLOGGING
      if (ACE::debug ())
      {
        ACE_DEBUG ((LM_DEBUG,
                    ACE_TEXT ("ACE (%P|%t) SR::fini, repo=%@ [%d], ")
                    ACE_TEXT ("name=%s, type=%@, object=%@, active=%d\n"),
                    this,
                    i,
                    s->name (),
                    s->type (),
                    (s->type () != 0) ? s->type ()->object () : 0,
                    s->active ()));
      }
#endif
      // Collect any errors.
      retval += s->fini ();
    }
  }
  return (retval == 0) ? 0 : -1;
}
开发者ID:Dudelzack,项目名称:blizzlikecore,代码行数:92,代码来源:Service_Repository.cpp


注:本文中的ACE_Service_Type::name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。