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

📄 ec_default_factory.cpp

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 CPP
📖 第 1 页 / 共 4 页
字号:
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_List_Iterator,
      ACE_NULL_SYNCH> ();
  else if (this->consumer_collection_ == 0x110)
    return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,
      ACE_Null_Mutex> ();
  else if (this->consumer_collection_ == 0x111)
    return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,
      ACE_Null_Mutex> ();
  else if (this->consumer_collection_ == 0x112)
    return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,
      ACE_NULL_SYNCH> ();
  else if (this->consumer_collection_ == 0x113)
    return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,
      ACE_NULL_SYNCH> ();

  return 0;
}

void
TAO_EC_Default_Factory::destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection *x)
{
  delete x;
}

TAO_EC_ProxyPushSupplier_Collection*
TAO_EC_Default_Factory::create_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base *)
{
  if (this->supplier_collection_ == 0x000)
    return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_List_Iterator,
      TAO_SYNCH_MUTEX> ();
  else if (this->supplier_collection_ == 0x001)
    return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_List_Iterator,
      TAO_SYNCH_MUTEX> ();
  else if (this->supplier_collection_ == 0x002)
    return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_List_Iterator,
      ACE_SYNCH> ();
  else if (this->supplier_collection_ == 0x003)
    return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_List_Iterator,
      ACE_SYNCH> ();
  else if (this->supplier_collection_ == 0x010)
    return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_RB_Tree_Iterator,
      TAO_SYNCH_MUTEX> ();
  else if (this->supplier_collection_ == 0x011)
    return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_RB_Tree_Iterator,
      TAO_SYNCH_MUTEX> ();
  else if (this->supplier_collection_ == 0x012)
    return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_RB_Tree_Iterator,
      ACE_SYNCH> ();
  else if (this->supplier_collection_ == 0x013)
    return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_RB_Tree_Iterator,
      ACE_SYNCH> ();
  else if (this->supplier_collection_ == 0x100)
    return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_List_Iterator,
      ACE_Null_Mutex> ();
  else if (this->supplier_collection_ == 0x101)
    return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_List_Iterator,
      ACE_Null_Mutex> ();
  else if (this->supplier_collection_ == 0x102)
    return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_List_Iterator,
      ACE_NULL_SYNCH> ();
  else if (this->supplier_collection_ == 0x103)
    return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_List_Iterator,
      ACE_NULL_SYNCH> ();
  else if (this->supplier_collection_ == 0x110)
    return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_RB_Tree_Iterator,
      ACE_Null_Mutex> ();
  else if (this->supplier_collection_ == 0x111)
    return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_RB_Tree_Iterator,
      ACE_Null_Mutex> ();
  else if (this->supplier_collection_ == 0x112)
    return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_RB_Tree_Iterator,
      ACE_NULL_SYNCH> ();
  else if (this->supplier_collection_ == 0x113)
    return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
      TAO_EC_Supplier_RB_Tree_Iterator,
      ACE_NULL_SYNCH> ();

  return 0;
}

void
TAO_EC_Default_Factory::destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_Collection *x)
{
  delete x;
}

ACE_Lock*
TAO_EC_Default_Factory::create_consumer_lock (void)
{
  if (this->consumer_lock_ == 0)
    return new ACE_Lock_Adapter<ACE_Null_Mutex>;
  else if (this->consumer_lock_ == 1)
    return new ACE_Lock_Adapter<TAO_SYNCH_MUTEX> ();
  else if (this->consumer_lock_ == 2)
    return new ACE_Lock_Adapter<TAO_SYNCH_RECURSIVE_MUTEX> ();
  return 0;
}

void
TAO_EC_Default_Factory::destroy_consumer_lock (ACE_Lock* x)
{
  delete x;
}

ACE_Lock*
TAO_EC_Default_Factory::create_supplier_lock (void)
{
  if (this->supplier_lock_ == 0)
    return new ACE_Lock_Adapter<ACE_Null_Mutex>;
  else if (this->supplier_lock_ == 1)
    return new ACE_Lock_Adapter<TAO_SYNCH_MUTEX> ();
  else if (this->supplier_lock_ == 2)
    return new ACE_Lock_Adapter<TAO_SYNCH_RECURSIVE_MUTEX> ();
  return 0;
}

void
TAO_EC_Default_Factory::destroy_supplier_lock (ACE_Lock* x)
{
  delete x;
}

