TAO_PSDL_Root_Scope Class Reference

#include <PSDL_Root_Scope.h>

Inheritance diagram for TAO_PSDL_Root_Scope:

Inheritance graph
[legend]
Collaboration diagram for TAO_PSDL_Root_Scope:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_PSDL_Root_Scope (void)
 ~TAO_PSDL_Root_Scope (void)
int add_module (ACE_CString identifier)
int add_interface (ACE_CString identifier)
int add_struct (ACE_CString identifier)
int add_typedef (ACE_CString identifier, ACE_CString identifier_type)
int add_const_decl (ACE_CString identifier, ACE_CString identifier_type)
int add_except_decl (ACE_CString identifier, ACE_CString identifier_type)
int add_op_dcl (ACE_CString identifier)
void dump (CORBA::ULong depth)
 Function to help indent the output of the parse tree.

int find (const ACE_CString &identifier_name, ACE_CString &identifier_type)
 Function to find the TAO_PSDL_Scope for the given identifier_name.

int find (const ACE_CString &identifier_name)
int get_module_name (const ACE_CString &identifier_name, ACE_CString &module_name)
int get_interface_name (const ACE_CString &identifier_name, ACE_CString &interface_name)
TAO_PSDL_Scopeparent_scope (void)
 Public methods to return the scopes needed.

Scope_Mapscope_map (void)
 Return the pointer to Scope_Map of the instance.


Protected Attributes

Scope_Map root_scope_map_

Constructor & Destructor Documentation

TAO_PSDL_Root_Scope::TAO_PSDL_Root_Scope void   ) 
 

Definition at line 9 of file PSDL_Root_Scope.cpp.

00010   : root_scope_map_ ()
00011 {
00012 }

TAO_PSDL_Root_Scope::~TAO_PSDL_Root_Scope void   ) 
 

Definition at line 14 of file PSDL_Root_Scope.cpp.

00015 {
00016 }


Member Function Documentation

int TAO_PSDL_Root_Scope::add_const_decl ACE_CString  identifier,
ACE_CString  identifier_type
[virtual]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 50 of file PSDL_Root_Scope.cpp.

References TAO_PSDL_Scope::add_const_decl_to_scope(), and TAO_PSDL_Scope::instance().

00052 {
00053   return TAO_PSDL_Scope::instance ()->add_const_decl_to_scope (identifier,
00054                                                                identifier_type,
00055                                                                this);
00056 }

int TAO_PSDL_Root_Scope::add_except_decl ACE_CString  identifier,
ACE_CString  identifier_type
[virtual]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 59 of file PSDL_Root_Scope.cpp.

References TAO_PSDL_Scope::add_except_decl_to_scope(), and TAO_PSDL_Scope::instance().

00061 {
00062   return TAO_PSDL_Scope::instance ()->add_except_decl_to_scope (identifier,
00063                                                                 identifier_type,
00064                                                                 this);
00065 }

int TAO_PSDL_Root_Scope::add_interface ACE_CString  identifier  )  [virtual]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 26 of file PSDL_Root_Scope.cpp.

References TAO_PSDL_Scope::add_interface_to_scope(), and TAO_PSDL_Scope::instance().

00027 {
00028   // Add the actual interface.
00029   return TAO_PSDL_Scope::instance ()->add_interface_to_scope (interface_name,
00030                                                               this);
00031 }

int TAO_PSDL_Root_Scope::add_module ACE_CString  identifier  )  [virtual]
 

Methods to be able to add the respective types to the Root Scope.

Reimplemented from TAO_PSDL_Scope.

Definition at line 19 of file PSDL_Root_Scope.cpp.

References TAO_PSDL_Scope::add_module_to_scope(), and TAO_PSDL_Scope::instance().

00020 {
00021   return TAO_PSDL_Scope::instance ()->add_module_to_scope (identifier,
00022                                                            this);
00023 }

int TAO_PSDL_Root_Scope::add_op_dcl ACE_CString  identifier  )  [virtual]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 68 of file PSDL_Root_Scope.cpp.

References TAO_PSDL_Scope::add_op_dcl_to_scope(), and TAO_PSDL_Scope::instance().

00069 {
00070   return TAO_PSDL_Scope::instance ()->add_op_dcl_to_scope (identifier,
00071                                                            this);
00072 }

int TAO_PSDL_Root_Scope::add_struct ACE_CString  identifier  )  [virtual]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 34 of file PSDL_Root_Scope.cpp.

References TAO_PSDL_Scope::add_struct_to_scope(), and TAO_PSDL_Scope::instance().

00035 {
00036   return TAO_PSDL_Scope::instance ()->add_struct_to_scope (struct_name,
00037                                                            this);
00038 }

int TAO_PSDL_Root_Scope::add_typedef ACE_CString  identifier,
ACE_CString  identifier_type
[virtual]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 41 of file PSDL_Root_Scope.cpp.

References TAO_PSDL_Scope::add_typedef_to_scope(), and TAO_PSDL_Scope::instance().

00043 {
00044   return TAO_PSDL_Scope::instance ()->add_typedef_to_scope (identifier,
00045                                                             identifier_type,
00046                                                             this);
00047 }

void TAO_PSDL_Root_Scope::dump CORBA::ULong  depth  )  [virtual]
 

Function to help indent the output of the parse tree.

Reimplemented from TAO_PSDL_Scope.

Definition at line 75 of file PSDL_Root_Scope.cpp.

References ACE_DEBUG, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), TAO_PSDL_Scope::instance(), LM_DEBUG, TAO_PSDL_Scope::print_depth(), root_scope_map_, and Scope_Map_Iterator.

