Beispiel #1
0
CORBA::Contained::Description *
TAO_ModuleDef_i::describe_i (void)
{
  CORBA::Contained::Description *desc_ptr = 0;
  ACE_NEW_THROW_EX (desc_ptr,
                    CORBA::Contained::Description,
                    CORBA::NO_MEMORY ());

  CORBA::Contained::Description_var retval = desc_ptr;

  retval->kind = this->def_kind ();

  CORBA::ModuleDescription md;

  md.name = this->name_i ();

  md.id = this->id_i ();

  ACE_TString container_id;
  this->repo_->config ()->get_string_value (this->section_key_,
                                            "container_id",
                                            container_id);

  md.defined_in = container_id.c_str ();

  md.version = this->version_i ();

  retval->value <<= md;

  return retval._retn ();
}
Beispiel #2
0
CORBA::Contained::Description *
TAO_OperationDef_i::describe_i ( )
{
  CORBA::Contained::Description *desc_ptr = 0;
  ACE_NEW_THROW_EX (desc_ptr,
                    CORBA::Contained::Description,
                    CORBA::NO_MEMORY ());

  CORBA::Contained::Description_var retval = desc_ptr;

  retval->kind = this->def_kind ();

  CORBA::OperationDescription od;
  this->make_description (od);

  retval->value <<= od;

  return retval._retn ();
}
Beispiel #3
0
CORBA::Contained::Description *
TAO_AttributeDef_i::describe_i (void)
{
  CORBA::Contained::Description *desc_ptr = 0;
  ACE_NEW_THROW_EX (desc_ptr,
                    CORBA::Contained::Description,
                    CORBA::NO_MEMORY ());

  CORBA::Contained::Description_var retval = desc_ptr;

  retval->kind = CORBA::dk_Attribute;

  CORBA::AttributeDescription *ad = 0;
  ACE_NEW_RETURN (ad,
                  CORBA::AttributeDescription,
                  0);

  this->make_description (*ad);

  retval->value <<= ad;
  return retval._retn ();
}
Beispiel #4
0
CORBA::Contained::Description *
TAO_InterfaceDef_i::describe_i (void)
{
  CORBA::Contained::Description *desc_ptr = 0;
  ACE_NEW_THROW_EX (desc_ptr,
                    CORBA::Contained::Description,
                    CORBA::NO_MEMORY ());

  CORBA::Contained::Description_var retval = desc_ptr;

  retval->kind = this->def_kind ();

  CORBA::InterfaceDescription ifd;
  ACE_TString holder;

  this->repo_->config ()->get_string_value (this->section_key_,
                                            "name",
                                            holder);
  ifd.name = holder.fast_rep ();
  this->repo_->config ()->get_string_value (this->section_key_,
                                            "id",
                                            holder);
  ifd.id = holder.fast_rep ();
  this->repo_->config ()->get_string_value (this->section_key_,
                                            "container_id",
                                            holder);
  ifd.defined_in = holder.fast_rep ();
  this->repo_->config ()->get_string_value (this->section_key_,
                                            "version",
                                            holder);
  ifd.version = holder.fast_rep ();

  CORBA::ULong i = 0;
  CORBA::InterfaceDefSeq_var bases =
    this->base_interfaces_i ();

  CORBA::ULong length = bases->length ();
  CORBA::RepositoryIdSeq repo_ids (length);
  repo_ids.length (length);

  char *base_path = 0;
  ACE_Configuration_Section_Key base_key;

  for (i = 0; i < length; ++i)
    {
      base_path = TAO_IFR_Service_Utils::reference_to_path (bases[i]);

      this->repo_->config ()->expand_path (this->repo_->root_key (),
                                           base_path,
                                           base_key,
                                           0);

      TAO_InterfaceDef_i impl (this->repo_);
      impl.section_key (base_key);

      repo_ids[i] = impl.id_i ();
    }

  ifd.base_interfaces = repo_ids;
  retval->value <<= ifd;
  return retval._retn ();
}
Beispiel #5
0
CORBA::Contained::Description *
TAO_ComponentDef_i::describe_i (void)
{
  CORBA::ComponentIR::ComponentDescription cd;
  TAO_IFR_Desc_Utils<CORBA::ComponentIR::ComponentDescription,
                     TAO_ComponentDef_i>::fill_desc_begin (
                                              cd,
                                              this->repo_,
                                              this->section_key_
                                            );

  ACE_TString holder;
  int status =
    this->repo_->config ()->get_string_value (this->section_key_,
                                              "base_component",
                                              holder);

  if (status == 0)
    {
      ACE_Configuration_Section_Key base_key;
      this->repo_->config ()->expand_path (this->repo_->root_key (),
                                           holder,
                                           base_key,
                                           0);
      this->repo_->config ()->get_string_value (base_key,
                                                "id",
                                                holder);
    }

  // If status wasn't 0, holder will contain the empty string.
  cd.base_component = holder.fast_rep ();

  CORBA::ULong count = 0;
  ACE_Configuration_Section_Key supports_key;
  status = this->repo_->config ()->open_section (this->section_key_,
                                                 "supported",
                                                 0,
                                                 supports_key);

  if (status == 0)
    {
      this->repo_->config ()->get_integer_value (supports_key,
                                                 "count",
                                                 count);
    }

  cd.supported_interfaces.length (count);
  char *stringified = 0;
  CORBA::ULong i = 0;

  for (i = 0; i < count; ++i)
    {
      stringified = TAO_IFR_Service_Utils::int_to_string (i);
      this->repo_->config ()->get_string_value (supports_key,
                                                stringified,
                                                holder);

      cd.supported_interfaces[i] = holder.c_str ();
    }

  TAO_Port_Desc_Seq_Utils<
      CORBA::ComponentIR::ProvidesDescriptionSeq
    >::port_descriptions (cd.provided_interfaces,
       this->repo_->config (),
       this->section_key_,
       "provides");

  TAO_Port_Desc_Seq_Utils<
      CORBA::ComponentIR::UsesDescriptionSeq
    >::port_descriptions (cd.used_interfaces,
       this->repo_->config (),
       this->section_key_,
       "uses");

  TAO_Port_Desc_Seq_Utils<
      CORBA::ComponentIR::EventPortDescriptionSeq
    >::port_descriptions (cd.emits_events,
      this->repo_->config (),
      this->section_key_,
      "emits");

  TAO_Port_Desc_Seq_Utils<
      CORBA::ComponentIR::EventPortDescriptionSeq
    >::port_descriptions (cd.publishes_events,
      this->repo_->config (),
      this->section_key_,
      "publishes");

  TAO_Port_Desc_Seq_Utils<
      CORBA::ComponentIR::EventPortDescriptionSeq
    >::port_descriptions (cd.consumes_events,
      this->repo_->config (),
      this->section_key_,
      "consumes");

  count = 0;
  ACE_Configuration_Section_Key attrs_key;
  status =
    this->repo_->config ()->open_section (this->section_key_,
                                          "attrs",
                                          0,
                                          attrs_key);
  if (status == 0)
    {
      this->repo_->config ()->get_integer_value (attrs_key,
                                                 "count",
                                                 count);
    }

  cd.attributes.length (count);
  ACE_Configuration_Section_Key attr_key;

  for (i = 0; i < count; ++i)
    {
      stringified = TAO_IFR_Service_Utils::int_to_string (i);
      this->repo_->config ()->open_section (attrs_key,
                                            stringified,
                                            0,
                                            attr_key);

      TAO_ExtAttributeDef_i impl (this->repo_);
      impl.section_key (attr_key);
      impl.fill_description (cd.attributes[i]);
    }

  cd.type = this->type_i ();

  CORBA::Contained::Description *cont_desc_ptr = 0;
  ACE_NEW_THROW_EX (cont_desc_ptr,
                    CORBA::Contained::Description,
                    CORBA::NO_MEMORY ());
  CORBA::Contained::Description_var retval = cont_desc_ptr;

  cont_desc_ptr->kind = CORBA::dk_Component;

  cont_desc_ptr->value <<= cd;
  return retval._retn ();
}