TAO_EC_ConsumerControl*
TAO_EC_Default_Factory::create_consumer_control (TAO_EC_Event_Channel_Base* ec)
{
  if (this->consumer_control_ == 0)
    return new TAO_EC_ConsumerControl ();
  else if (this->consumer_control_ == 1)
    {
      int argc = 0;
      char **argv = 0;
      CORBA::ORB_var orb =
        CORBA::ORB_init (argc, argv, this->orbid_.c_str ());

      ACE_Time_Value rate (0, this->consumer_control_period_);
      return new TAO_EC_Reactive_ConsumerControl (rate, consumer_control_timeout_, ec, orb.in ());
    }
  return 0;
}

void
TAO_EC_Default_Factory::destroy_consumer_control (TAO_EC_ConsumerControl* x)
{
  delete x;
}

TAO_EC_SupplierControl*
TAO_EC_Default_Factory::create_supplier_control (TAO_EC_Event_Channel_Base* ec)
{
  if (this->supplier_control_ == 0)
    return new TAO_EC_SupplierControl ();
  else if (this->supplier_control_ == 1)
    {
      int argc = 0;
      char **argv = 0;
      CORBA::ORB_var orb =
        CORBA::ORB_init (argc, argv, this->orbid_.c_str ());

      ACE_Time_Value rate (0, this->supplier_control_period_);
      return new TAO_EC_Reactive_SupplierControl (rate, supplier_control_timeout_, ec, orb.in ());
    }
  return 0;
}

void
TAO_EC_Default_Factory::destroy_supplier_control (TAO_EC_SupplierControl* x)
{
  delete x;
}

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

ACE_STATIC_SVC_DEFINE (TAO_EC_Default_Factory,
                       ACE_TEXT ("EC_Factory"),
                       ACE_SVC_OBJ_T,
                       &ACE_SVC_NAME (TAO_EC_Default_Factory),
                       ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
                       0)
ACE_FACTORY_DEFINE (TAO_RTEvent, TAO_EC_Default_Factory)

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

#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)

template class ACE_Node<ACE_Command_Base*>;
template class ACE_Unbounded_Queue<ACE_Command_Base*>;
template class ACE_Unbounded_Queue_Iterator<ACE_Command_Base*>;
template class ACE_Unbounded_Set<ACE_Static_Svc_Descriptor*>;
template class ACE_Unbounded_Set_Iterator<ACE_Static_Svc_Descriptor*>;
template class ACE_Node<ACE_Static_Svc_Descriptor*>;

template class TAO_ESF_Proxy_Collection<TAO_EC_ProxyPushConsumer>;
template class TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>;
template class TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>;
template class ACE_Unbounded_Set_Ex<TAO_EC_ProxyPushConsumer *>;
template class ACE_Node<TAO_EC_ProxyPushConsumer *>;
template class ACE_Unbounded_Set_Ex_Iterator<TAO_EC_ProxyPushConsumer *>;
template class ACE_RB_Tree<TAO_EC_ProxyPushConsumer *, int, ACE_Less_Than<TAO_EC_ProxyPushConsumer *>, ACE_Null_Mutex>;
template class ACE_RB_Tree_Iterator<TAO_EC_ProxyPushConsumer *, int, ACE_Less_Than<TAO_EC_ProxyPushConsumer *>, ACE_Null_Mutex>;
template class ACE_RB_Tree_Reverse_Iterator<TAO_EC_ProxyPushConsumer *, int, ACE_Less_Than<TAO_EC_ProxyPushConsumer *>, ACE_Null_Mutex>;
template class ACE_RB_Tree_Iterator_Base<TAO_EC_ProxyPushConsumer *, int, ACE_Less_Than<TAO_EC_ProxyPushConsumer *>, ACE_Null_Mutex>;
template class ACE_RB_Tree_Node<TAO_EC_ProxyPushConsumer *, int>;
template class ACE_Less_Than<TAO_EC_ProxyPushConsumer *>;
template class TAO_ESF_Proxy_RB_Tree_Iterator<TAO_EC_ProxyPushConsumer>;

template class TAO_ESF_Copy_On_Write_Collection<
    TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
    TAO_EC_Consumer_List_Iterator >;
template class TAO_ESF_Copy_On_Write_Collection<
    TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
    TAO_EC_Supplier_List_Iterator >;
