00001
00002
00003
00004 #include "PSDL_Exception_Scope.h"
00005
00006
00007 ACE_RCSID (PSS, PSDL_Exception_Scope, "PSDL_Exception_Scope.cpp,v 1.1 2002/07/25 15:25:50 pgontla Exp")
00008
00009 TAO_PSDL_Exception_Scope::TAO_PSDL_Exception_Scope (TAO_PSDL_Scope *parent_scope)
00010 : scope_map_ (),
00011 parent_scope_ (parent_scope)
00012 {
00013
00014 }
00015
00016 int
00017 TAO_PSDL_Exception_Scope::add_member_decl (ACE_CString identifier,
00018 ACE_CString identifier_type)
00019 {
00020
00021 return TAO_PSDL_Scope::instance ()->add_member_decl_to_scope (identifier,
00022 identifier_type,
00023 this);
00024 }
00025
00026 void
00027 TAO_PSDL_Exception_Scope::dump (CORBA::ULong depth)
00028 {
00029 depth = depth + 5;
00030
00031 for (Scope_Map_Iterator i = this->scope_map_.begin ();
00032 i != this->scope_map_.end ();
00033 ++i)
00034 {
00035 this->print_depth (depth);
00036 ACE_DEBUG ((LM_DEBUG,
00037 "%s (%s)\n",
00038 (*i).ext_id_.c_str (), (*i).int_id_));
00039 }
00040 }
00041
00042 int
00043 TAO_PSDL_Exception_Scope::find (const ACE_CString &identifier_name,
00044 ACE_CString &identifier_type)
00045 {
00046 for (Scope_Map_Iterator i = this->scope_map_.begin ();
00047 i != this->scope_map_.end ();
00048 ++i)
00049 {
00050 if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
00051 {
00052 identifier_type = (*i).int_id_->identifier_type ();
00053 return 0;
00054 }
00055 else
00056 {
00057 if ((*i).int_id_->find (identifier_name,
00058 identifier_type) == 0)
00059 {
00060 return 0;
00061 }
00062 }
00063 }
00064
00065 return -1;
00066 }
00067
00068 int
00069 TAO_PSDL_Exception_Scope::find (const ACE_CString &identifier_name)
00070 {
00071 for (Scope_Map_Iterator i = this->scope_map_.begin ();
00072 i != this->scope_map_.end ();
00073 ++i)
00074 {
00075 if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
00076 {
00077 return 0;
00078 }
00079 else
00080 {
00081 if ((*i).int_id_->find (identifier_name) == 0)
00082 {
00083
00084
00085 return 0;
00086 }
00087 }
00088 }
00089
00090 return -1;
00091 }
00092
00093 TAO_PSDL_Scope *
00094 TAO_PSDL_Exception_Scope::parent_scope (void)
00095 {
00096 return this->parent_scope_;
00097 }
00098
00099 Scope_Map *
00100 TAO_PSDL_Exception_Scope::scope_map (void)
00101 {
00102 return &this->scope_map_;
00103 }
00104
00105 ACE_CString
00106 TAO_PSDL_Exception_Scope::identifier_type (void)
00107 {
00108 return this->identifier_type_;
00109 }
00110
00111 ACE_CString
00112 TAO_PSDL_Exception_Scope::module_name (void)
00113 {
00114 return this->module_name_;
00115 }
00116
00117 ACE_CString
00118 TAO_PSDL_Exception_Scope::interface_name (void)
00119 {
00120 return this->interface_name_;
00121 }