diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-03-23 20:53:44 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-03-23 20:53:44 +0000 |
commit | 8cfd157be6db4ed2fe147a940b506582e2810fb9 (patch) | |
tree | 3749123f7973c1135e4a9879bab5dc29345dc757 /TAO/CIAO | |
parent | b4b33db3d1e7513cf21c41d0fa9617fd7554b5a0 (diff) | |
download | ATCD-8cfd157be6db4ed2fe147a940b506582e2810fb9.tar.gz |
ChangeLogTag: Tue Mar 23 14:34:06 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/CIAO')
-rw-r--r-- | TAO/CIAO/CIDLC/ServantHeaderGenerator.cpp | 176 | ||||
-rw-r--r-- | TAO/CIAO/CIDLC/ServantSourceGenerator.cpp | 25 | ||||
-rw-r--r-- | TAO/CIAO/ChangeLog | 21 |
3 files changed, 102 insertions, 120 deletions
diff --git a/TAO/CIAO/CIDLC/ServantHeaderGenerator.cpp b/TAO/CIAO/CIDLC/ServantHeaderGenerator.cpp index 1eab014edab..7d7b83e7d6d 100644 --- a/TAO/CIAO/CIDLC/ServantHeaderGenerator.cpp +++ b/TAO/CIAO/CIDLC/ServantHeaderGenerator.cpp @@ -298,81 +298,79 @@ namespace Traversal::Belongs read_belongs_; }; - struct FacetEmitter : Traversal::ProviderData, + struct InterfaceEmitter : Traversal::UnconstrainedInterface, + EmitterBase + { + InterfaceEmitter (Context& c) + : EmitterBase (c) + {} + + bool + add (UnconstrainedInterface& i) + { + return interfaces_.insert (&i).second; + } + + virtual void + traverse (UnconstrainedInterface& i) + { + if (add (i)) + { + Traversal::UnconstrainedInterface::traverse (i); + } + } + + private: + std::set<UnconstrainedInterface*> interfaces_; + }; + + struct FacetEmitter : Traversal::UnconstrainedInterface, EmitterBase { FacetEmitter (Context& c) - : EmitterBase (c), - simple_type_name_emitter_ (c.os ()), - stripped_type_name_emitter_ (c.os ()), - enclosing_type_name_emitter_ (c.os ()) + : EmitterBase (c) { - simple_belongs_.node_traverser (simple_type_name_emitter_); - stripped_belongs_.node_traverser (stripped_type_name_emitter_); - enclosing_belongs_.node_traverser (enclosing_type_name_emitter_); } virtual void - traverse (SemanticGraph::Provider& p) + traverse (UnconstrainedInterface& i) { + ScopedName scoped (i.scoped_name ()); + Name stripped (scoped.begin () + 1, scoped.end ()); + // Open a namespace. os << STRS[GLUE_NS] - << regex::perl_s (p.scoped_name ().scope_name ().scope_name ().str (), + << regex::perl_s (i.scoped_name ().scope_name ().str (), "/::/_/") - << "{"; - - os << "class " << ctx.export_macro () << " "; - - Traversal::ProviderData::belongs (p, simple_belongs_); - - os << "_Servant" << endl - << ": public virtual POA_"; - - Traversal::ProviderData::belongs (p, stripped_belongs_); - - os << "," << endl - << STRS[INH_RCSB] - << endl << "{" - << "public:" << endl; - - Traversal::ProviderData::belongs (p, simple_belongs_); - - os << "_Servant (" << endl; - - Traversal::ProviderData::belongs (p, enclosing_belongs_); - - os << "::CCM_"; - - Traversal::ProviderData::belongs (p, simple_belongs_); - - os << "_ptr executor," << endl - << "::Components::CCMContext_ptr ctx);" << endl; - - os << "virtual ~"; - - Traversal::ProviderData::belongs (p, simple_belongs_); - - os << "_Servant (void);" << endl; + << "class " << ctx.export_macro () << " " << i.name () + << "_Servant" << endl + << ": public virtual POA_" << stripped << "," << endl + << STRS[INH_RCSB] << endl + << "{" + << "public:" << endl + << i.name () << "_Servant (" << endl + << i.scoped_name ().scope_name () << "::CCM_" << i.name () + << "_ptr executor," << endl + << "::Components::CCMContext_ptr ctx);" << endl + << "virtual ~" << i.name () << "_Servant (void);" << endl; { - Traversal::Belongs belongs_; - Traversal::Interface interface_emitter; - belongs_.node_traverser (interface_emitter); + InterfaceEmitter interface_emitter (ctx); - Traversal::Defines defines; - Traversal::Inherits inherits; - interface_emitter.edge_traverser (defines); - interface_emitter.edge_traverser (inherits); + Traversal::Defines defines_; + Traversal::Inherits inherits_; + interface_emitter.edge_traverser (defines_); + interface_emitter.edge_traverser (inherits_); AttributeEmitter attribute_emitter (ctx); ReadOnlyAttributeEmitter read_only_attribute_emitter (ctx); - defines.node_traverser (attribute_emitter); - defines.node_traverser (read_only_attribute_emitter); + defines_.node_traverser (attribute_emitter); + defines_.node_traverser (read_only_attribute_emitter); OperationEmitter operation_emitter (ctx); - defines.node_traverser (operation_emitter); - inherits.node_traverser (interface_emitter); + defines_.node_traverser (operation_emitter); + inherits_.node_traverser (interface_emitter); Traversal::Receives receives; Traversal::Belongs returns; @@ -405,41 +403,26 @@ namespace inout_belongs.node_traverser (inout_arg_emitter); out_belongs.node_traverser (out_arg_emitter); - belongs (p, belongs_); + inherits (i, inherits_); + names (i, defines_); } os << "// Get component implementation." << endl << "virtual CORBA::Object_ptr" << endl << "_get_component (" << endl << STRS[ENV_SNGL_HDR] << ")" << endl - << STRS[EXCP_SNGL] << ";" << endl; - - os << "protected:" << endl - << "// Facet executor." << endl; - - Traversal::ProviderData::belongs (p, enclosing_belongs_); - - os << "::CCM_"; - - Traversal::ProviderData::belongs (p, simple_belongs_); - - os << "_var executor_;" << endl; - - os << "// Context object." << endl + << STRS[EXCP_SNGL] << ";" << endl + << "protected:" << endl + << "// Facet executor." << endl + << i.scoped_name ().scope_name ()<< "::CCM_" << i.name () + << "_var executor_;" << endl + << "// Context object." << endl << "::Components::CCMContext_var ctx_;" << endl - << "};" << endl << endl; + << "};" << endl; // Close the CIAO_GLUE namespace. os << "}" << endl; } - - private: - SimpleTypeNameEmitter simple_type_name_emitter_; - StrippedTypeNameEmitter stripped_type_name_emitter_; - EnclosingTypeNameEmitter enclosing_type_name_emitter_; - Traversal::Belongs simple_belongs_; - Traversal::Belongs stripped_belongs_; - Traversal::Belongs enclosing_belongs_; }; struct ContextEmitter : Traversal::Component, EmitterBase @@ -669,8 +652,15 @@ namespace // This can be moved later to ServantEmitter::pre() or out on its own. { Traversal::Defines defines; + + Traversal::Provider provider; + defines.node_traverser (provider); + + Traversal::Belongs belongs; + provider.edge_traverser (belongs); + FacetEmitter facet_emitter (ctx); - defines.node_traverser (facet_emitter); + belongs.node_traverser (facet_emitter); names (t, defines); } @@ -813,32 +803,6 @@ namespace } }; - struct InterfaceEmitter : Traversal::UnconstrainedInterface, - EmitterBase - { - InterfaceEmitter (Context& c) - : EmitterBase (c) - {} - - bool - add (UnconstrainedInterface& i) - { - return interfaces_.insert (&i).second; - } - - virtual void - traverse (UnconstrainedInterface& i) - { - if (add (i)) - { - Traversal::UnconstrainedInterface::traverse (i); - } - } - - private: - std::set<UnconstrainedInterface*> interfaces_; - }; - struct ServantEmitter : Traversal::Component, EmitterBase { ServantEmitter (Context& c) diff --git a/TAO/CIAO/CIDLC/ServantSourceGenerator.cpp b/TAO/CIAO/CIDLC/ServantSourceGenerator.cpp index 53cd5d2ee0d..dc622ad0921 100644 --- a/TAO/CIAO/CIDLC/ServantSourceGenerator.cpp +++ b/TAO/CIAO/CIDLC/ServantSourceGenerator.cpp @@ -420,12 +420,8 @@ namespace EmitterBase { FacetEmitter (Context& c) - : EmitterBase (c), - scope_type_name_emitter_ (c.os ()), - simple_type_name_emitter_ (c.os ()) + : EmitterBase (c) { - scope_belongs_.node_traverser (scope_type_name_emitter_); - simple_belongs_.node_traverser (simple_type_name_emitter_); } virtual void @@ -536,12 +532,6 @@ namespace // Close the CIAO_GLUE namespace. os << "}" << endl; } - - private: - EnclosingTypeNameEmitter scope_type_name_emitter_; - SimpleTypeNameEmitter simple_type_name_emitter_; - Traversal::Belongs scope_belongs_; - Traversal::Belongs simple_belongs_; }; struct ContextEmitter : Traversal::Component, EmitterBase @@ -1423,11 +1413,13 @@ namespace : EmitterBase (c), type_name_emitter_ (c.os ()), simple_type_name_emitter_ (c.os ()), - servant_type_name_emitter_ (c.os ()) + servant_type_name_emitter_ (c.os ()), + enclosing_type_name_emitter_ (c.os ()) { belongs_.node_traverser (type_name_emitter_); simple_belongs_.node_traverser (simple_type_name_emitter_); servant_belongs_.node_traverser (servant_type_name_emitter_); + enclosing_belongs_.node_traverser (enclosing_type_name_emitter_); } virtual void @@ -1443,8 +1435,11 @@ namespace << "{" << "if (::CORBA::is_nil (this->provide_" << p.name () << "_.in ()))" << endl - << "{" - << p.scoped_name ().scope_name ().scope_name () << "::CCM_"; + << "{"; + + Traversal::ProviderData::belongs (p, enclosing_belongs_); + + os << "::CCM_"; Traversal::ProviderData::belongs (p, simple_belongs_); @@ -1520,9 +1515,11 @@ namespace TypeNameEmitter type_name_emitter_; SimpleTypeNameEmitter simple_type_name_emitter_; ServantTypeNameEmitter servant_type_name_emitter_; + EnclosingTypeNameEmitter enclosing_type_name_emitter_; Traversal::Belongs belongs_; Traversal::Belongs simple_belongs_; Traversal::Belongs servant_belongs_; + Traversal::Belongs enclosing_belongs_; }; struct ConsumesEmitter : Traversal::ConsumerData, diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index 9e9f66b7a0f..e32dfa37291 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,24 @@ +Tue Mar 23 14:34:06 2004 Jeff Parsons <j.parsons@vanderbilt.edu> + + * CIDLC/ServantHeaderGenerator.cpp: + + Modified code generated by FacetEmitter class to generate + the _Servant class for a facet in the scope where the IDL + interface the facet employs is defined, as mandated by the + CCM spec. + + * CIDLC/ServantSourceGenerator.cpp: + + Change generation of the declaration of a local variable + which is a _var of the executor class for a facet to match the + scope of the declaration of the executor class itself, which + must be, as mentioned above, in the same scope as the declaration + of the IDL interface used by the facet. + + Thanks to Jessica Pistole <Jessica.Pistole@jhuapl.edu> for + sending the example IDL/CIDL files that demostrated the + problem. + Tue Mar 16 11:22:44 2004 Venkita Subramonian <venkita@cs.wustl.edu> * docs/static_ciao_contents.html: |