template class TAO_ESF_Copy_On_Write_Collection<
    TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
    TAO_EC_Consumer_RB_Tree_Iterator >;
template class TAO_ESF_Copy_On_Write_Collection<
    TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
    TAO_EC_Supplier_RB_Tree_Iterator >;

template class TAO_ESF_Proxy_Collection<TAO_EC_ProxyPushSupplier>;
template class TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>;
template class TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>;
template class ACE_Unbounded_Set_Ex<TAO_EC_ProxyPushSupplier *>;
template class ACE_Node<TAO_EC_ProxyPushSupplier *>;
template class ACE_Unbounded_Set_Ex_Iterator<TAO_EC_ProxyPushSupplier *>;
template class ACE_RB_Tree<TAO_EC_ProxyPushSupplier *, int, ACE_Less_Than<TAO_EC_ProxyPushSupplier *>, ACE_Null_Mutex>;
template class ACE_RB_Tree_Iterator<TAO_EC_ProxyPushSupplier *, int, ACE_Less_Than<TAO_EC_ProxyPushSupplier *>, ACE_Null_Mutex>;
template class ACE_RB_Tree_Iterator_Base<TAO_EC_ProxyPushSupplier *, int, ACE_Less_Than<TAO_EC_ProxyPushSupplier *>, ACE_Null_Mutex>;
template class ACE_RB_Tree_Reverse_Iterator<TAO_EC_ProxyPushSupplier *, int, ACE_Less_Than<TAO_EC_ProxyPushSupplier *>, ACE_Null_Mutex>;
template class ACE_RB_Tree_Node<TAO_EC_ProxyPushSupplier *, int>;
template class ACE_Less_Than<TAO_EC_ProxyPushSupplier *>;
template class TAO_ESF_Proxy_RB_Tree_Iterator<TAO_EC_ProxyPushSupplier>;

#if defined (ACE_HAS_THREADS)
//
// To avoid duplicate instantiations of templates we must put the MT
// versions on this #ifdef, otherwise the ACE_SYNCH* macros expand to
// the ACE_NULL* versions, duplicating the non-MT versions below.
// We *cannot* use explicit ACE_Synch classes because that will not
// compile in platforms without threads.
//
template class TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_List_Iterator,
      TAO_SYNCH_MUTEX>;
template class TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
     TAO_EC_Consumer_List_Iterator,
      TAO_SYNCH_MUTEX>;
template class TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_List_Iterator,
      ACE_SYNCH>;
template class TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_List_Iterator,
      ACE_SYNCH>;
template class TAO_ESF_Busy_Lock_Adapter<
  TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_List_Iterator,
      ACE_SYNCH> >;
template class ACE_Guard< TAO_ESF_Busy_Lock_Adapter<
  TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_List_Iterator,
      ACE_SYNCH> > >;
template class TAO_ESF_Connected_Command<
  TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_List_Iterator,
      ACE_SYNCH>,TAO_EC_ProxyPushConsumer >;
template class TAO_ESF_Reconnected_Command<
  TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_List_Iterator,
      ACE_SYNCH>,TAO_EC_ProxyPushConsumer >;
template class TAO_ESF_Disconnected_Command<
  TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_List_Iterator,
      ACE_SYNCH>,TAO_EC_ProxyPushConsumer >;
template class TAO_ESF_Shutdown_Command<
  TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_List_Iterator,
      ACE_SYNCH> >;
template class TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,
      TAO_SYNCH_MUTEX>;
template class TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,
      TAO_SYNCH_MUTEX>;
template class TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,
      ACE_SYNCH>;
template class TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,
      ACE_SYNCH>;
template class TAO_ESF_Busy_Lock_Adapter<
  TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,
      ACE_SYNCH> >;
template class ACE_Guard< TAO_ESF_Busy_Lock_Adapter<
  TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,
      ACE_SYNCH> > >;
template class TAO_ESF_Connected_Command<
  TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,
      ACE_SYNCH>,TAO_EC_ProxyPushConsumer >;
template class TAO_ESF_Reconnected_Command<
  TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,
      ACE_SYNCH>,TAO_EC_ProxyPushConsumer >;
template class TAO_ESF_Disconnected_Command<
  TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
      TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
      TAO_EC_Consumer_RB_Tree_Iterator,

⌨️ 快捷键说明

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