00076 {
00077   ACE_DEBUG ((LM_DEBUG,
00078               "ROOT_SCOPE"));
00079 
00080   depth = depth + 5;
00081   for (Scope_Map_Iterator i = this->root_scope_map_.begin ();
00082        i != this->root_scope_map_.end ();
00083        ++i)
00084     {
00085       TAO_PSDL_Scope::instance ()->print_depth (depth);
00086       ACE_DEBUG ((LM_DEBUG,
00087                   "%s (module)\n",
00088                   (*i).ext_id_.c_str ()));
00089       (*i).int_id_->dump (depth);
00090     }
00091 
00092 }

int TAO_PSDL_Root_Scope::find const ACE_CString identifier_name  )  [virtual]
 

Function to check if a particular identifier_name exists in the scope.

Reimplemented from TAO_PSDL_Scope.

Definition at line 121 of file PSDL_Root_Scope.cpp.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), root_scope_map_, Scope_Map_Iterator, and ACE_OS::strcmp().

00122 {
00123   for (Scope_Map_Iterator i = this->root_scope_map_.begin ();
00124        i != this->root_scope_map_.end ();
00125        ++i)
00126     {
00127       if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
00128         {
00129           return 0;
00130         }
00131       else
00132         {
00133           if ((*i).int_id_->find (identifier_name) == 0)
00134             {
00135               return 0;
00136             }
00137         }
00138     }
00139 
00140   return -1;
00141 }

int TAO_PSDL_Root_Scope::find const ACE_CString identifier_name,
ACE_CString identifier_type
[virtual]
 

Function to find the TAO_PSDL_Scope for the given identifier_name.

Reimplemented from TAO_PSDL_Scope.

Definition at line 95 of file PSDL_Root_Scope.cpp.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), root_scope_map_, Scope_Map_Iterator, and ACE_OS::strcmp().

Referenced by TAO_PSDL_Scope::find().

00097 {
00098   for (Scope_Map_Iterator i = this->root_scope_map_.begin ();
00099        i != this->root_scope_map_.end ();
00100        ++i)
00101     {
00102       if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
00103         {
00104           identifier_type = (*i).int_id_->identifier_type ();
00105           return 0;
00106         }
00107       else
00108         {
00109           if ((*i).int_id_->find (identifier_name,
00110                                   identifier_type) == 0)
00111             {
00112               return 0;
00113             }
00114         }
00115     }
00116 
00117   return -1;
00118 }

int TAO_PSDL_Root_Scope::get_interface_name const ACE_CString identifier_name,
ACE_CString interface_name
[virtual]
 

To get the name of the interface to which an identifier_name belongs. returns '0' on succes and '-1' on failure.

Reimplemented from TAO_PSDL_Scope.

Definition at line 170 of file PSDL_Root_Scope.cpp.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), root_scope_map_, Scope_Map_Iterator, and ACE_OS::strcmp().

Referenced by TAO_PSDL_Scope::get_interface_name().

00172 {
00173   for (Scope_Map_Iterator i = this->root_scope_map_.begin ();
00174        i != this->root_scope_map_.end ();
00175        ++i)
00176     {
00177       if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
00178         {
00179           interface_name = (*i).int_id_->interface_name ();
00180           return 0;
00181         }
00182       else
00183         {
00184           if ((*i).int_id_->get_interface_name (identifier_name,
00185                                                 interface_name) == 0)
00186             {
00187               return 0;
00188             }
00189         }
00190     }
00191 
00192   return -1;
00193 }

int TAO_PSDL_Root_Scope::get_module_name const ACE_CString identifier_name,
ACE_CString module_name
[virtual]
 

To get the name of the module to which an identifier_name belongs. returns '0' on succes and '-1' on failure.

Reimplemented from TAO_PSDL_Scope.

Definition at line 144 of file PSDL_Root_Scope.cpp.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), root_scope_map_, Scope_Map_Iterator, and ACE_OS::strcmp().

Referenced by TAO_PSDL_Scope::get_module_name().

00146 {
00147   for (Scope_Map_Iterator i = this->root_scope_map_.begin ();
00148        i != this->root_scope_map_.end ();
00149        ++i)
00150     {
00151       if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
00152         {
00153           module_name = (*i).int_id_->module_name ();
00154           return 0;
00155         }
00156       else
00157         {
00158           if ((*i).int_id_->get_module_name (identifier_name,
00159                                              module_name) == 0)
00160             {
00161               return 0;
00162             }
00163         }
00164     }
00165 
00166   return -1;
00167 }

TAO_PSDL_Scope * TAO_PSDL_Root_Scope::parent_scope void   )  [virtual]
 

Public methods to return the scopes needed.

Reimplemented from TAO_PSDL_Scope.

Definition at line 196 of file PSDL_Root_Scope.cpp.

00197 {
00198   return 0;
00199 }

Scope_Map * TAO_PSDL_Root_Scope::scope_map void   )  [virtual]
 

Return the pointer to Scope_Map of the instance.

Reimplemented from TAO_PSDL_Scope.

Definition at line 202 of file PSDL_Root_Scope.cpp.

References root_scope_map_.

00203 {
00204   return &this->root_scope_map_;
00205 }


Member Data Documentation

Scope_Map TAO_PSDL_Root_Scope::root_scope_map_ [protected]
 

Definition at line 79 of file PSDL_Root_Scope.h.

Referenced by dump(), find(), get_interface_name(), get_module_name(), and scope_map().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 14:09:53 2006 for TAO_PSS by doxygen 1.3.6