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


C++ ACE_TRACE函数代码示例

本文整理汇总了C++中ACE_TRACE函数的典型用法代码示例。如果您正苦于以下问题:C++ ACE_TRACE函数的具体用法?C++ ACE_TRACE怎么用?C++ ACE_TRACE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: handle_parent

// Listing 5
// Listing 3 code/ch17
int handle_parent (char *cmdLine)
{
  ACE_TRACE (ACE_TEXT ("::handle_parent"));

  ALLOCATOR * shmem_allocator = 0;
  ACE_MMAP_Memory_Pool_Options options
    (ACE_DEFAULT_BASE_ADDR,
     ACE_MMAP_Memory_Pool_Options::ALWAYS_FIXED);

  ACE_NEW_RETURN
    (shmem_allocator,
     ALLOCATOR (BACKING_STORE, BACKING_STORE, &options),
     -1);

  MAP *map = smap (shmem_allocator);

  ACE_Process processa, processb;
  ACE_Process_Options poptions;
  poptions.command_line("%s a", cmdLine);
  {
    ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon,
                      coordMutex, -1);
    ACE_DEBUG ((LM_DEBUG,
                ACE_TEXT ("(%P|%t) Map has %d entries\n"),
                map->current_size ()));
    ACE_DEBUG ((LM_DEBUG,
                ACE_TEXT ("In parent, map is located at %@\n"),
                map));

    // Then have the child show and eat them up.
    processa.spawn (poptions);

    // First append a few records.
    addRecords (map, shmem_allocator);
  }


  {
    ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon,
                      coordMutex, -1);

    // Add a few more records..
    addRecords (map, shmem_allocator);

    // Let's see what's left.
    ACE_DEBUG ((LM_DEBUG,
                ACE_TEXT ("(%P|%t) Parent finished adding, ")
                ACE_TEXT ("map has %d entries\n"),
                map->current_size ()));

    // Have another child try to eat them up.
    processb.spawn (poptions);
  }

  processa.wait ();
  processb.wait ();

  // No processes are left and we don't want to keep the data
  // around anymore; it's now safe to remove it.
  // !!This will remove the backing store.!!
  shmem_allocator->remove ();
  delete shmem_allocator;
  return 0;
}
开发者ID:BackupTheBerlios,项目名称:pyasynchio-svn,代码行数:66,代码来源:Hash_Map.cpp

示例2: ACE_TRACE

void *
ACE_Function_Node::symbol (ACE_Service_Gestalt *,
                           int &yyerrno,
                           ACE_Service_Object_Exterminator *gobbler)
{
  typedef ACE_Service_Object *(*ACE_Service_Factory_Ptr)
    (ACE_Service_Object_Exterminator *);

  ACE_TRACE ("ACE_Function_Node::symbol");
  if (this->open_dll (yyerrno) == 0)
    {
      this->symbol_ = 0;

      // Locate the factory function <function_name> in the shared
      // object.
      ACE_TCHAR * const function_name =
        const_cast<ACE_TCHAR *> (this->function_name_);

      void * const func_p = this->dll_.symbol (function_name);
      if (func_p == 0)
        {
          ++yyerrno;

#ifndef ACE_NLOGGING
          if (ACE::debug ())
            {
              ACE_TCHAR * const errmsg = this->dll_.error ();
              ACELIB_ERROR ((LM_ERROR,
                          ACE_TEXT ("DLL::symbol failed for function %s: ")
                          ACE_TEXT ("%s\n"),
                          function_name,
                          errmsg ? errmsg : ACE_TEXT ("no error reported")));
            }
#endif /* ACE_NLOGGING */

          return 0;
        }

#if defined (ACE_OPENVMS) && (!defined (__INITIAL_POINTER_SIZE) || (__INITIAL_POINTER_SIZE < 64))
      int const temp_p = reinterpret_cast<int> (func_p);
#else
      intptr_t const temp_p = reinterpret_cast<intptr_t> (func_p);
#endif

      ACE_Service_Factory_Ptr func =
        reinterpret_cast<ACE_Service_Factory_Ptr> (temp_p);

      // Invoke the factory function and record it's return value.
      this->symbol_ = (*func) (gobbler);

      if (this->symbol_ == 0)
        {
          ++yyerrno;
          if (ACE::debug ())
            {
              ACELIB_ERROR ((LM_ERROR,
                         ACE_TEXT ("%p\n"),
                         this->function_name_));
            }
          return 0;
        }
    }
  return this->symbol_;
}
开发者ID:esohns,项目名称:ATCD,代码行数:64,代码来源:Parse_Node.cpp

示例3: ACE_TRACE

// Constructor.
ACE_GQoS_Session::ACE_GQoS_Session (void)
{
  ACE_TRACE ("ACE_GQoS_Session::ACE_GQoS_Session");
}
开发者ID:binary42,项目名称:OCI,代码行数:5,代码来源:QoS_Session_Impl.cpp

示例4: process

 virtual int process (Message *message)
 {
     ACE_TRACE (ACE_TEXT ("ReleaseDevice::process()"));
     message->recorder ()->release ();
     return 0;
 }
开发者ID:helixum,项目名称:wow-cata,代码行数:6,代码来源:Answerer.cpp

示例5: ACE_TRACE

int
ACE_System_Time::sync_local_system_time (ACE_System_Time::Sync_Mode)
{
  ACE_TRACE ("ACE_System_Time::sync_local_system_time");
  ACE_NOTSUP_RETURN (-1);
}
开发者ID:Adeer,项目名称:OregonCore,代码行数:6,代码来源:System_Time.cpp

