summaryrefslogtreecommitdiff
path: root/CIAO/CIDLC/ServantSourceGenerator.cpp
diff options
context:
space:
mode:
authordengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-12-11 21:55:40 +0000
committerdengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-12-11 21:55:40 +0000
commit073a3a4c7bfc25a6d5168e07e8da701e7f0abe7d (patch)
tree380c0c7faa85b15445f25dce5be363bc70b193c9 /CIAO/CIDLC/ServantSourceGenerator.cpp
parent3a156054fd037b7152aeb4e530adda35c13f576b (diff)
downloadATCD-073a3a4c7bfc25a6d5168e07e8da701e7f0abe7d.tar.gz
Mon Dec 11 20:55:39 UTC 2006 Gan Deng <gan.deng@vanderbilt.edu>
Diffstat (limited to 'CIAO/CIDLC/ServantSourceGenerator.cpp')
-rw-r--r--CIAO/CIDLC/ServantSourceGenerator.cpp56
1 files changed, 50 insertions, 6 deletions
diff --git a/CIAO/CIDLC/ServantSourceGenerator.cpp b/CIAO/CIDLC/ServantSourceGenerator.cpp
index df7722c77d1..25562a84b7b 100644
--- a/CIAO/CIDLC/ServantSourceGenerator.cpp
+++ b/CIAO/CIDLC/ServantSourceGenerator.cpp
@@ -549,18 +549,20 @@ namespace
// Nested classes used by ContextEmitter.
private:
struct ContextPortsEmitter : Traversal::SingleUserData,
- Traversal::MultiUserData,
- Traversal::PublisherData,
- Traversal::EmitterData,
- EmitterBase
+ Traversal::MultiUserData,
+ Traversal::PublisherData,
+ Traversal::EmitterData,
+ EmitterBase
{
ContextPortsEmitter (Context& c, SemanticGraph::Component& scope)
: EmitterBase (c),
type_name_emitter_ (c),
+ enclosing_type_name_emitter_ (c),
simple_type_name_emitter_ (c),
scope_ (scope)
{
belongs_.node_traverser (type_name_emitter_);
+ enclosing_belongs_.node_traverser (enclosing_type_name_emitter_);
simple_belongs_.node_traverser (simple_type_name_emitter_);
}
@@ -822,6 +824,13 @@ namespace
<< "ACE_CHECK;" << endl
<< "}";
+ // @@ GD Modified Code Below
+
+ os << endl;
+ os << "ACE_CString source_id = this->_ciao_instance_id ();";
+ os << "source_id += \"_\";" << endl;
+ os << "source_id += \"" << p.name () << "\";//port name" << endl << endl;
+
os << "for (ACE_Active_Map_Manager< " << endl
<< " " << STRS[COMP_ECB] << "_var>::iterator giter =" << endl
<< " this->ciao_publishes_" << p.name ()
@@ -830,8 +839,17 @@ namespace
<< "_generic_map_.end ();" << endl
<< "++giter)" << endl
<< "{"
- << "(*giter).int_id_->push_event" << " (" << endl
- << "ev" << endl
+ << "(*giter).int_id_->ciao_push_event" << " (" << endl
+ << "ev," << endl
+ << "source_id.c_str ()," << endl;
+
+ Traversal::PublisherData::belongs (p, enclosing_belongs_);
+
+ os << "::_tc_";
+
+ Traversal::PublisherData::belongs (p, simple_belongs_);
+
+ os << endl
<< STRS[ENV_ARG] << ");"
<< "ACE_CHECK;" << endl
<< "}"
@@ -1033,8 +1051,10 @@ namespace
private:
FullTypeNameEmitter type_name_emitter_;
+ EnclosingTypeNameEmitter enclosing_type_name_emitter_;
SimpleTypeNameEmitter simple_type_name_emitter_;
Traversal::Belongs belongs_;
+ Traversal::Belongs enclosing_belongs_;
Traversal::Belongs simple_belongs_;
SemanticGraph::Component& scope_;
};
@@ -2218,6 +2238,30 @@ namespace
<< "ACE_THROW ( " << STRS[EXCP_BET] << " ());" << endl
<< "}";
+ // GD Added below code
+ // Begin
+
+ os << "// Inherited from " << STRS[COMP_ECB] << "." << endl
+ << "void" << endl
+ << scope_.name () << "_Servant::";
+
+ Traversal::ConsumerData::belongs (c, simple_belongs_);
+
+ os << "Consumer_" << c.name ()
+ << "_Servant::ciao_push_event (" << endl
+ << "::Components::EventBase *ev," << endl
+ << "const char * /* source_id */," << endl
+ << "::CORBA::TypeCode_ptr /* tc */" << endl
+ << STRS[ENV_SRC] << ")" << endl
+ << STRS[EXCP_START] << " "
+ << STRS[EXCP_SYS] << "," << endl
+ << STRS[EXCP_BET] << "))" << endl
+ << "{"
+ << "this->push_event (ev);" << endl
+ << "}";
+
+ // End
+
os << "CORBA::Boolean" << endl
<< scope_.name () << "_Servant::";