summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-02-07 01:15:36 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-02-07 01:15:36 +0000
commit190c36d2ea7e4e20d46c818fc07671bb08d7c2bb (patch)
tree05dde0aa9049994f1faba05005a14d68705df49f
parent2b5efe56c8e54b3899ec230adc293a3fe49d776e (diff)
downloadATCD-190c36d2ea7e4e20d46c818fc07671bb08d7c2bb.tar.gz
ChangeLogTag: Wed Feb 6 18:56:03 2002 Jeff Parsons <parsons@cs.wustl.edu>
-rw-r--r--TAO/TAO_IDL/ast/ast_module.cpp15
-rw-r--r--TAO/TAO_IDL/util/utl_scope.cpp80
-rw-r--r--TAO/tao/ORB.cpp21
-rw-r--r--TAO/tao/corbafwd.h6
-rw-r--r--TAO/tao/orb.idl43
5 files changed, 92 insertions, 73 deletions
diff --git a/TAO/TAO_IDL/ast/ast_module.cpp b/TAO/TAO_IDL/ast/ast_module.cpp
index 7b8e850bbe1..3480a3d6a56 100644
--- a/TAO/TAO_IDL/ast/ast_module.cpp
+++ b/TAO/TAO_IDL/ast/ast_module.cpp
@@ -819,21 +819,6 @@ AST_Module::add_CORBA_members (void)
);
this->fe_add_predefined_type (pdt);
-
- ACE_NEW (id,
- Identifier ("TCKind"));
-
- ACE_NEW (sn,
- UTL_ScopedName (id,
- 0));
-
- pdt =
- idl_global->gen ()->create_predefined_type (
- AST_PredefinedType::PT_pseudo,
- sn
- );
-
- this->fe_add_predefined_type (pdt);
}
void
diff --git a/TAO/TAO_IDL/util/utl_scope.cpp b/TAO/TAO_IDL/util/utl_scope.cpp
index c2ebc79a8ea..fbf453cd599 100644
--- a/TAO/TAO_IDL/util/utl_scope.cpp
+++ b/TAO/TAO_IDL/util/utl_scope.cpp
@@ -962,8 +962,9 @@ UTL_Scope::lookup_pseudo (Identifier *e)
Identifier *item_name = 0;
AST_Decl *d = 0;
UTL_ScopeActiveIterator *i = 0;
+ char *name_string = e->get_string ();
- if (ACE_OS::strcmp (e->get_string (), "Object") == 0)
+ if (ACE_OS::strcmp (name_string, "Object") == 0)
{
// Iterate over the global scope.
UTL_ScopeActiveIterator global_iter (idl_global->scopes ()->bottom (),
@@ -971,7 +972,8 @@ UTL_Scope::lookup_pseudo (Identifier *e)
i = &global_iter;
}
- else if (ACE_OS::strcmp (e->get_string (), "TypeCode") == 0)
+ else if (ACE_OS::strcmp (name_string, "TypeCode") == 0
+ || ACE_OS::strcmp (name_string, "TCKind") == 0)
{
// Occurrences of "TypeCode" in IDL files must be scoped with
// "CORBA" so we know we'll be in the CORBA module if we get
@@ -986,7 +988,7 @@ UTL_Scope::lookup_pseudo (Identifier *e)
return 0;
}
- while (!i->is_done ())
+ for (;!i->is_done (); i->next ())
{
d = i->item ();
@@ -996,8 +998,6 @@ UTL_Scope::lookup_pseudo (Identifier *e)
{
return d;
}
-
- i->next ();
}
return 0;
@@ -1010,7 +1010,6 @@ UTL_Scope::lookup_primitive_type (AST_Expression::ExprType et)
AST_Decl *as_decl = 0;
UTL_Scope *ancestor = 0;
AST_PredefinedType *t = 0;
- UTL_ScopeActiveIterator *i = 0;
AST_PredefinedType::PredefinedType pdt;
as_decl = ScopeAsDecl (this);
@@ -1080,14 +1079,11 @@ UTL_Scope::lookup_primitive_type (AST_Expression::ExprType et)
return 0;
}
- ACE_NEW_RETURN (i,
- UTL_ScopeActiveIterator (this,
- UTL_Scope::IK_decls),
- 0);
-
- while (!i->is_done())
+ for (UTL_ScopeActiveIterator i (this, UTL_Scope::IK_decls);
+ !i.is_done();
+ i.next ())
{
- as_decl = i->item ();
+ as_decl = i.item ();
if (as_decl->node_type () == AST_Decl::NT_pre_defined)
{
@@ -1095,20 +1091,16 @@ UTL_Scope::lookup_primitive_type (AST_Expression::ExprType et)
if (t == NULL)
{
- i->next ();
continue;
}
if (t->pt () == pdt)
{
- delete i;
return t;
}
}
-
- i->next ();
}
- delete i;
+
return 0;
}
@@ -1210,15 +1202,15 @@ UTL_Scope::lookup_by_name_local (Identifier *e,
return 0;
}
- UTL_ScopeActiveIterator i (this,
- UTL_Scope::IK_both);
Identifier *item_name = 0;
idl_bool in_corba =
ACE_OS::strcmp (e->get_string (), "CORBA") == 0;
// Iterate over this scope.
- while (!i.is_done ())
+ for (UTL_ScopeActiveIterator i (this, UTL_Scope::IK_both);
+ !i.is_done ();
+ i.next ())
{
d = i.item ();
@@ -1226,7 +1218,6 @@ UTL_Scope::lookup_by_name_local (Identifier *e,
if (item_name == 0)
{
- i.next ();
continue;
}
@@ -1237,7 +1228,6 @@ UTL_Scope::lookup_by_name_local (Identifier *e,
if (!in_corba
&& ACE_OS::strcmp (d->name ()->head ()->get_string (), "CORBA") == 0)
{
- i.next ();
continue;
}
@@ -1263,12 +1253,9 @@ UTL_Scope::lookup_by_name_local (Identifier *e,
// the scoped name we're working with.
{
index--;
- i.next ();
continue;
}
}
-
- i.next ();
}
// OK, not found, check if this scope is a module, and if so,
@@ -1664,7 +1651,6 @@ UTL_Scope::add_to_scope (AST_Decl *e,
}
AST_Decl **tmp = this->pd_referenced;
- UTL_IdListActiveIterator *iter = 0;
long i = this->pd_referenced_used;
Identifier *decl_name = e->local_name ();
@@ -1691,10 +1677,9 @@ UTL_Scope::add_to_scope (AST_Decl *e,
// is used may clash with a local declaration.
UTL_ScopedName *s = (*tmp)->name ();
- ACE_NEW (iter,
- UTL_IdListActiveIterator (s));
+ UTL_IdListActiveIterator iter (s);
- ref_name = iter->item ();
+ ref_name = iter.item ();
ref_string = ref_name->get_string ();
// Get the first non-null component of the scoped
@@ -1702,12 +1687,10 @@ UTL_Scope::add_to_scope (AST_Decl *e,
while (!ACE_OS::strcmp (ref_string, "")
|| !ACE_OS::strcmp (ref_string, "::"))
{
- iter->next ();
- ref_name = iter->item ();
+ iter.next ();
+ ref_name = iter.item ();
ref_string = ref_name->get_string ();
}
-
- delete iter;
}
// If the names compare exactly, it's a redefinition
@@ -1968,7 +1951,6 @@ UTL_Scope::has_prefix (idl_bool val)
void
UTL_Scope::dump (ACE_OSTREAM_TYPE &o)
{
- UTL_ScopeActiveIterator *i = 0;
AST_Decl *d = 0;
if (idl_global->indent () == 0)
@@ -1984,15 +1966,13 @@ UTL_Scope::dump (ACE_OSTREAM_TYPE &o)
if (pd_locals_used > 0)
{
- ACE_NEW (i,
- UTL_ScopeActiveIterator (this,
- UTL_Scope::IK_localtypes));
-
o << ("\n/* Locally defined types: */\n");
- while (!i->is_done ())
+ for (UTL_ScopeActiveIterator i (this, UTL_Scope::IK_localtypes);
+ !i.is_done ();
+ i.next ())
{
- d = i->item ();
+ d = i.item ();
if (!d->imported ())
{
@@ -2000,24 +1980,18 @@ UTL_Scope::dump (ACE_OSTREAM_TYPE &o)
d->dump (o);
o << "\n";
}
-
- i->next ();
}
-
- delete i;
}
if (pd_decls_used > 0)
{
- ACE_NEW (i,
- UTL_ScopeActiveIterator (this,
- UTL_Scope::IK_decls));
-
o << ACE_TEXT ("\n/* Declarations: */\n");
- while (!i->is_done ())
+ for (UTL_ScopeActiveIterator j (this, UTL_Scope::IK_decls);
+ !j.is_done ();
+ j.next ())
{
- d = i->item ();
+ d = j.item ();
if (!d->imported ())
{
@@ -2025,11 +1999,7 @@ UTL_Scope::dump (ACE_OSTREAM_TYPE &o)
d->dump (o);
o << ";\n";
}
-
- i->next ();
}
-
- delete i;
}
idl_global->indent ()->decrease ();
diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp
index 6bf5aaffc58..49ab0de713a 100644
--- a/TAO/tao/ORB.cpp
+++ b/TAO/tao/ORB.cpp
@@ -1969,6 +1969,27 @@ operator>>(TAO_InputCDR& cdr, TAO_opaque& x)
return (CORBA::Boolean) cdr.good_bit ();
}
+CORBA::Boolean operator<< (TAO_OutputCDR &strm,
+ const CORBA::TCKind &_tao_enumval)
+{
+ CORBA::ULong _tao_temp = _tao_enumval;
+ return strm << _tao_temp;
+}
+
+CORBA::Boolean operator>> (TAO_InputCDR &strm,
+ CORBA::TCKind &_tao_enumval)
+{
+ CORBA::ULong _tao_temp = 0;
+ CORBA::Boolean _tao_result = strm >> _tao_temp;
+
+ if (_tao_result == 1)
+ {
+ _tao_enumval = ACE_static_cast (CORBA::TCKind, _tao_temp);
+ }
+
+ return _tao_result;
+}
+
ACE_Time_Value *
CORBA_ORB::get_timeout (void)
{
diff --git a/TAO/tao/corbafwd.h b/TAO/tao/corbafwd.h
index f4c4ce69180..a7dc6bca2f3 100644
--- a/TAO/tao/corbafwd.h
+++ b/TAO/tao/corbafwd.h
@@ -1794,6 +1794,12 @@ operator<< (TAO_OutputCDR&, const TAO_opaque&);
TAO_Export CORBA::Boolean
operator>> (TAO_InputCDR&, TAO_opaque&);
+TAO_Export CORBA::Boolean
+operator<< (TAO_OutputCDR &, const CORBA::TCKind &);
+
+TAO_Export CORBA::Boolean
+operator>> (TAO_InputCDR &, CORBA::TCKind &);
+
class TAO_ObjectKey;
class TAO_ObjectKey_var;
class TAO_ObjectKey_out;
diff --git a/TAO/tao/orb.idl b/TAO/tao/orb.idl
index c26a3ee42b0..65714ddb943 100644
--- a/TAO/tao/orb.idl
+++ b/TAO/tao/orb.idl
@@ -13,6 +13,46 @@
module CORBA
{
+ enum TCKind
+ {
+ tk_null,
+ tk_void,
+ tk_short,
+ tk_long,
+ tk_ushort,
+ tk_ulong,
+ tk_float,
+ tk_double,
+ tk_boolean,
+ tk_char,
+ tk_octet,
+ tk_any,
+ tk_TypeCode,
+ tk_Principal,
+ tk_objref,
+ tk_struct,
+ tk_union,
+ tk_enum,
+ tk_string,
+ tk_sequence,
+ tk_array,
+ tk_alias,
+ tk_except,
+ tk_longlong,
+ tk_ulonglong,
+ tk_longdouble,
+ tk_wchar,
+ tk_wstring,
+ tk_fixed,
+ tk_value,
+ tk_value_box,
+ tk_native,
+ tk_abstract_interface,
+ tk_local_interface,
+ tk_component,
+ tk_home
+ };
+
typedef string ORBid;
typedef unsigned long Flags;
typedef string Identifier;
@@ -63,9 +103,6 @@ module CORBA
typedef sequence<string> StringSeq;
typedef sequence<wstring> WStringSeq;
typedef sequence<octet> OctetSeq;
-
};
-#pragma prefix ""
-
#endif /* TAO_ORB_IDL */