示例6: ACE_TRACE

/* VIRTUAL */ int
ACE_Token_Handler::recv_request (void)
{
  ACE_TRACE ("ACE_Token_Handler::recv_request");
  ssize_t n;

  // Read the first 4 bytes to get the length of the message
  // This implementation assumes that the first 4 bytes are
  // the length of the message.
  n = this->peer ().recv ((void *) &this->token_request_,
                          sizeof (ACE_UINT32));

  switch (n)
    {
    case -1:
      /* FALLTHROUGH */
    default:
      ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p got %d bytes, expected %d bytes\n"),
                  ACE_TEXT ("recv failed"), n, sizeof (ACE_UINT32)));
      /* FALLTHROUGH */
    case 0:
      // We've shutdown unexpectedly, let's abandon the connection.
      this->abandon (0);
      return -1;
      /* NOTREACHED */
    case sizeof (ACE_UINT32):
      {
        // Transform the length into host byte order.
        ssize_t length = this->token_request_.length ();

        // Do a sanity check on the length of the message.
        if (length > (ssize_t) sizeof this->token_request_)
          {
            ACE_ERROR ((LM_ERROR, ACE_TEXT ("length %d too long\n"), length));
            return this->abandon (1);
          }

        // Receive the rest of the request message.
        // @@ beware of blocking read!!!.
        n = this->peer ().recv ((void *) (((char *) &this->token_request_)
                                          + sizeof (ACE_UINT32)),
                                length - sizeof (ACE_UINT32));

        // Subtract off the size of the part we skipped over...
        if (n != (length - (ssize_t) sizeof (ACE_UINT32)))
          {
            ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p expected %d, got %d\n"),
                        ACE_TEXT ("invalid length"), length, n));
            return this->abandon (1);
          }

        // Decode the request into host byte order.
        if (this->token_request_.decode () == -1)
          {
            ACE_ERROR
              ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("decode failed")));
            return this->abandon (1);
          }

        // if (OS::debug)
        this->token_request_.dump ();
      }
    }
  return 0;
}
开发者ID:binghuo365,项目名称:BaseLab,代码行数:65,代码来源:Token_Handler.cpp

示例7: ACE_TRACE

ACE_Framework_Repository::~ACE_Framework_Repository (void)
{
    ACE_TRACE ("ACE_Framework_Repository::~ACE_Framework_Repository");
    this->close ();
}
开发者ID:Exodius,项目名称:SignumCore,代码行数:5,代码来源:Framework_Component.cpp

示例8: foo

void foo (void)
{
  ACE_TRACE ("foo");

  ACE_DEBUG ((LM_INFO, ACE_TEXT ("%IHowdy Pardner\n")));
}
开发者ID:CCJY,项目名称:ACE,代码行数:6,代码来源:Use_Stderr.cpp

示例9: ACE_Parse_Node

ACE_Suspend_Node::ACE_Suspend_Node (const ACE_TCHAR *name)
  : ACE_Parse_Node (name)
{
  ACE_TRACE ("ACE_Suspend_Node::ACE_Suspend_Node");
}
开发者ID:esohns,项目名称:ATCD,代码行数:5,代码来源:Parse_Node.cpp

示例10: ACE_TRACE

void *
ACE_MEM_Addr::get_addr (void) const
{
  ACE_TRACE ("ACE_MEM_Addr::get_addr");
  return this->external_.get_addr ();
}
开发者ID:BackupTheBerlios,项目名称:pyasynchio-svn,代码行数:6,代码来源:MEM_Addr.cpp

示例11: ACE_Addr

ACE_MEM_Addr::ACE_MEM_Addr (u_short port_number)
  : ACE_Addr (AF_INET, sizeof (ACE_MEM_Addr))
{
  ACE_TRACE ("ACE_MEM_Addr::ACE_MEM_Addr");
  this->initialize_local (port_number);
}
开发者ID:BackupTheBerlios,项目名称:pyasynchio-svn,代码行数:6,代码来源:MEM_Addr.cpp

示例12: name_

ACE_Parse_Node::ACE_Parse_Node (void)
  : name_ (0),
    next_ (0)
{
  ACE_TRACE ("ACE_Parse_Node::ACE_Parse_Node");
}
开发者ID:esohns,项目名称:ATCD,代码行数:6,代码来源:Parse_Node.cpp

示例13: function_name_

ACE_Static_Function_Node::ACE_Static_Function_Node (const ACE_TCHAR *func_name)
  : function_name_ (ACE::strnew (func_name))
{
  ACE_TRACE ("ACE_Static_Function_Node::ACE_Static_Function_Node");
  this->must_delete_ = 1;
}
开发者ID:esohns,项目名称:ATCD,代码行数:6,代码来源:Parse_Node.cpp

示例14: ACE_TRACE

ACE_LSOCK_Acceptor::ACE_LSOCK_Acceptor (void)
{
  ACE_TRACE ("ACE_LSOCK_Acceptor::ACE_LSOCK_Acceptor");
}
开发者ID:asir6,项目名称:Colt,代码行数:4,代码来源:LSOCK_Acceptor.cpp

示例15: ACE_TRACE

void *
ACE_Shared_Memory_Pool::base_addr (void) const
{
    ACE_TRACE ("ACE_Shared_Memory_Pool::base_addr");
    return this->base_addr_;
}
开发者ID:svn2github,项目名称:ACE-Middleware,代码行数:6,代码来源:Shared_Memory_Pool.cpp


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