Classes | Public Member Functions | Private Attributes

TAO_Codeset_Descriptor Class Reference

#include <Codeset_Descriptor.h>

Inheritance diagram for TAO_Codeset_Descriptor:
Inheritance graph
[legend]
Collaboration diagram for TAO_Codeset_Descriptor:
Collaboration graph
[legend]

List of all members.

Classes

struct  Translator_Node

Public Member Functions

 TAO_Codeset_Descriptor ()
virtual ~TAO_Codeset_Descriptor ()
void ncs (ACE_CDR::ULong ncs)
void ncs (const ACE_TCHAR *name)
ACE_CDR::ULong ncs (void) const
int max_bytes (void) const
int num_translators (void) const
void add_translator (const ACE_TCHAR *name)
Translator_Nodetranslators (void)

Private Attributes

ACE_CDR::ULong ncs_
int max_bytes_
int num_translators_
Translator_Nodetrans_base_

Detailed Description

Definition at line 31 of file Codeset_Descriptor.h.


Constructor & Destructor Documentation

TAO_Codeset_Descriptor::TAO_Codeset_Descriptor (  ) 

Definition at line 30 of file Codeset_Descriptor.cpp.

  :ncs_ (0),
   max_bytes_ (1),
   num_translators_ (0),
   trans_base_(0)
{
}

TAO_Codeset_Descriptor::~TAO_Codeset_Descriptor (  )  [virtual]

Definition at line 38 of file Codeset_Descriptor.cpp.

{
  Translator_Node *temp = trans_base_;
  while (temp)
    {
      temp = trans_base_->next_;
      // don't need to delete the associated translator factory, it is
      // owned by the service registry
      ACE_OS::free (trans_base_->name_);
      delete trans_base_;
      trans_base_ = temp;
    }
}


Member Function Documentation

void TAO_Codeset_Descriptor::add_translator ( const ACE_TCHAR name  )  [virtual]

Implements TAO_Codeset_Descriptor_Base.

Definition at line 102 of file Codeset_Descriptor.cpp.

{
  Translator_Node *temp = trans_base_;
  if (this->trans_base_ == 0)
    {
      ACE_NEW (this->trans_base_, Translator_Node);
      temp = trans_base_;
    }
  else
    {
      while (temp->next_ != 0)
        temp = temp->next_;
      ACE_NEW (temp->next_, Translator_Node);
      temp = temp->next_;
    }
  if (temp)
    {
      this->num_translators_ ++;
      temp->name_ = ACE_OS::strdup (name);
      temp->translator_factory_ = 0;
      temp->next_ = 0;
    }
}

int TAO_Codeset_Descriptor::max_bytes ( void   )  const

Definition at line 96 of file Codeset_Descriptor.cpp.

{
  return this->max_bytes_;
}

void TAO_Codeset_Descriptor::ncs ( ACE_CDR::ULong  ncs  ) 

Definition at line 67 of file Codeset_Descriptor.cpp.

{
  this->ncs_ = n;
  // Validate the CodesetId
  this->max_bytes_ = ACE_Codeset_Registry::get_max_bytes(n);
  if (this->max_bytes_ == 0)
    {
      if (TAO_debug_level > 0)
        ACE_ERROR((LM_ERROR,
                   ACE_TEXT("(%P|%t) TAO_Codeset_Descriptor::ncs, ")
                   ACE_TEXT("unknown codeset id 0x%x\n"),
                   n));
      this->ncs_ = 0;
    }
}

void TAO_Codeset_Descriptor::ncs ( const ACE_TCHAR name  )  [virtual]

Implements TAO_Codeset_Descriptor_Base.

Definition at line 53 of file Codeset_Descriptor.cpp.

{
  ACE_CDR::ULong n = 0;
  if (ACE_Codeset_Registry::locale_to_registry
      (ACE_TEXT_ALWAYS_CHAR(name), n) == 0)
    {
      char **endPtr = 0;
      n = static_cast<ACE_CDR::ULong> (
            ACE_OS::strtoul(ACE_TEXT_ALWAYS_CHAR(name), endPtr, 0));
    }
  this->ncs(n);
}

ACE_CDR::ULong TAO_Codeset_Descriptor::ncs ( void   )  const

Definition at line 84 of file Codeset_Descriptor.cpp.

{
  return this->ncs_;
}

int TAO_Codeset_Descriptor::num_translators ( void   )  const

Definition at line 90 of file Codeset_Descriptor.cpp.

{
  return this->num_translators_;
}

TAO_Codeset_Descriptor::Translator_Node * TAO_Codeset_Descriptor::translators ( void   ) 

Definition at line 127 of file Codeset_Descriptor.cpp.

{
  return this->trans_base_;
}


Member Data Documentation

Definition at line 56 of file Codeset_Descriptor.h.

Definition at line 55 of file Codeset_Descriptor.h.

Definition at line 57 of file Codeset_Descriptor.h.

Definition at line 58 of file Codeset_Descriptor.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines