adminproperties.cpp

来自「这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用」· C++ 代码 · 共 71 行

CPP
71
字号
// AdminProperties.cpp,v 1.7 2003/09/04 03:27:24 ossama Exp

#include "AdminProperties.h"

#if ! defined (__ACE_INLINE__)
#include "AdminProperties.inl"
#endif /* __ACE_INLINE__ */

ACE_RCSID (Notify, TAO_Notify_AdminProperties, "AdminProperties.cpp,v 1.7 2003/09/04 03:27:24 ossama Exp")

#include "orbsvcs/CosNotificationC.h"

TAO_Notify_AdminProperties::TAO_Notify_AdminProperties (void)
  : max_global_queue_length_ (CosNotification::MaxQueueLength, 0)
  , max_consumers_ (CosNotification::MaxConsumers, 0)
  , max_suppliers_ (CosNotification::MaxSuppliers, 0)
  , reject_new_events_ (CosNotification::RejectNewEvents, 0)
  , global_queue_length_ (0)
  , global_queue_not_full_condition_ (global_queue_lock_)
{
}

TAO_Notify_AdminProperties::~TAO_Notify_AdminProperties ()
{
}

int
TAO_Notify_AdminProperties::init (const CosNotification::PropertySeq& prop_seq)
{
  if (TAO_Notify_PropertySeq::init (prop_seq) != 0)
    return -1;

  this->max_global_queue_length_.set (*this);
  this->max_consumers_.set (*this);
  this->max_suppliers_.set (*this);
  this->reject_new_events_.set (*this);

  //@@ check if unsupported property was set.
  // This will happen when number of successfull inits != numbers of items bound in map_.

  return 0;
}

CORBA::Boolean
TAO_Notify_AdminProperties::queue_full (void)
{
  ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->global_queue_lock_, 1);

  if (this->max_global_queue_length () == 0)
    return 0;
  else
    if (this->global_queue_length_ > this->max_global_queue_length ().value ())
      return 1;

  return 0;
}

#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)

template class ACE_Atomic_Op<TAO_SYNCH_MUTEX,int>;
template class ACE_Atomic_Op_Ex<TAO_SYNCH_MUTEX,int>;
template class ACE_Refcounted_Auto_Ptr<TAO_Notify_AdminProperties, TAO_SYNCH_MUTEX>;

#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)

#pragma instantiate ACE_Atomic_Op<TAO_SYNCH_MUTEX,int>
#pragma instantiate ACE_Atomic_Op_Ex<TAO_SYNCH_MUTEX,int>
#pragma ACE_Refcounted_Auto_Ptr<TAO_Notify_AdminProperties, TAO_SYNCH_MUTEX>

#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */

⌨️ 快捷键说明

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