propertyseq.cpp

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

CPP
55
字号
// PropertySeq.cpp,v 1.5 2003/07/06 21:41:59 pradeep Exp

#include "PropertySeq.h"

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

ACE_RCSID(Notify, TAO_Notify_PropertySeq, "PropertySeq.cpp,v 1.5 2003/07/06 21:41:59 pradeep Exp")

TAO_Notify_PropertySeq::TAO_Notify_PropertySeq (void)
{
}

TAO_Notify_PropertySeq::~TAO_Notify_PropertySeq ()
{
}

int
TAO_Notify_PropertySeq::init (const CosNotification::PropertySeq& prop_seq)
{
  ACE_CString name;

  for (CORBA::ULong i = 0; i < prop_seq.length (); ++i)
    {
      name = prop_seq[i].name.in ();

      if (this->property_map_.rebind (name, prop_seq[i].value) == -1)
        return -1;
    }
  // Note call to rebind. This allows to call <init> to set updates.

  return 0;
}

int
TAO_Notify_PropertySeq::populate (CosNotification::PropertySeq_var& prop_seq)
{
  PROPERTY_MAP::ITERATOR iterator (this->property_map_);

  int index = prop_seq->length ();
  prop_seq->length (ACE_static_cast (CORBA::ULong,
                        index + this->property_map_.current_size ()));

  for (PROPERTY_MAP::ENTRY *entry = 0;
       iterator.next (entry) != 0;
       iterator.advance (), ++index)
    {
      (*prop_seq)[index].name = CORBA::string_dup (entry->ext_id_.c_str ());
      (*prop_seq)[index].value = entry->int_id_;
    }

  return 0;
}

⌨️ 快捷键说明

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