diff options
Diffstat (limited to 'TAO/TAO_IDL/fe/fe_interface_header.cpp')
-rw-r--r-- | TAO/TAO_IDL/fe/fe_interface_header.cpp | 146 |
1 files changed, 66 insertions, 80 deletions
diff --git a/TAO/TAO_IDL/fe/fe_interface_header.cpp b/TAO/TAO_IDL/fe/fe_interface_header.cpp index 5113d78c566..33ab6af6ba6 100644 --- a/TAO/TAO_IDL/fe/fe_interface_header.cpp +++ b/TAO/TAO_IDL/fe/fe_interface_header.cpp @@ -78,8 +78,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "global_extern.h" #include "nr_extern.h" -ACE_RCSID (fe, - fe_interface_header, +ACE_RCSID (fe, + fe_interface_header, "$Id$") #undef INCREMENT @@ -179,11 +179,11 @@ already_seen (AST_Interface *ip) { if (iseen[i] == ip) { - return true; + return I_TRUE; } } - return false; + return I_FALSE; } // Have we already seen this interface in the flat list? @@ -194,11 +194,11 @@ already_seen_flat (AST_Interface *ip) { if (iseen_flat[i] == ip) { - return true; + return I_TRUE; } } - return false; + return I_FALSE; } // @@@ (JP) Here are the rules for interface inheritance and @@ -231,14 +231,14 @@ interface, a derived valuetype may also be declared to support an interface, as long as it is derived from all interfaces that are supported by any base valuetypes. Here is an example: -interface I1 { }; -interface I2 { }; -interface I3: I1, I2 { }; +interface I1 { }; +interface I2 { }; +interface I3: I1, I2 { }; -abstract valuetype V1 supports I1 { }; -abstract valuetype V2 supports I2 { }; -valuetype V3: V1, V2 supports I3 { }; // legal -valuetype V4: V1 supports I2 { }; // illegal +abstract valuetype V1 supports I1 { }; +abstract valuetype V2 supports I2 { }; +valuetype V3: V1, V2 supports I3 { }; // legal +valuetype V4: V1 supports I2 { }; // illegal This last rule was made to guarantee that any given valuetype supported at most one most-derived interface. We didn't want valuetypes to extend @@ -248,9 +248,9 @@ interfaces. FE_InterfaceHeader::FE_InterfaceHeader (UTL_ScopedName *n, UTL_NameList *inherits, - bool is_local, - bool is_abstract, - bool compile_now) + idl_bool is_local, + idl_bool is_abstract, + idl_bool compile_now) : pd_interface_name (n), pd_inherits (0), pd_n_inherits (0), @@ -262,7 +262,7 @@ FE_InterfaceHeader::FE_InterfaceHeader (UTL_ScopedName *n, if (compile_now) { this->compile_inheritance (inherits, - false); + I_FALSE); } } @@ -270,31 +270,18 @@ FE_InterfaceHeader::~FE_InterfaceHeader (void) { } -bool +idl_bool FE_InterfaceHeader::is_local (void) const { return this->pd_is_local; } -bool +idl_bool FE_InterfaceHeader::is_abstract (void) const { return this->pd_is_abstract; } -void -FE_InterfaceHeader::destroy (void) -{ - if (this->pd_interface_name == 0) - { - return; - } - - this->pd_interface_name->destroy (); - delete this->pd_interface_name; - this->pd_interface_name = 0; -} - // Add this interface to the list of inherited if not already there. void FE_InterfaceHeader::compile_one_inheritance (AST_Interface *i) @@ -321,8 +308,8 @@ FE_InterfaceHeader::compile_one_inheritance (AST_Interface *i) } // Add i's parents to the flat list. - AST_Interface **parents = i->inherits_flat (); - long num_parents = i->n_inherits_flat (); + AST_Interface **parents = i->inherits (); + long num_parents = i->n_inherits (); for (long j = 0; j < num_parents; ++j) { @@ -340,7 +327,7 @@ FE_InterfaceHeader::compile_one_inheritance (AST_Interface *i) // Compute the list of top-level interfaces this one inherits from. void FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, - bool for_valuetype) + idl_bool for_valuetype) { if (ifaces == 0) { @@ -368,7 +355,7 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, if (idl_global->scopes ().top () == 0) { idl_global->err ()->lookup_error (item); - + // This is probably the result of bad IDL. // We will crash if we continue from here. exit (99); @@ -378,7 +365,7 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, UTL_Scope *s = idl_global->scopes ().top (); d = s->lookup_by_name (item, - true); + I_TRUE); if (d == 0) { @@ -396,7 +383,7 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, if (d == 0) { idl_global->err ()->lookup_error (item); - + // This is probably the result of bad IDL. // We will crash if we continue from here. exit (99); @@ -477,11 +464,11 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, int FE_InterfaceHeader::check_inherit (AST_Interface *i, - bool for_valuetype) + idl_bool for_valuetype) { // We use the narrow instead of node_type() here so we can get a // match with both valuetypes and eventtypes. - bool is_valuetype = (AST_ValueType::narrow_from_decl (i) != 0); + idl_bool is_valuetype = (AST_ValueType::narrow_from_decl (i) != 0); if ( // Non-local interfaces may not inherit from local ones. @@ -535,15 +522,14 @@ FE_InterfaceHeader::n_inherits_flat (void) const FE_OBVHeader::FE_OBVHeader (UTL_ScopedName *n, UTL_NameList *inherits, UTL_NameList *supports, - bool truncatable, - bool is_eventtype) + idl_bool truncatable, + idl_bool is_eventtype) : FE_InterfaceHeader (n, inherits, - false, - false, - false), + I_FALSE, + I_FALSE, + I_FALSE), pd_supports (0), - pd_n_supports (0), pd_inherits_concrete (0), pd_supports_concrete (0), pd_truncatable (truncatable) @@ -585,7 +571,7 @@ FE_OBVHeader::supports_concrete (void) const return this->pd_supports_concrete; } -bool +idl_bool FE_OBVHeader::truncatable (void) const { return this->pd_truncatable; @@ -593,10 +579,10 @@ FE_OBVHeader::truncatable (void) const void FE_OBVHeader::compile_inheritance (UTL_NameList *vtypes, - bool is_eventtype) + idl_bool is_eventtype) { this->FE_InterfaceHeader::compile_inheritance (vtypes, - true); + I_TRUE); if (this->pd_n_inherits > 0) { @@ -604,7 +590,7 @@ FE_OBVHeader::compile_inheritance (UTL_NameList *vtypes, AST_ValueType *vt = AST_ValueType::narrow_from_decl (iface); if (vt != 0 - && vt->is_abstract () == false) + && vt->is_abstract () == I_FALSE) { this->pd_inherits_concrete = vt; } @@ -661,7 +647,7 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports) if (idl_global->scopes ().top () == 0) { idl_global->err ()->lookup_error (item); - + // This is probably the result of bad IDL. // We will crash if we continue from here. exit (99); @@ -671,7 +657,7 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports) UTL_Scope *s = idl_global->scopes ().top (); d = s->lookup_by_name (item, - true); + I_TRUE); if (d == 0) { @@ -689,7 +675,7 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports) if (d == 0) { idl_global->err ()->lookup_error (item); - + // This is probably the result of bad IDL. // We will crash if we continue from here. exit (99); @@ -745,7 +731,7 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports) } } -bool +idl_bool FE_OBVHeader::check_concrete_supported_inheritance (AST_Interface *d) { AST_ValueType *vt = 0; @@ -784,12 +770,12 @@ FE_OBVHeader::check_concrete_supported_inheritance (AST_Interface *d) FE_EventHeader::FE_EventHeader (UTL_ScopedName *n, UTL_NameList *inherits, UTL_NameList *supports, - bool truncatable) + idl_bool truncatable) : FE_OBVHeader (n, inherits, supports, truncatable, - true) + I_TRUE) { } @@ -799,15 +785,15 @@ FE_EventHeader::~FE_EventHeader (void) //************************************************************************ -FE_ComponentHeader::FE_ComponentHeader (UTL_ScopedName *n, - UTL_ScopedName *base_component, +FE_ComponentHeader::FE_ComponentHeader (UTL_ScopedName *n, + UTL_ScopedName *base_component, UTL_NameList *supports, - bool /* compile_now */) + idl_bool /* compile_now */) : FE_InterfaceHeader (n, supports, - false, - false, - false), + I_FALSE, + I_FALSE, + I_FALSE), pd_base_component (0) { if (base_component != 0 && supports != 0) @@ -837,7 +823,7 @@ FE_ComponentHeader::supports (void) const return this->pd_inherits; } -long +long FE_ComponentHeader::n_supports (void) const { return this->pd_n_inherits; @@ -864,20 +850,20 @@ FE_ComponentHeader::compile_inheritance (UTL_ScopedName *base_component) { return; } - + UTL_Scope *s = idl_global->scopes ().top_non_null (); AST_Decl *d = s->lookup_by_name (base_component, - true); + I_TRUE); if (d == 0) { idl_global->err ()->lookup_error (base_component); - + // This is probably the result of bad IDL. // We will crash if we continue from here. exit (99); } - + if (d->node_type () == AST_Decl::NT_typedef) { d = AST_Typedef::narrow_from_decl (d)->primitive_base_type (); @@ -928,7 +914,7 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports) if (idl_global->scopes ().top () == 0) { idl_global->err ()->lookup_error (item); - + // This is probably the result of bad IDL. // We will crash if we continue from here. exit (99); @@ -938,7 +924,7 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports) UTL_Scope *s = idl_global->scopes ().top (); d = s->lookup_by_name (item, - true); + I_TRUE); if (d == 0) { @@ -956,7 +942,7 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports) if (d == 0) { idl_global->err ()->lookup_error (item); - + // This is probably the result of bad IDL. // We will crash if we continue from here. exit (99); @@ -976,7 +962,7 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports) idl_global->err ()->interface_expected (d); continue; } - + // Undefined interface? if (!i->is_defined ()) { @@ -1038,7 +1024,7 @@ FE_HomeHeader::FE_HomeHeader (UTL_ScopedName *n, : FE_ComponentHeader (n, 0, supports, - false), + I_FALSE), pd_base_home (0), pd_primary_key (0) { @@ -1087,12 +1073,12 @@ FE_HomeHeader::compile_inheritance (UTL_ScopedName *base_home) UTL_Scope *s = idl_global->scopes ().top_non_null (); AST_Decl *d = s->lookup_by_name (base_home, - true); + I_TRUE); if (d == 0) { idl_global->err ()->lookup_error (base_home); - + // This is probably the result of bad IDL. // We will crash if we continue from here. exit (99); @@ -1122,12 +1108,12 @@ FE_HomeHeader::compile_managed_component (UTL_ScopedName *managed_component) UTL_Scope *s = idl_global->scopes ().top_non_null (); AST_Decl *d = s->lookup_by_name (managed_component, - true); + I_TRUE); if (d == 0) { idl_global->err ()->lookup_error (managed_component); - + // This is probably the result of bad IDL. // We will crash if we continue from here. exit (99); @@ -1154,20 +1140,20 @@ FE_HomeHeader::compile_primary_key (UTL_ScopedName *primary_key) { return; } - + UTL_Scope *s = idl_global->scopes ().top_non_null (); AST_Decl *d = s->lookup_by_name (primary_key, - true); + I_TRUE); if (d == 0) { idl_global->err ()->lookup_error (primary_key); - + // This is probably the result of bad IDL. // We will crash if we continue from here. exit (99); } - + AST_Decl::NodeType nt = d->node_type (); if (nt == AST_Decl::NT_typedef) |