<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>1997</year><year>2017</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    
    </legalnotice>

    <title>lname</title>
    <prepared></prepared>
    <responsible></responsible>
    <docno></docno>
    <approved></approved>
    <checked></checked>
    <date>1997-06-10</date>
    <rev>A</rev>
  </header>
  <module>lname</module>
  <modulesummary>Interface that supports the name pseudo-objects.</modulesummary>
  <description>
    <p>This interface is a part of the names library which is used to hide the 
      representation of names. In Orbers Erlang mapping the pseudo-object names 
      and the real IDL names have the same representation but it is desirable that 
      the clients uses the names library so they will not be dependent of the representation.
      The lname interface supports handling of names e.g. adding and removing name 
      components.</p>
    <p>Note that the lname interface in orber does not contain a destroy function because 
      the Names are represented as standard Erlang lists and therefor will be removed 
      by the garbage collector when not in use.</p>
    <p>The type <c>NameComponent</c> used below is defined as:</p>
    <code type="erl">
-record('CosNaming_NameComponent', {id, kind=""}).
    </code>
    <p><c>id</c> and <c>kind</c> are strings. </p>
    <p>The record is defined in the file <c>CosNaming.hrl</c> and it 
      is included with:</p>
    <code type="erl">
-include_lib("orber/COSS/CosNaming/CosNaming.hrl").
    </code>
  </description>
  <funcs>
    <func>
      <name>create() -> Return</name>
      <fsummary>Create a new name</fsummary>
      <type>
        <v>Return = [NameComponent]</v>
      </type>
      <desc>
        <p>This function returns a new name.</p>
      </desc>
    </func>
    <func>
      <name>insert_component(Name, N, NameComponent) -> Return</name>
      <fsummary>Insert a new name component in a name</fsummary>
      <type>
        <v>Name = [NameComponent]</v>
        <v>N = int()</v>
        <v>Return = Name</v>
      </type>
      <desc>
        <p>This function returns a name where the new name component has been inserted as 
          component <c>N</c> in Name.</p>
      </desc>
    </func>
    <func>
      <name>get_component(Name, N) -> Return</name>
      <fsummary>Get a name component from a name</fsummary>
      <type>
        <v>Name = [NameComponent]</v>
        <v>N = int()</v>
        <v>Return = NameComponent</v>
      </type>
      <desc>
        <p>This function returns the <c>N:th</c> name component in Name.</p>
      </desc>
    </func>
    <func>
      <name>delete_component(Name, N) -> Return</name>
      <fsummary>Delete a name component from a name</fsummary>
      <type>
        <v>Name = [NameComponent]</v>
        <v>N = int()</v>
        <v>Return = Name</v>
      </type>
      <desc>
        <p>This function deletes the <c>N:th</c> name component from Name and returns 
          the new name.</p>
      </desc>
    </func>
    <func>
      <name>num_component(Name) -> Return</name>
      <fsummary>Count the number of name components in a name</fsummary>
      <type>
        <v>Name = [NameComponent]</v>
        <v>Return = int()</v>
      </type>
      <desc>
        <p>This function returns a the number of name components in Name.</p>
      </desc>
    </func>
    <func>
      <name>equal(Name1, Name2) -> Return</name>
      <fsummary>Test if two names are equal</fsummary>
      <type>
        <v>Name1 = Name2 = [NameComponent]</v>
        <v>Return = bool()</v>
      </type>
      <desc>
        <p>This function returns true if the two names are equal and false otherwise.</p>
      </desc>
    </func>
    <func>
      <name>less_than(Name1, Name2) -> Return</name>
      <fsummary>Test if one name is lesser than the other</fsummary>
      <type>
        <v>Name1 = Name2 = [NameComponent]</v>
        <v>Return = bool()</v>
      </type>
      <desc>
        <p>This function returns true if Name1 are lesser than Name2 and false otherwise.</p>
      </desc>
    </func>
    <func>
      <name>to_idl_form(Name) -> Return</name>
      <fsummary>Transform a pseudo name to an IDL name</fsummary>
      <type>
        <v>Name = [NameComponent]</v>
        <v>Return = Name</v>
      </type>
      <desc>
        <p>This function just checks if Name is a correct IDL name before returning it
          because the name representation is the same for pseudo and IDL names in orber.</p>
      </desc>
    </func>
    <func>
      <name>from_idl_form(Name) -> Return</name>
      <fsummary>Transform an IDL name to a pseudo name</fsummary>
      <type>
        <v>Name = [NameComponent]</v>
        <v>Return = Name</v>
      </type>
      <desc>
        <p>This function just returns the Name because the name representation is the 
          same for pseudo and IDL names in orber.</p>
      </desc>
    </func>
  </funcs>
  
</erlref>

