Beispiel #1
0
void
Savable::write (TAO::Storable_Base & stream)
{
  stream.rewind ();

  for (int index = 0; index < 2; ++index)
    {
      stream << this->string_[index];
      stream << this->i_[index];
      stream << this->ui_[index];
      stream << this->bytes_size_[index];
      stream.write (this->bytes_size_[index], this->bytes_[index]);
    }

  stream.flush ();
}
Beispiel #2
0
void
TAO::PG_Group_List_Store::write (TAO::Storable_Base & stream)
{
  stream.rewind ();

  unsigned int next_group_id = static_cast<unsigned int> (this->next_group_id_);
  stream << next_group_id;

  int size = group_ids_.size ();
  stream << size;
  for (Group_Id_Const_Iterator it = group_ids_.begin ();
                               it != group_ids_.end (); ++it)
    {
      int group_id = static_cast<int> (*it);
      stream << group_id;
    }

  stream.flush ();
}
void
TAO::PG_Object_Group_Storable::write (TAO::Storable_Base & stream)
{
  stream.rewind ();

  ACE_CString group_name = PG_Object_Group::get_name ();
  stream << group_name;
  stream << this->distribute_;
  stream << this->role_;

  TAO_OutputCDR primary_location_cdr;
  primary_location_cdr << PG_Object_Group::get_primary_location ();
  stream << primary_location_cdr;

  CORBA::String_var reference_ior =
    this->orb_->object_to_string (this->reference_.in ());
  stream << reference_ior.in ();

  TAO_OutputCDR tagged_component_cdr;
  tagged_component_cdr << this->tagged_component_;
  stream << tagged_component_cdr;

  TAO_OutputCDR type_id_cdr;
  PortableGroup::TypeId_var type_id = PG_Object_Group::get_type_id ();
  type_id_cdr << type_id;
  stream << type_id_cdr;

  TAO_OutputCDR properties_cdr;
  PortableGroup::Criteria properties;
  this->properties_.export_properties (properties);
  properties_cdr << properties;
  stream << properties_cdr;

  ///// members_ /////
  int num_members = this->members_.current_size  ();
  stream << num_members;
  for (MemberMap_Iterator it = this->members_.begin ();
       it != this->members_.end ();
       ++it)
    {
      PortableGroup::Location the_location = it->key ();
      TAO_OutputCDR the_location_cdr;
      the_location_cdr << the_location;
      stream << the_location_cdr;

      MemberInfo * member = it->item ();
      CORBA::String_var member_ior =
        this->orb_->object_to_string (member->member_.in ());
      stream << member_ior.in ();

      TAO_OutputCDR location_cdr;
      location_cdr << member->location_;
      stream << location_cdr;

      CORBA::String_var factory_ior =
        this->orb_->object_to_string (member->factory_.in ());
      stream << factory_ior.in ();

      TAO_OutputCDR factory_id_cdr;
      factory_id_cdr << member->factory_id_;
      stream << factory_id_cdr;

      stream << (int)member->is_primary_;
    }
  stream.flush ();
  this->write_occurred_ = true;
}