You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(86) |
Dec
(163) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(114) |
Feb
(254) |
Mar
(166) |
Apr
(122) |
May
(131) |
Jun
(59) |
Jul
(201) |
Aug
(85) |
Sep
(80) |
Oct
(64) |
Nov
(103) |
Dec
(36) |
2005 |
Jan
(231) |
Feb
(204) |
Mar
(71) |
Apr
(54) |
May
(50) |
Jun
(120) |
Jul
(17) |
Aug
(124) |
Sep
(75) |
Oct
(154) |
Nov
(37) |
Dec
(143) |
2006 |
Jan
(346) |
Feb
(170) |
Mar
|
Apr
|
May
(273) |
Jun
(113) |
Jul
(427) |
Aug
(570) |
Sep
(212) |
Oct
(550) |
Nov
(348) |
Dec
(314) |
2007 |
Jan
(709) |
Feb
(223) |
Mar
(104) |
Apr
(24) |
May
(11) |
Jun
(3) |
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Robert L. <rle...@us...> - 2007-03-05 09:21:26
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30263/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space Modified Files: Alien_gen.cc Alien_gen.h Log Message: new prototype Index: Alien_gen.cc =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space/Alien_gen.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Alien_gen.cc 5 Mar 2007 07:35:36 -0000 1.3 --- Alien_gen.cc 5 Mar 2007 09:21:21 -0000 1.4 *************** *** 36,40 **** context = NULL; ValidConnection = local_component!=NULL; ! delegator = dynamic_cast< ::Components::ComponentDelegator>(local_component); Ar4_receptacle_counter = 0; --- 36,40 ---- context = NULL; ValidConnection = local_component!=NULL; ! delegator = dynamic_cast< ::Components::ComponentDelegator*>(local_component); Ar4_receptacle_counter = 0; *************** *** 101,152 **** } void ! Alien::connect_Ar3(::World::Data::SmartPtr f) ! throw(::Components::AlreadyConnected, ::Components::InvalidConnection) { - if(!ValidConnection) - { - throw ::Components::InvalidConnection(); - } if(delegator) { ! delegator->connect("Ar3", f); ! Ar3_receptacle = f; } else { ! if(Ar3_receptacle) { throw ::Components::AlreadyConnected(); } - Ar3_receptacle = f; } } ! ::World::Data::SmartPtr ! Alien::disconnect_Ar3() ! throw(::Components::NoConnection, ::Components::InvalidConnection) { - if(!ValidConnection) - { - throw ::Components::InvalidConnection(); - } if(delegator) { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar3"); ! Ar3_receptacle.forget(); ! ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); ! return f; } else { ! if(!Ar3_receptacle) { throw ::Components::NoConnection(); } - ::World::Data::SmartPtr f = Ar3_receptacle; - Ar3_receptacle.forget(); - return f; } } --- 101,164 ---- } + template<typename T> void ! generic_single_connect(T& receptacle, const std::string& name, const T& f, ! ::Components::ComponentDelegator* delegator) { if(delegator) { ! delegator->connect(name, f); } else { ! if(receptacle) { throw ::Components::AlreadyConnected(); } } + receptacle = f; } ! void ! Alien::connect_Ar3(::World::Data::SmartPtr f) ! throw(::Components::AlreadyConnected, ::Components::InvalidConnection) ! { ! if(!ValidConnection) ! { ! throw ::Components::InvalidConnection(); ! } ! generic_single_connect(Ar3_receptacle, "Ar3", f, delegator); ! } ! ! template<typename T> ! T ! generic_single_disconnect(T& receptacle, const std::string& name, ! ::Components::ComponentDelegator* delegator) { if(delegator) { ! delegator->disconnect(name); } else { ! if(!receptacle) { throw ::Components::NoConnection(); } } + T f = receptacle; + receptacle.forget(); + return f; + } + + ::World::Data::SmartPtr + Alien::disconnect_Ar3() + throw(::Components::NoConnection, ::Components::InvalidConnection) + { + if(!ValidConnection) + { + throw ::Components::InvalidConnection(); + } + return generic_single_disconnect(Ar3_receptacle, "Ar3", delegator); } *************** *** 164,180 **** } ::Components::Cookie ! Alien::connect_Ar4(::World::Data::SmartPtr f) ! throw(::Components::ExceededConnectionLimit, ::Components::InvalidConnection) { - if(!ValidConnection) - { - throw ::Components::InvalidConnection(); - } if(delegator) { ! ::Components::Cookie ck = delegator->connect("Ar4", f); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar4_receptacles.insert(make_pair(ck, ccmf)); return ck; } --- 176,189 ---- } + template<typename MAP, typename T> ::Components::Cookie ! generic_multiple_connect(MAP& receptacles, long& receptacle_counter, ! const std::string& name, const T& f, ! ::Components::ComponentDelegator* delegator) { if(delegator) { ! ::Components::Cookie ck = delegator->connect(name, f); ! receptacles.insert(make_pair(ck, f)); return ck; } *************** *** 182,196 **** { stringstream s; ! s << "CCM_Ar4:" << Ar4_receptacle_counter++; ::Components::Cookie ck(s.str()); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar4_receptacles.insert(make_pair(ck, ccmf)); return ck; } } ! ::World::Data::SmartPtr ! Alien::disconnect_Ar4(::Components::Cookie ck) ! throw(::Components::InvalidConnection) { if(!ValidConnection) --- 191,204 ---- { stringstream s; ! s << "CCM_" << name << ":" << receptacle_counter++; ::Components::Cookie ck(s.str()); ! receptacles.insert(make_pair(ck, f)); return ck; } } ! ::Components::Cookie ! Alien::connect_Ar4(::World::Data::SmartPtr f) ! throw(::Components::ExceededConnectionLimit, ::Components::InvalidConnection) { if(!ValidConnection) *************** *** 198,214 **** throw ::Components::InvalidConnection(); } if(delegator) { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar4", ck); ! Ar4_receptacles.erase(ck); ! ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); return f; } else { ! if(Ar4_receptacles.find(ck) != Ar4_receptacles.end()) { ! ::World::CCM_Data::SmartPtr f(Ar4_receptacles[ck]); ! Ar4_receptacles.erase(ck); return f; } --- 206,231 ---- throw ::Components::InvalidConnection(); } + return generic_multiple_connect(Ar4_receptacles, Ar4_receptacle_counter, "Ar4", f, delegator); + } + + template<typename MAP, typename T> + T + generic_multiple_disconnect(MAP& receptacles, const std::string& name, + const ::Components::Cookie& ck, + ::Components::ComponentDelegator* delegator) + { if(delegator) { ! delegator->disconnect(name, ck); ! T f = receptacles[ck]; ! receptacles.erase(ck); return f; } else { ! if(receptacles.find(ck) != receptacles.end()) { ! T f = receptacles[ck]; ! receptacles.erase(ck); return f; } *************** *** 220,223 **** --- 237,251 ---- } + ::World::Data::SmartPtr + Alien::disconnect_Ar4(::Components::Cookie ck) + throw(::Components::InvalidConnection) + { + if(!ValidConnection) + { + throw ::Components::InvalidConnection(); + } + return generic_multiple_disconnect< ::Space::Alien_Ar4_Connections, ::World::Data::SmartPtr>(Ar4_receptacles, "Ar4", ck, delegator); + } + ::Space::Alien_Ar4_Connections& Alien::get_connections_Ar4 ( ) *************** *** 238,254 **** throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! delegator->connect("Ar10", f); ! Ar10_receptacle = f; ! } ! else ! { ! if(Ar10_receptacle) ! { ! throw ::Components::AlreadyConnected(); ! } ! Ar10_receptacle = f; ! } } --- 266,270 ---- throw ::Components::InvalidConnection(); } ! generic_single_connect(Ar10_receptacle, "Ar10", f, delegator); } *************** *** 261,281 **** throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar10"); ! Ar10_receptacle.forget(); ! ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); ! return f; ! } ! else ! { ! if(!Ar10_receptacle) ! { ! throw ::Components::NoConnection(); ! } ! ::World::Data::SmartPtr f = Ar10_receptacle; ! Ar10_receptacle.forget(); ! return f; ! } } --- 277,281 ---- throw ::Components::InvalidConnection(); } ! return generic_single_disconnect(Ar10_receptacle, "Ar10", delegator); } *************** *** 301,317 **** throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! delegator->connect("Ar6a", f); ! Ar6a_receptacle = f; ! } ! else ! { ! if(Ar6a_receptacle) ! { ! throw ::Components::AlreadyConnected(); ! } ! Ar6a_receptacle = f; ! } } --- 301,305 ---- throw ::Components::InvalidConnection(); } ! generic_single_connect(Ar6a_receptacle, "Ar6a", f, delegator); } *************** *** 324,344 **** throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar6a"); ! Ar6a_receptacle.forget(); ! ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); ! return f; ! } ! else ! { ! if(!Ar6a_receptacle) ! { ! throw ::Components::NoConnection(); ! } ! ::World::Data::SmartPtr f = Ar6a_receptacle; ! Ar6a_receptacle.forget(); ! return f; ! } } --- 312,316 ---- throw ::Components::InvalidConnection(); } ! return generic_single_disconnect(Ar6a_receptacle, "Ar6a", delegator); } *************** *** 364,380 **** throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! delegator->connect("Ar6b", f); ! Ar6b_receptacle = f; ! } ! else ! { ! if(Ar6b_receptacle) ! { ! throw ::Components::AlreadyConnected(); ! } ! Ar6b_receptacle = f; ! } } --- 336,340 ---- throw ::Components::InvalidConnection(); } ! generic_single_connect(Ar6b_receptacle, "Ar6b", f, delegator); } *************** *** 387,407 **** throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar6b"); ! Ar6b_receptacle.forget(); ! ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); ! return f; ! } ! else ! { ! if(!Ar6b_receptacle) ! { ! throw ::Components::NoConnection(); ! } ! ::World::Data::SmartPtr f = Ar6b_receptacle; ! Ar6b_receptacle.forget(); ! return f; ! } } --- 347,351 ---- throw ::Components::InvalidConnection(); } ! return generic_single_disconnect(Ar6b_receptacle, "Ar6b", delegator); } *************** *** 427,446 **** throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Cookie ck = delegator->connect("Ar7a", f); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar7a_receptacles.insert(make_pair(ck, ccmf)); ! return ck; ! } ! else ! { ! stringstream s; ! s << "CCM_Ar7a:" << Ar7a_receptacle_counter++; ! ::Components::Cookie ck(s.str()); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar7a_receptacles.insert(make_pair(ck, ccmf)); ! return ck; ! } } --- 371,375 ---- throw ::Components::InvalidConnection(); } ! return generic_multiple_connect(Ar7a_receptacles, Ar7a_receptacle_counter, "Ar7a", f, delegator); } *************** *** 453,476 **** throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar7a", ck); ! Ar7a_receptacles.erase(ck); ! ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); ! return f; ! } ! else ! { ! if(Ar7a_receptacles.find(ck) != Ar7a_receptacles.end()) ! { ! ::World::CCM_Data::SmartPtr f(Ar7a_receptacles[ck]); ! Ar7a_receptacles.erase(ck); ! return f; ! } ! else ! { ! throw ::Components::InvalidConnection(); ! } ! } } --- 382,386 ---- throw ::Components::InvalidConnection(); } ! return generic_multiple_disconnect< ::Space::Alien_Ar7a_Connections, ::World::Data::SmartPtr>(Ar7a_receptacles, "Ar7a", ck, delegator); } *************** *** 493,512 **** throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Cookie ck = delegator->connect("Ar7b", f); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar7b_receptacles.insert(make_pair(ck, ccmf)); ! return ck; ! } ! else ! { ! stringstream s; ! s << "CCM_Ar7b:" << Ar7b_receptacle_counter++; ! ::Components::Cookie ck(s.str()); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar7b_receptacles.insert(make_pair(ck, ccmf)); ! return ck; ! } } --- 403,407 ---- throw ::Components::InvalidConnection(); } ! return generic_multiple_connect(Ar7b_receptacles, Ar7b_receptacle_counter, "Ar7b", f, delegator); } *************** *** 519,542 **** throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar7b", ck); ! Ar7b_receptacles.erase(ck); ! ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); ! return f; ! } ! else ! { ! if(Ar7b_receptacles.find(ck) != Ar7b_receptacles.end()) ! { ! ::World::CCM_Data::SmartPtr f(Ar7b_receptacles[ck]); ! Ar7b_receptacles.erase(ck); ! return f; ! } ! else ! { ! throw ::Components::InvalidConnection(); ! } ! } } --- 414,418 ---- throw ::Components::InvalidConnection(); } ! return generic_multiple_disconnect< ::Space::Alien_Ar7b_Connections, ::World::Data::SmartPtr>(Ar7b_receptacles, "Ar7b", ck, delegator); } Index: Alien_gen.h =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space/Alien_gen.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Alien_gen.h 2 Mar 2007 14:44:43 -0000 1.1 --- Alien_gen.h 5 Mar 2007 09:21:21 -0000 1.2 *************** *** 166,170 **** ::Components::Assembly::SmartPtr assembly; bool ValidConnection; ! ::Components::ComponentDelegator delegator; ::World::Data::SmartPtr Ap1_facet; --- 166,170 ---- ::Components::Assembly::SmartPtr assembly; bool ValidConnection; ! ::Components::ComponentDelegator* delegator; ::World::Data::SmartPtr Ap1_facet; |
From: Robert L. <rle...@us...> - 2007-03-05 09:21:25
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30263/test/CppAssembly/prototype1/impl/space Modified Files: Alien_impl.cc Alien_impl.h Log Message: new prototype Index: Alien_impl.h =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/Alien_impl.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Alien_impl.h 4 Mar 2007 16:50:30 -0000 1.4 --- Alien_impl.h 5 Mar 2007 09:21:22 -0000 1.5 *************** *** 28,31 **** --- 28,32 ---- { private: + ::wamas::platform::utils::SmartPtr< ::Components::CCMObject> inner_; bool ccm_activate_ok; *************** *** 38,44 **** // ComponentDelegator implementation ! virtual ::Components::Object::SmartPtr provide(const char* facet); ! virtual ::Components::Cookie connect(const char* receptacle, ::Components::Object::SmartPtr facet); ! virtual ::Components::Object::SmartPtr disconnect(const char* receptacle, ::Components::Cookie const& cookie); private: --- 39,45 ---- // ComponentDelegator implementation ! virtual ::Components::Object::SmartPtr provide(const std::string& facet); ! virtual ::Components::Cookie connect(const ::Components::FeatureName& receptacle, ::Components::Object::SmartPtr facet); ! virtual void disconnect(const ::Components::FeatureName& receptacle, ::Components::Cookie const& cookie); private: Index: Alien_impl.cc =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/Alien_impl.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Alien_impl.cc 4 Mar 2007 16:50:30 -0000 1.2 --- Alien_impl.cc 5 Mar 2007 09:21:22 -0000 1.3 *************** *** 24,27 **** --- 24,31 ---- Ap1_ = NULL; Ap10_ = NULL; + ::Components::HomeFinder* finder = ::Components::HomeFinder::Instance(); + ::Components::CCMHome::SmartPtr hp = finder->find_home_by_name("Worker"); + ::Components::KeylessCCMHome* home = dynamic_cast< ::Components::KeylessCCMHome*>(hp.ptr()); + inner_ = home->create_component(); } *************** *** 30,45 **** } ! ::Components::Object::SmartPtr Alien_impl::provide(const char* facet) { } ! ::Components::Cookie Alien_impl::connect(const char* receptacle, ::Components::Object::SmartPtr facet) { } ! ::Components::Object::SmartPtr Alien_impl::disconnect(const char* receptacle, ::Components::Cookie const& cookie) { } void Alien_impl::set_session_context(Components::SessionContext* context) --- 34,69 ---- } ! ! ::Components::Object::SmartPtr Alien_impl::provide(const std::string& facet) { + if(facet=="Ap1") + { + return inner_->provide_facet("p1"); + } + // TODO } ! ! ::Components::Cookie Alien_impl::connect(const ::Components::FeatureName& receptacle, ::Components::Object::SmartPtr facet) { + if(receptacle=="Ar3") + { + return inner_->connect("r3", facet); + } + // TODO } ! ! void Alien_impl::disconnect(const ::Components::FeatureName& receptacle, ::Components::Cookie const& cookie) { + if(receptacle=="Ar3") + { + inner_->disconnect("r3", cookie); + return; + } + // TODO } + void Alien_impl::set_session_context(Components::SessionContext* context) |
From: Robert L. <rle...@us...> - 2007-03-05 09:21:25
|
Update of /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30263/src/templates/CppLocalTemplates Modified Files: MComponentDef MUsesDefAdapterDefinition MUsesDefAdapterDefinitionMultiple MUsesDefConnectionMapMultiple Log Message: new prototype Index: MUsesDefAdapterDefinition =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefAdapterDefinition,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** MUsesDefAdapterDefinition 1 Mar 2007 15:55:19 -0000 1.13 --- MUsesDefAdapterDefinition 5 Mar 2007 09:21:21 -0000 1.14 *************** *** 26,30 **** throw ::Components::NoConnection(); } ! local_component->disconnect("%(Identifier)s"); %(UsesType)s::SmartPtr f = %(Identifier)s_receptacle; %(Identifier)s_receptacle.forget(); --- 26,30 ---- throw ::Components::NoConnection(); } ! // local_component->disconnect("%(Identifier)s"); %(UsesType)s::SmartPtr f = %(Identifier)s_receptacle; %(Identifier)s_receptacle.forget(); Index: MUsesDefConnectionMapMultiple =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefConnectionMapMultiple,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MUsesDefConnectionMapMultiple 1 Mar 2007 15:55:19 -0000 1.8 --- MUsesDefConnectionMapMultiple 5 Mar 2007 09:21:21 -0000 1.9 *************** *** 1,4 **** typedef std::map< ::Components::Cookie, ! %(CCMUsesType)s::SmartPtr> %(MultipleReceptacleType)s; --- 1,4 ---- typedef std::map< ::Components::Cookie, ! %(UsesType)s::SmartPtr> %(MultipleReceptacleType)s; Index: MComponentDef =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MComponentDef,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** MComponentDef 1 Mar 2007 15:55:19 -0000 1.27 --- MComponentDef 5 Mar 2007 09:21:21 -0000 1.28 *************** *** 360,365 **** virtual ~CCM_%(Identifier)s() {} - virtual void disconnect(const std::string& receptacle) = 0; - %(MAttributeDefPrototypeVV)s %(MProvidesDefGetFacetPrototypeVV)s --- 360,363 ---- *************** *** 424,428 **** **/ class %(Identifier)s_impl ! : virtual public %(LocalNamespace)sCCM_%(Identifier)s%(BaseType)s { private: --- 422,426 ---- **/ class %(Identifier)s_impl ! : virtual public %(LocalNamespace)sCCM_%(Identifier)s%(BaseType)s%(AssemblyImplBase)s { private: *************** *** 438,441 **** --- 436,440 ---- virtual ~%(Identifier)s_impl(); + %(AssemblyImplPrototype)s %(MAttributeDefPrototype)s %(MProvidesDefGetFacetPrototype)s *************** *** 455,460 **** virtual void ccm_remove() throw(Components::CCMException); - - virtual void disconnect(const std::string& receptacle); }; --- 454,457 ---- *************** *** 543,552 **** } ! void ! %(Identifier)s_impl::disconnect(const std::string& receptacle) ! { ! %(AssemblyDisconnect)s ! } ! %(MProvidesDefGetFacetDefinition)s --- 540,544 ---- } ! %(AssemblyImplDefinition)s %(MProvidesDefGetFacetDefinition)s Index: MUsesDefAdapterDefinitionMultiple =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefAdapterDefinitionMultiple,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** MUsesDefAdapterDefinitionMultiple 1 Mar 2007 15:55:19 -0000 1.13 --- MUsesDefAdapterDefinitionMultiple 5 Mar 2007 09:21:21 -0000 1.14 *************** *** 10,15 **** s << "CCM_%(Identifier)s:" << %(Identifier)s_receptacle_counter++; ::Components::Cookie ck(s.str()); ! %(CCMUsesType)s::SmartPtr ccmf(dynamic_cast< %(CCMUsesType)s* >(f.ptr())); ! %(Identifier)s_receptacles.insert(make_pair(ck, ccmf)); return ck; } --- 10,14 ---- s << "CCM_%(Identifier)s:" << %(Identifier)s_receptacle_counter++; ::Components::Cookie ck(s.str()); ! %(Identifier)s_receptacles.insert(make_pair(ck, f)); return ck; } *************** *** 25,29 **** if(%(Identifier)s_receptacles.find(ck) != %(Identifier)s_receptacles.end()) { ! %(CCMUsesType)s::SmartPtr f(%(Identifier)s_receptacles[ck]); %(Identifier)s_receptacles.erase(ck); return f; --- 24,28 ---- if(%(Identifier)s_receptacles.find(ck) != %(Identifier)s_receptacles.end()) { ! %(UsesType)s::SmartPtr f(%(Identifier)s_receptacles[ck]); %(Identifier)s_receptacles.erase(ck); return f; |
From: Robert L. <rle...@us...> - 2007-03-05 09:21:25
|
Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/CppGenerator In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30263/src/ccmtools/CppGenerator Modified Files: CppAssemblyGenerator.java Log Message: new prototype Index: CppAssemblyGenerator.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/CppGenerator/CppAssemblyGenerator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CppAssemblyGenerator.java 1 Mar 2007 15:55:20 -0000 1.7 --- CppAssemblyGenerator.java 5 Mar 2007 09:21:21 -0000 1.8 *************** *** 168,174 **** return variable_AssemblyCcmRemove(); } ! if (data_type.equals("AssemblyDisconnect")) { ! return variable_AssemblyDisconnect(); } return super.data_MComponentDef(data_type, data_value); --- 168,185 ---- return variable_AssemblyCcmRemove(); } ! if(data_type.equals("AssemblyImplBase")) { ! // TODO ! return "/* AssemblyImplBase */"; ! } ! if(data_type.equals("AssemblyImplPrototype")) ! { ! // TODO ! return "// AssemblyImplPrototype"; ! } ! if(data_type.equals("AssemblyImplDefinition")) ! { ! // TODO ! return "// AssemblyImplDefinition"; } return super.data_MComponentDef(data_type, data_value); *************** *** 496,500 **** } ! protected String variable_AssemblyDisconnect() { if (currentAssembly == null) --- 507,511 ---- } ! private String variable_AssemblyDisconnect() { if (currentAssembly == null) |
From: Robert L. <rle...@us...> - 2007-03-05 09:21:24
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30263/test/CppAssembly/prototype1 Modified Files: Makefile Log Message: new prototype Index: Makefile =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 2 Mar 2007 13:27:30 -0000 1.2 --- Makefile 5 Mar 2007 09:21:20 -0000 1.3 *************** *** 1,4 **** --- 1,5 ---- ITF="gen/idl/interface" COMP="gen/idl/component" + SPACE_GEN="space/GEN_ccmtools_local_Space" all: local *************** *** 10,15 **** ccmtools c++local -a -o gen/space -I$(ITF) -I$(COMP) $(COMP)/Space/*.idl ! check: local cp -p impl/space/*.h impl/space/*.cc gen/space/ ccmconfix -confix2 -o gen -pname "assembly-prototype2" -pversion "0.0.1" cd gen && confix2.py --bootstrap --configure --make --targets=check --- 11,19 ---- ccmtools c++local -a -o gen/space -I$(ITF) -I$(COMP) $(COMP)/Space/*.idl ! copy: cp -p impl/space/*.h impl/space/*.cc gen/space/ + cp -p impl/$(SPACE_GEN)/*.h impl/$(SPACE_GEN)/*.cc gen/$(SPACE_GEN)/ + + check: local copy ccmconfix -confix2 -o gen -pname "assembly-prototype2" -pversion "0.0.1" cd gen && confix2.py --bootstrap --configure --make --targets=check |
From: Robert L. <rle...@us...> - 2007-03-05 07:35:40
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22998/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space Modified Files: Alien_gen.cc Log Message: new prototype Index: Alien_gen.cc =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space/Alien_gen.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Alien_gen.cc 4 Mar 2007 16:50:31 -0000 1.2 --- Alien_gen.cc 5 Mar 2007 07:35:36 -0000 1.3 *************** *** 238,246 **** throw ::Components::InvalidConnection(); } ! if(Ar10_receptacle) ! { ! throw ::Components::AlreadyConnected(); ! } ! Ar10_receptacle = f; } --- 238,254 ---- throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! delegator->connect("Ar10", f); ! Ar10_receptacle = f; ! } ! else ! { ! if(Ar10_receptacle) ! { ! throw ::Components::AlreadyConnected(); ! } ! Ar10_receptacle = f; ! } } *************** *** 253,264 **** throw ::Components::InvalidConnection(); } ! if(!Ar10_receptacle) ! { ! throw ::Components::NoConnection(); ! } ! // local_component->disconnect("Ar10"); ! ::World::Data::SmartPtr f = Ar10_receptacle; ! Ar10_receptacle.forget(); ! return f; } --- 261,281 ---- throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar10"); ! Ar10_receptacle.forget(); ! ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); ! return f; ! } ! else ! { ! if(!Ar10_receptacle) ! { ! throw ::Components::NoConnection(); ! } ! ::World::Data::SmartPtr f = Ar10_receptacle; ! Ar10_receptacle.forget(); ! return f; ! } } *************** *** 284,292 **** throw ::Components::InvalidConnection(); } ! if(Ar6a_receptacle) ! { ! throw ::Components::AlreadyConnected(); ! } ! Ar6a_receptacle = f; } --- 301,317 ---- throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! delegator->connect("Ar6a", f); ! Ar6a_receptacle = f; ! } ! else ! { ! if(Ar6a_receptacle) ! { ! throw ::Components::AlreadyConnected(); ! } ! Ar6a_receptacle = f; ! } } *************** *** 299,310 **** throw ::Components::InvalidConnection(); } ! if(!Ar6a_receptacle) ! { ! throw ::Components::NoConnection(); ! } ! // local_component->disconnect("Ar6a"); ! ::World::Data::SmartPtr f = Ar6a_receptacle; ! Ar6a_receptacle.forget(); ! return f; } --- 324,344 ---- throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar6a"); ! Ar6a_receptacle.forget(); ! ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); ! return f; ! } ! else ! { ! if(!Ar6a_receptacle) ! { ! throw ::Components::NoConnection(); ! } ! ::World::Data::SmartPtr f = Ar6a_receptacle; ! Ar6a_receptacle.forget(); ! return f; ! } } *************** *** 330,338 **** throw ::Components::InvalidConnection(); } ! if(Ar6b_receptacle) ! { ! throw ::Components::AlreadyConnected(); ! } ! Ar6b_receptacle = f; } --- 364,380 ---- throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! delegator->connect("Ar6b", f); ! Ar6b_receptacle = f; ! } ! else ! { ! if(Ar6b_receptacle) ! { ! throw ::Components::AlreadyConnected(); ! } ! Ar6b_receptacle = f; ! } } *************** *** 345,356 **** throw ::Components::InvalidConnection(); } ! if(!Ar6b_receptacle) ! { ! throw ::Components::NoConnection(); ! } ! // local_component->disconnect("Ar6b"); ! ::World::Data::SmartPtr f = Ar6b_receptacle; ! Ar6b_receptacle.forget(); ! return f; } --- 387,407 ---- throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar6b"); ! Ar6b_receptacle.forget(); ! ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); ! return f; ! } ! else ! { ! if(!Ar6b_receptacle) ! { ! throw ::Components::NoConnection(); ! } ! ::World::Data::SmartPtr f = Ar6b_receptacle; ! Ar6b_receptacle.forget(); ! return f; ! } } *************** *** 376,385 **** throw ::Components::InvalidConnection(); } ! stringstream s; ! s << "CCM_Ar7a:" << Ar7a_receptacle_counter++; ! ::Components::Cookie ck(s.str()); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar7a_receptacles.insert(make_pair(ck, ccmf)); ! return ck; } --- 427,446 ---- throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Cookie ck = delegator->connect("Ar7a", f); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar7a_receptacles.insert(make_pair(ck, ccmf)); ! return ck; ! } ! else ! { ! stringstream s; ! s << "CCM_Ar7a:" << Ar7a_receptacle_counter++; ! ::Components::Cookie ck(s.str()); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar7a_receptacles.insert(make_pair(ck, ccmf)); ! return ck; ! } } *************** *** 392,404 **** throw ::Components::InvalidConnection(); } ! if(Ar7a_receptacles.find(ck) != Ar7a_receptacles.end()) { ! ::World::CCM_Data::SmartPtr f(Ar7a_receptacles[ck]); Ar7a_receptacles.erase(ck); return f; } else { ! throw ::Components::InvalidConnection(); } } --- 453,475 ---- throw ::Components::InvalidConnection(); } ! if(delegator) { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar7a", ck); Ar7a_receptacles.erase(ck); + ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); return f; } else { ! if(Ar7a_receptacles.find(ck) != Ar7a_receptacles.end()) ! { ! ::World::CCM_Data::SmartPtr f(Ar7a_receptacles[ck]); ! Ar7a_receptacles.erase(ck); ! return f; ! } ! else ! { ! throw ::Components::InvalidConnection(); ! } } } *************** *** 422,431 **** throw ::Components::InvalidConnection(); } ! stringstream s; ! s << "CCM_Ar7b:" << Ar7b_receptacle_counter++; ! ::Components::Cookie ck(s.str()); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar7b_receptacles.insert(make_pair(ck, ccmf)); ! return ck; } --- 493,512 ---- throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Cookie ck = delegator->connect("Ar7b", f); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar7b_receptacles.insert(make_pair(ck, ccmf)); ! return ck; ! } ! else ! { ! stringstream s; ! s << "CCM_Ar7b:" << Ar7b_receptacle_counter++; ! ::Components::Cookie ck(s.str()); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar7b_receptacles.insert(make_pair(ck, ccmf)); ! return ck; ! } } *************** *** 438,450 **** throw ::Components::InvalidConnection(); } ! if(Ar7b_receptacles.find(ck) != Ar7b_receptacles.end()) { ! ::World::CCM_Data::SmartPtr f(Ar7b_receptacles[ck]); Ar7b_receptacles.erase(ck); return f; } else { ! throw ::Components::InvalidConnection(); } } --- 519,541 ---- throw ::Components::InvalidConnection(); } ! if(delegator) { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar7b", ck); Ar7b_receptacles.erase(ck); + ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); return f; } else { ! if(Ar7b_receptacles.find(ck) != Ar7b_receptacles.end()) ! { ! ::World::CCM_Data::SmartPtr f(Ar7b_receptacles[ck]); ! Ar7b_receptacles.erase(ck); ! return f; ! } ! else ! { ! throw ::Components::InvalidConnection(); ! } } } |
From: Robert L. <rle...@us...> - 2007-03-04 16:50:40
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19940/impl/space/GEN_ccmtools_local_Space Modified Files: Alien_gen.cc Log Message: Index: Alien_gen.cc =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space/Alien_gen.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Alien_gen.cc 2 Mar 2007 14:44:43 -0000 1.1 --- Alien_gen.cc 4 Mar 2007 16:50:31 -0000 1.2 *************** *** 112,115 **** --- 112,116 ---- { delegator->connect("Ar3", f); + Ar3_receptacle = f; } else *************** *** 134,137 **** --- 135,139 ---- { ::Components::Object::SmartPtr o = delegator->disconnect("Ar3"); + Ar3_receptacle.forget(); ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); return f; *************** *** 157,172 **** throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! Object::SmartPtr o = delegator->get_single_connection("Ar3"); ! ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); ! return f; ! } ! else ! { ! if(!Ar3_receptacle) ! throw ::Components::NoConnection(); ! return Ar3_receptacle; ! } } --- 159,165 ---- throw ::Components::InvalidConnection(); } ! if(!Ar3_receptacle) ! throw ::Components::NoConnection(); ! return Ar3_receptacle; } *************** *** 179,188 **** throw ::Components::InvalidConnection(); } ! stringstream s; ! s << "CCM_Ar4:" << Ar4_receptacle_counter++; ! ::Components::Cookie ck(s.str()); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar4_receptacles.insert(make_pair(ck, ccmf)); ! return ck; } --- 172,191 ---- throw ::Components::InvalidConnection(); } ! if(delegator) ! { ! ::Components::Cookie ck = delegator->connect("Ar4", f); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar4_receptacles.insert(make_pair(ck, ccmf)); ! return ck; ! } ! else ! { ! stringstream s; ! s << "CCM_Ar4:" << Ar4_receptacle_counter++; ! ::Components::Cookie ck(s.str()); ! ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); ! Ar4_receptacles.insert(make_pair(ck, ccmf)); ! return ck; ! } } *************** *** 195,207 **** throw ::Components::InvalidConnection(); } ! if(Ar4_receptacles.find(ck) != Ar4_receptacles.end()) { ! ::World::CCM_Data::SmartPtr f(Ar4_receptacles[ck]); Ar4_receptacles.erase(ck); return f; } else { ! throw ::Components::InvalidConnection(); } } --- 198,220 ---- throw ::Components::InvalidConnection(); } ! if(delegator) { ! ::Components::Object::SmartPtr o = delegator->disconnect("Ar4", ck); Ar4_receptacles.erase(ck); + ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); return f; } else { ! if(Ar4_receptacles.find(ck) != Ar4_receptacles.end()) ! { ! ::World::CCM_Data::SmartPtr f(Ar4_receptacles[ck]); ! Ar4_receptacles.erase(ck); ! return f; ! } ! else ! { ! throw ::Components::InvalidConnection(); ! } } } |
From: Robert L. <rle...@us...> - 2007-03-04 16:50:35
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19940/impl/space Modified Files: Alien_impl.cc Alien_impl.h Log Message: Index: Alien_impl.h =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/Alien_impl.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Alien_impl.h 2 Mar 2007 14:44:43 -0000 1.3 --- Alien_impl.h 4 Mar 2007 16:50:30 -0000 1.4 *************** *** 40,46 **** virtual ::Components::Object::SmartPtr provide(const char* facet); virtual ::Components::Cookie connect(const char* receptacle, ::Components::Object::SmartPtr facet); ! virtual ::Components::Object::SmartPtr disconnect(const char* receptacle, ::Components::Cookie cookie); ! virtual Object::SmartPtr get_single_connection(const char* receptacle); ! virtual Connections const& get_multiple_connections(const char* receptacle); private: --- 40,44 ---- virtual ::Components::Object::SmartPtr provide(const char* facet); virtual ::Components::Cookie connect(const char* receptacle, ::Components::Object::SmartPtr facet); ! virtual ::Components::Object::SmartPtr disconnect(const char* receptacle, ::Components::Cookie const& cookie); private: Index: Alien_impl.cc =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/Alien_impl.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Alien_impl.cc 2 Mar 2007 13:11:04 -0000 1.1 --- Alien_impl.cc 4 Mar 2007 16:50:30 -0000 1.2 *************** *** 30,33 **** --- 30,45 ---- } + ::Components::Object::SmartPtr Alien_impl::provide(const char* facet) + { + } + + ::Components::Cookie Alien_impl::connect(const char* receptacle, ::Components::Object::SmartPtr facet) + { + } + + ::Components::Object::SmartPtr Alien_impl::disconnect(const char* receptacle, ::Components::Cookie const& cookie) + { + } + void Alien_impl::set_session_context(Components::SessionContext* context) |
From: Robert L. <rle...@us...> - 2007-03-02 14:44:51
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17078/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space Added Files: Alien_gen.cc Alien_gen.h Log Message: new prototype --- NEW FILE: Alien_gen.cc --- /* * PROTOTYPE 1 */ //============================================================================== // Alien - component logic (implementation) //============================================================================== #include <cassert> #include <iostream> #include <sstream> #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <ccmtools/local/World/DataAdapter.h> #include "Alien_gen.h" namespace Space { using namespace std; //============================================================================== // local component adapter implementation //============================================================================== Alien::Alien(AlienHome* h, ::Space::CCM_Alien* lc, ::Components::Assembly::SmartPtr a) : home_local_adapter(h), local_component(lc), assembly(a) { context = NULL; ValidConnection = local_component!=NULL; delegator = dynamic_cast< ::Components::ComponentDelegator>(local_component); Ar4_receptacle_counter = 0; Ar7a_receptacle_counter = 0; Ar7b_receptacle_counter = 0; } Alien::~Alien() { delete context; delete local_component; delete Ap1_facet_impl; delete Ap10_facet_impl; } ::World::Data::SmartPtr Alien::provide_Ap1() { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(!Ap1_facet) { if(delegator) { ::Components::Object::SmartPtr o = delegator->provide("Ap1"); Ap1_facet.eat(dynamic_cast< ::World::Data*>(o.ptr())); } else { Ap1_facet_impl = local_component->get_Ap1(); Ap1_facet = ::World::Data::SmartPtr( new ::ccmtools::local::World::DataAdapter(Ap1_facet_impl)); } } return Ap1_facet; } ::World::Data::SmartPtr Alien::provide_Ap10() { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(!Ap10_facet) { if(delegator) { ::Components::Object::SmartPtr o = delegator->provide("Ap10"); Ap10_facet.eat(dynamic_cast< ::World::Data*>(o.ptr())); } else { Ap10_facet_impl = local_component->get_Ap10(); Ap10_facet = ::World::Data::SmartPtr( new ::ccmtools::local::World::DataAdapter(Ap10_facet_impl)); } } return Ap10_facet; } void Alien::connect_Ar3(::World::Data::SmartPtr f) throw(::Components::AlreadyConnected, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(delegator) { delegator->connect("Ar3", f); } else { if(Ar3_receptacle) { throw ::Components::AlreadyConnected(); } Ar3_receptacle = f; } } ::World::Data::SmartPtr Alien::disconnect_Ar3() throw(::Components::NoConnection, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(delegator) { ::Components::Object::SmartPtr o = delegator->disconnect("Ar3"); ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); return f; } else { if(!Ar3_receptacle) { throw ::Components::NoConnection(); } ::World::Data::SmartPtr f = Ar3_receptacle; Ar3_receptacle.forget(); return f; } } ::World::Data::SmartPtr Alien::get_connection_Ar3() throw(::Components::NoConnection, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(delegator) { Object::SmartPtr o = delegator->get_single_connection("Ar3"); ::World::Data::SmartPtr f(dynamic_cast< ::World::Data*>(o.ptr())); return f; } else { if(!Ar3_receptacle) throw ::Components::NoConnection(); return Ar3_receptacle; } } ::Components::Cookie Alien::connect_Ar4(::World::Data::SmartPtr f) throw(::Components::ExceededConnectionLimit, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } stringstream s; s << "CCM_Ar4:" << Ar4_receptacle_counter++; ::Components::Cookie ck(s.str()); ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); Ar4_receptacles.insert(make_pair(ck, ccmf)); return ck; } ::World::Data::SmartPtr Alien::disconnect_Ar4(::Components::Cookie ck) throw(::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(Ar4_receptacles.find(ck) != Ar4_receptacles.end()) { ::World::CCM_Data::SmartPtr f(Ar4_receptacles[ck]); Ar4_receptacles.erase(ck); return f; } else { throw ::Components::InvalidConnection(); } } ::Space::Alien_Ar4_Connections& Alien::get_connections_Ar4 ( ) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } return Ar4_receptacles; } void Alien::connect_Ar10(::World::Data::SmartPtr f) throw(::Components::AlreadyConnected, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(Ar10_receptacle) { throw ::Components::AlreadyConnected(); } Ar10_receptacle = f; } ::World::Data::SmartPtr Alien::disconnect_Ar10() throw(::Components::NoConnection, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(!Ar10_receptacle) { throw ::Components::NoConnection(); } // local_component->disconnect("Ar10"); ::World::Data::SmartPtr f = Ar10_receptacle; Ar10_receptacle.forget(); return f; } ::World::Data::SmartPtr Alien::get_connection_Ar10() throw(::Components::NoConnection, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(!Ar10_receptacle) throw ::Components::NoConnection(); return Ar10_receptacle; } void Alien::connect_Ar6a(::World::Data::SmartPtr f) throw(::Components::AlreadyConnected, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(Ar6a_receptacle) { throw ::Components::AlreadyConnected(); } Ar6a_receptacle = f; } ::World::Data::SmartPtr Alien::disconnect_Ar6a() throw(::Components::NoConnection, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(!Ar6a_receptacle) { throw ::Components::NoConnection(); } // local_component->disconnect("Ar6a"); ::World::Data::SmartPtr f = Ar6a_receptacle; Ar6a_receptacle.forget(); return f; } ::World::Data::SmartPtr Alien::get_connection_Ar6a() throw(::Components::NoConnection, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(!Ar6a_receptacle) throw ::Components::NoConnection(); return Ar6a_receptacle; } void Alien::connect_Ar6b(::World::Data::SmartPtr f) throw(::Components::AlreadyConnected, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(Ar6b_receptacle) { throw ::Components::AlreadyConnected(); } Ar6b_receptacle = f; } ::World::Data::SmartPtr Alien::disconnect_Ar6b() throw(::Components::NoConnection, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(!Ar6b_receptacle) { throw ::Components::NoConnection(); } // local_component->disconnect("Ar6b"); ::World::Data::SmartPtr f = Ar6b_receptacle; Ar6b_receptacle.forget(); return f; } ::World::Data::SmartPtr Alien::get_connection_Ar6b() throw(::Components::NoConnection, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(!Ar6b_receptacle) throw ::Components::NoConnection(); return Ar6b_receptacle; } ::Components::Cookie Alien::connect_Ar7a(::World::Data::SmartPtr f) throw(::Components::ExceededConnectionLimit, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } stringstream s; s << "CCM_Ar7a:" << Ar7a_receptacle_counter++; ::Components::Cookie ck(s.str()); ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); Ar7a_receptacles.insert(make_pair(ck, ccmf)); return ck; } ::World::Data::SmartPtr Alien::disconnect_Ar7a(::Components::Cookie ck) throw(::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(Ar7a_receptacles.find(ck) != Ar7a_receptacles.end()) { ::World::CCM_Data::SmartPtr f(Ar7a_receptacles[ck]); Ar7a_receptacles.erase(ck); return f; } else { throw ::Components::InvalidConnection(); } } ::Space::Alien_Ar7a_Connections& Alien::get_connections_Ar7a ( ) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } return Ar7a_receptacles; } ::Components::Cookie Alien::connect_Ar7b(::World::Data::SmartPtr f) throw(::Components::ExceededConnectionLimit, ::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } stringstream s; s << "CCM_Ar7b:" << Ar7b_receptacle_counter++; ::Components::Cookie ck(s.str()); ::World::CCM_Data::SmartPtr ccmf(dynamic_cast< ::World::CCM_Data* >(f.ptr())); Ar7b_receptacles.insert(make_pair(ck, ccmf)); return ck; } ::World::Data::SmartPtr Alien::disconnect_Ar7b(::Components::Cookie ck) throw(::Components::InvalidConnection) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } if(Ar7b_receptacles.find(ck) != Ar7b_receptacles.end()) { ::World::CCM_Data::SmartPtr f(Ar7b_receptacles[ck]); Ar7b_receptacles.erase(ck); return f; } else { throw ::Components::InvalidConnection(); } } ::Space::Alien_Ar7b_Connections& Alien::get_connections_Ar7b ( ) { if(!ValidConnection) { throw ::Components::InvalidConnection(); } return Ar7b_receptacles; } // Navigation functions ::Components::Object::SmartPtr Alien::provide_facet(const std::string& name) throw(::Components::InvalidName) { if(name == "Ap1") return ::Components::Object::SmartPtr (dynamic_cast< ::Components::Object*> (provide_Ap1().ptr())); if(name == "Ap10") return ::Components::Object::SmartPtr (dynamic_cast< ::Components::Object*> (provide_Ap10().ptr())); throw ::Components::InvalidName(); } // Receptacle functions ::Components::Cookie Alien::connect(const ::Components::FeatureName& name, ::Components::Object::SmartPtr connection) throw(::Components::InvalidName, ::Components::InvalidConnection, ::Components::AlreadyConnected, ::Components::ExceededConnectionLimit) { if(name == "Ar3") { connect_Ar3(::World::CCM_Data::SmartPtr( dynamic_cast< ::World::CCM_Data*> (connection.ptr()))); ::Components::Cookie ck; return ck; } if(name == "Ar4") { return connect_Ar4(::World::CCM_Data::SmartPtr (dynamic_cast< ::World::CCM_Data*> (connection.ptr()))); } if(name == "Ar10") { connect_Ar10(::World::CCM_Data::SmartPtr( dynamic_cast< ::World::CCM_Data*> (connection.ptr()))); ::Components::Cookie ck; return ck; } if(name == "Ar6a") { connect_Ar6a(::World::CCM_Data::SmartPtr( dynamic_cast< ::World::CCM_Data*> (connection.ptr()))); ::Components::Cookie ck; return ck; } if(name == "Ar6b") { connect_Ar6b(::World::CCM_Data::SmartPtr( dynamic_cast< ::World::CCM_Data*> (connection.ptr()))); ::Components::Cookie ck; return ck; } if(name == "Ar7a") { return connect_Ar7a(::World::CCM_Data::SmartPtr (dynamic_cast< ::World::CCM_Data*> (connection.ptr()))); } if(name == "Ar7b") { return connect_Ar7b(::World::CCM_Data::SmartPtr (dynamic_cast< ::World::CCM_Data*> (connection.ptr()))); } throw ::Components::InvalidName(); } void Alien::disconnect(const ::Components::FeatureName& name, const ::Components::Cookie& ck) throw(::Components::InvalidName, ::Components::InvalidConnection, ::Components::CookieRequired, ::Components::NoConnection ) { if(!ValidConnection) throw ::Components::InvalidConnection(); if(name == "Ar3") { disconnect_Ar3(); return; } if(name == "Ar4") { disconnect_Ar4(ck); return; } if(name == "Ar10") { disconnect_Ar10(); return; } if(name == "Ar6a") { disconnect_Ar6a(); return; } if(name == "Ar6b") { disconnect_Ar6b(); return; } if(name == "Ar7a") { disconnect_Ar7a(ck); return; } if(name == "Ar7b") { disconnect_Ar7b(ck); return; } throw ::Components::InvalidName(); } // CCMObject functions ::Components::HomeExecutorBase* Alien::get_ccm_home() { throw ::Components::NotImplemented(); } void Alien::configuration_complete() throw(::Components::InvalidConfiguration) { configuration_complete(new CCM_Alien_Context_impl(this)); } void Alien::configuration_complete(::Space::CCM_Alien_Context* ctx) throw(::Components::InvalidConfiguration) { if(!ValidConnection) throw ::Components::InvalidConnection(); if(!context) context = ctx; if(assembly != ::Components::Assembly::SmartPtr()) { assembly->configuration_complete(); } local_component->set_session_context(context); local_component->ccm_activate(); } void Alien::remove() throw(::Components::RemoveFailure) { if(!ValidConnection) throw ::Components::InvalidConnection(); local_component->ccm_remove(); (dynamic_cast< ::ccmtools::local::World::DataAdapter* >( Ap1_facet.ptr()))->validConnection(false); (dynamic_cast< ::ccmtools::local::World::DataAdapter* >( Ap10_facet.ptr()))->validConnection(false); if(assembly != ::Components::Assembly::SmartPtr()) { assembly->tear_down(); // To resolve a cyclic smart pointer reference between a component // and an assembly object, the assembly smart pointer must be cleaned. assembly = ::Components::Assembly::SmartPtr(); } ValidConnection = false; } //============================================================================== // context adapter class implementation //============================================================================== CCM_Alien_Context_impl::CCM_Alien_Context_impl(Alien* c) : component_local_adapter(c) { } CCM_Alien_Context_impl::~CCM_Alien_Context_impl() { } ::World::Data::SmartPtr CCM_Alien_Context_impl::get_connection_Ar3() throw(::Components::NoConnection) { return component_local_adapter->get_connection_Ar3(); } ::Space::Alien_Ar4_Connections& CCM_Alien_Context_impl::get_connections_Ar4() { return component_local_adapter->get_connections_Ar4(); } ::World::Data::SmartPtr CCM_Alien_Context_impl::get_connection_Ar10() throw(::Components::NoConnection) { return component_local_adapter->get_connection_Ar10(); } ::World::Data::SmartPtr CCM_Alien_Context_impl::get_connection_Ar6a() throw(::Components::NoConnection) { return component_local_adapter->get_connection_Ar6a(); } ::World::Data::SmartPtr CCM_Alien_Context_impl::get_connection_Ar6b() throw(::Components::NoConnection) { return component_local_adapter->get_connection_Ar6b(); } ::Space::Alien_Ar7a_Connections& CCM_Alien_Context_impl::get_connections_Ar7a() { return component_local_adapter->get_connections_Ar7a(); } ::Space::Alien_Ar7b_Connections& CCM_Alien_Context_impl::get_connections_Ar7b() { return component_local_adapter->get_connections_Ar7b(); } ::Components::HomeExecutorBase* CCM_Alien_Context_impl::get_CCM_home() { throw ::Components::NotImplemented(); } ::Components::Object* CCM_Alien_Context_impl::get_CCM_object() throw(::Components::IllegalState) { throw ::Components::NotImplemented(); } } // /namespace Space --- NEW FILE: Alien_gen.h --- /* * PROTOTYPE 1 */ //============================================================================== // Alien - component logic (header) //============================================================================== #ifndef __COMPONENT_Space_Alien_GEN__H__ #define __COMPONENT_Space_Alien_GEN__H__ #include <string> #include <map> #include <Components/ccmtools.h> #include <Space/Alien_share.h> #include <Space/AlienHome_share.h> #include <World/Data.h> namespace Space { class AlienHome; //============================================================================== // Alien local component adapter //============================================================================== class Alien : virtual public ::Components::CCMObject { public: typedef wamas::platform::utils::SmartPtr<Alien> SmartPtr; Alien(AlienHome* h, ::Space::CCM_Alien* lc, ::Components::Assembly::SmartPtr a); virtual ~Alien(); // Equivalent operations for facet Ap1 ::World::Data::SmartPtr provide_Ap1(); // Equivalent operations for facet Ap10 ::World::Data::SmartPtr provide_Ap10(); // Equivalent operations for single receptacle Ar3 void connect_Ar3(::World::Data::SmartPtr i) throw(::Components::AlreadyConnected, ::Components::InvalidConnection); ::World::Data::SmartPtr disconnect_Ar3() throw(::Components::NoConnection, ::Components::InvalidConnection); // Equivalent operations for multiple receptacle Ar4 ::Components::Cookie connect_Ar4(::World::Data::SmartPtr connection) throw(::Components::ExceededConnectionLimit, ::Components::InvalidConnection); ::World::Data::SmartPtr disconnect_Ar4(::Components::Cookie ck) throw(::Components::InvalidConnection); // Equivalent operations for single receptacle Ar10 void connect_Ar10(::World::Data::SmartPtr i) throw(::Components::AlreadyConnected, ::Components::InvalidConnection); ::World::Data::SmartPtr disconnect_Ar10() throw(::Components::NoConnection, ::Components::InvalidConnection); // Equivalent operations for single receptacle Ar6a void connect_Ar6a(::World::Data::SmartPtr i) throw(::Components::AlreadyConnected, ::Components::InvalidConnection); ::World::Data::SmartPtr disconnect_Ar6a() throw(::Components::NoConnection, ::Components::InvalidConnection); // Equivalent operations for single receptacle Ar6b void connect_Ar6b(::World::Data::SmartPtr i) throw(::Components::AlreadyConnected, ::Components::InvalidConnection); ::World::Data::SmartPtr disconnect_Ar6b() throw(::Components::NoConnection, ::Components::InvalidConnection); // Equivalent operations for multiple receptacle Ar7a ::Components::Cookie connect_Ar7a(::World::Data::SmartPtr connection) throw(::Components::ExceededConnectionLimit, ::Components::InvalidConnection); ::World::Data::SmartPtr disconnect_Ar7a(::Components::Cookie ck) throw(::Components::InvalidConnection); // Equivalent operations for multiple receptacle Ar7b ::Components::Cookie connect_Ar7b(::World::Data::SmartPtr connection) throw(::Components::ExceededConnectionLimit, ::Components::InvalidConnection); ::World::Data::SmartPtr disconnect_Ar7b(::Components::Cookie ck) throw(::Components::InvalidConnection); ::World::Data::SmartPtr get_connection_Ar3() throw(::Components::NoConnection, ::Components::InvalidConnection); ::Space::Alien_Ar4_Connections& get_connections_Ar4(); ::World::Data::SmartPtr get_connection_Ar10() throw(::Components::NoConnection, ::Components::InvalidConnection); ::World::Data::SmartPtr get_connection_Ar6a() throw(::Components::NoConnection, ::Components::InvalidConnection); ::World::Data::SmartPtr get_connection_Ar6b() throw(::Components::NoConnection, ::Components::InvalidConnection); ::Space::Alien_Ar7a_Connections& get_connections_Ar7a(); ::Space::Alien_Ar7b_Connections& get_connections_Ar7b(); // Navigation functions ::Components::Object::SmartPtr provide_facet(const std::string& name) throw(::Components::InvalidName); // Receptacle functions ::Components::Cookie connect(const ::Components::FeatureName& name, ::Components::Object::SmartPtr connection) throw(::Components::InvalidName, ::Components::InvalidConnection, ::Components::AlreadyConnected, ::Components::ExceededConnectionLimit); void disconnect(const ::Components::FeatureName& name, const ::Components::Cookie& ck) throw(::Components::InvalidName, ::Components::InvalidConnection, ::Components::CookieRequired, ::Components::NoConnection ); // CCMObject functions ::Components::HomeExecutorBase* get_ccm_home(); void configuration_complete() throw(::Components::InvalidConfiguration); void configuration_complete(::Space::CCM_Alien_Context* ctx) throw(::Components::InvalidConfiguration); void remove() throw(::Components::RemoveFailure); protected: AlienHome* home_local_adapter; ::Space::CCM_Alien* local_component; ::Space::CCM_Alien_Context* context; ::Components::Assembly::SmartPtr assembly; bool ValidConnection; ::Components::ComponentDelegator delegator; ::World::Data::SmartPtr Ap1_facet; ::World::CCM_Data* Ap1_facet_impl; ::World::Data::SmartPtr Ap10_facet; ::World::CCM_Data* Ap10_facet_impl; ::World::Data::SmartPtr Ar3_receptacle; long Ar4_receptacle_counter; ::Space::Alien_Ar4_Connections Ar4_receptacles; ::World::Data::SmartPtr Ar10_receptacle; ::World::Data::SmartPtr Ar6a_receptacle; ::World::Data::SmartPtr Ar6b_receptacle; long Ar7a_receptacle_counter; ::Space::Alien_Ar7a_Connections Ar7a_receptacles; long Ar7b_receptacle_counter; ::Space::Alien_Ar7b_Connections Ar7b_receptacles; private: Alien(const Alien&); void operator=(const Alien&); }; //============================================================================== // context adapter class //============================================================================== class CCM_Alien_Context_impl : public ::Space::CCM_Alien_Context { public: CCM_Alien_Context_impl(Alien* c); virtual ~CCM_Alien_Context_impl(); ::World::Data::SmartPtr get_connection_Ar3() throw(::Components::NoConnection); ::Space::Alien_Ar4_Connections& get_connections_Ar4(); ::World::Data::SmartPtr get_connection_Ar10() throw(::Components::NoConnection); ::World::Data::SmartPtr get_connection_Ar6a() throw(::Components::NoConnection); ::World::Data::SmartPtr get_connection_Ar6b() throw(::Components::NoConnection); ::Space::Alien_Ar7a_Connections& get_connections_Ar7a(); ::Space::Alien_Ar7b_Connections& get_connections_Ar7b(); // CCMContext function ::Components::HomeExecutorBase* get_CCM_home(); // SessionContext function ::Components::Object* get_CCM_object() throw(::Components::IllegalState); protected: Alien* component_local_adapter; private: CCM_Alien_Context_impl(const CCM_Alien_Context_impl&); void operator=(const CCM_Alien_Context_impl&); }; } // /namespace Space #endif |
From: Robert L. <rle...@us...> - 2007-03-02 14:44:51
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17078/test/CppAssembly/prototype1/impl/space Modified Files: Alien_impl.h Log Message: new prototype Index: Alien_impl.h =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/Alien_impl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Alien_impl.h 2 Mar 2007 13:27:30 -0000 1.2 --- Alien_impl.h 2 Mar 2007 14:44:43 -0000 1.3 *************** *** 41,45 **** virtual ::Components::Cookie connect(const char* receptacle, ::Components::Object::SmartPtr facet); virtual ::Components::Object::SmartPtr disconnect(const char* receptacle, ::Components::Cookie cookie); ! virtual ::Components::ComponentDelegator::Connections const& get_connections(const char* receptacle); private: --- 41,46 ---- virtual ::Components::Cookie connect(const char* receptacle, ::Components::Object::SmartPtr facet); virtual ::Components::Object::SmartPtr disconnect(const char* receptacle, ::Components::Cookie cookie); ! virtual Object::SmartPtr get_single_connection(const char* receptacle); ! virtual Connections const& get_multiple_connections(const char* receptacle); private: |
From: Robert L. <rle...@us...> - 2007-03-02 14:44:43
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17062/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space Log Message: Directory /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/GEN_ccmtools_local_Space added to the repository |
From: Robert L. <rle...@us...> - 2007-03-02 13:27:33
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20085/test/CppAssembly/prototype1 Modified Files: Makefile Log Message: new prototype Index: Makefile =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 2 Mar 2007 13:11:04 -0000 1.1 --- Makefile 2 Mar 2007 13:27:30 -0000 1.2 *************** *** 6,9 **** --- 6,20 ---- local: ccmidl -idl3 -o gen/idl prototype1.idl + ccmtools c++local -a -o gen/itf -I$(ITF) `find $(ITF) -name '*.idl'` ccmtools c++local -a -o gen/world -I$(ITF) -I$(COMP) $(COMP)/World/*.idl ccmtools c++local -a -o gen/space -I$(ITF) -I$(COMP) $(COMP)/Space/*.idl + + check: local + cp -p impl/space/*.h impl/space/*.cc gen/space/ + ccmconfix -confix2 -o gen -pname "assembly-prototype2" -pversion "0.0.1" + cd gen && confix2.py --bootstrap --configure --make --targets=check + + clean: + cd gen && confix2.py --make --targets=clean + rm -rf gen + |
From: Robert L. <rle...@us...> - 2007-03-02 13:27:33
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20085/test/CppAssembly/prototype1/impl/space Modified Files: Alien_impl.h Log Message: new prototype Index: Alien_impl.h =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space/Alien_impl.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Alien_impl.h 2 Mar 2007 13:11:05 -0000 1.1 --- Alien_impl.h 2 Mar 2007 13:27:30 -0000 1.2 *************** *** 37,40 **** --- 37,41 ---- virtual ~Alien_impl(); + // ComponentDelegator implementation virtual ::Components::Object::SmartPtr provide(const char* facet); virtual ::Components::Cookie connect(const char* receptacle, ::Components::Object::SmartPtr facet); |
From: Robert L. <rle...@us...> - 2007-03-02 13:11:11
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13878/test/CppAssembly/prototype1/impl/space Added Files: Alien_impl.cc Alien_impl.h Log Message: new prototype --- NEW FILE: Alien_impl.h --- /*** * PROTOTYPE 1 ***/ #ifndef __COMPONENT_Space_Alien_IMPL__H__ #define __COMPONENT_Space_Alien_IMPL__H__ #include <Space/Alien_share.h> namespace Space { /** * This class implements a component's equivalent and supported interfaces * as well as component attributes. Additionally, session component callback * methods must be implemented. * * Alien component class * * // TODO: WRITE YOUR DESCRIPTION HERE! * * @author * @version **/ class Alien_impl : virtual public ::Space::CCM_Alien , virtual public ::Components::ComponentDelegator { private: bool ccm_activate_ok; public: ::Space::CCM_Alien_Context* ctx; Alien_impl(); virtual ~Alien_impl(); virtual ::Components::Object::SmartPtr provide(const char* facet); virtual ::Components::Cookie connect(const char* receptacle, ::Components::Object::SmartPtr facet); virtual ::Components::Object::SmartPtr disconnect(const char* receptacle, ::Components::Cookie cookie); virtual ::Components::ComponentDelegator::Connections const& get_connections(const char* receptacle); private: ::World::CCM_Data* Ap1_; public: virtual ::World::CCM_Data* get_Ap1(); private: ::World::CCM_Data* Ap10_; public: virtual ::World::CCM_Data* get_Ap10(); // CCM callback methods virtual void set_session_context(Components::SessionContext* ctx) throw(Components::CCMException); virtual void ccm_activate() throw(Components::CCMException); virtual void ccm_passivate() throw(Components::CCMException); virtual void ccm_remove() throw(Components::CCMException); }; } // /namespace Space #endif --- NEW FILE: Alien_impl.cc --- /*** * PROTOTYPE 1 ***/ #include <cassert> #include <iostream> #include "Alien_impl.h" #include "Alien_Ap1_impl.h" #include "Alien_Ap10_impl.h" namespace Space { using namespace std; //============================================================================== // Alien - component implementation //============================================================================== Alien_impl::Alien_impl() : ccm_activate_ok(false) { Ap1_ = NULL; Ap10_ = NULL; } Alien_impl::~Alien_impl() { } void Alien_impl::set_session_context(Components::SessionContext* context) throw(Components::CCMException) { ctx = dynamic_cast< ::Space::CCM_Alien_Context* >(context); } void Alien_impl::ccm_activate() throw(Components::CCMException) { try { } catch(...) { throw Components::CCMException(Components::CREATE_ERROR); } ccm_activate_ok = true; } void Alien_impl::ccm_passivate() throw(Components::CCMException) { // Who calls this method? } void Alien_impl::ccm_remove() throw(Components::CCMException) { try { } catch(...) { throw Components::CCMException(Components::REMOVE_ERROR); } } //============================================================================== // ::World::CCM_Data facet implementation //============================================================================== ::World::CCM_Data* Alien_impl::get_Ap1() { Alien_Ap1_impl* facet = new Alien_Ap1_impl(this); Ap1_ = dynamic_cast< ::World::CCM_Data* >(facet); return Ap1_; } //============================================================================== // ::World::CCM_Data facet implementation //============================================================================== ::World::CCM_Data* Alien_impl::get_Ap10() { Alien_Ap10_impl* facet = new Alien_Ap10_impl(this); Ap10_ = dynamic_cast< ::World::CCM_Data* >(facet); return Ap10_; } } // /namespace Space |
From: Robert L. <rle...@us...> - 2007-03-02 13:11:08
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13878/test/CppAssembly/prototype1 Added Files: prototype1.assembly .cvsignore Makefile prototype1.idl Log Message: new prototype --- NEW FILE: prototype1.assembly --- module Space { assembly implements Alien { component World::Worker alias "Worker" inner; connect inner.p1 to Ap1; connect inner.p2 to inner.r2; connect Ar3 to inner.r3; connect Ar4 to inner.r4; connect inner.p5a to inner.r5; connect inner.p5b to inner.r5; connect Ar10 to Ap10; connect Ar6a to inner.r6; connect Ar6b to inner.r6; connect Ar7a to inner.r7; connect Ar7b to inner.r7; }; }; // /module Space --- NEW FILE: .cvsignore --- gen --- NEW FILE: Makefile --- ITF="gen/idl/interface" COMP="gen/idl/component" all: local local: ccmidl -idl3 -o gen/idl prototype1.idl ccmtools c++local -a -o gen/world -I$(ITF) -I$(COMP) $(COMP)/World/*.idl ccmtools c++local -a -o gen/space -I$(ITF) -I$(COMP) $(COMP)/Space/*.idl --- NEW FILE: prototype1.idl --- module World { interface Data { long work(in string text); }; component Worker { provides Data p1; provides Data p2; uses Data r2; uses Data r3; uses multiple Data r4; provides Data p5a; provides Data p5b; uses multiple Data r5; uses multiple Data r6; }; home WorkerHome manages Worker {}; }; // /module World module Space { component Alien { provides World::Data Ap1; uses World::Data Ar3; uses multiple World::Data Ar4; provides World::Data Ap10; uses World::Data Ar10; uses World::Data Ar6a; uses World::Data Ar6b; uses multiple World::Data Ar7a; uses multiple World::Data Ar7b; }; home AlienHome manages Alien {}; }; // /module Space |
From: Robert L. <rle...@us...> - 2007-03-02 13:11:05
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13841/test/CppAssembly/prototype1/impl/space Log Message: Directory /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl/space added to the repository |
From: Robert L. <rle...@us...> - 2007-03-02 13:11:02
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13841/test/CppAssembly/prototype1/impl Log Message: Directory /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1/impl added to the repository |
From: Robert L. <rle...@us...> - 2007-03-02 13:11:02
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13841/test/CppAssembly/prototype1 Log Message: Directory /cvsroot/ccmtools/ccmtools/test/CppAssembly/prototype1 added to the repository |
From: Robert L. <rle...@us...> - 2007-03-01 15:57:50
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/multiple_receptacles In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27435/test/CppAssembly/multiple_receptacles Added Files: .cvsignore Pusher.idl Outer.idl Makefile Inner.idl Outer.assembly Log Message: multiple receptacle sample --- NEW FILE: .cvsignore --- gen --- NEW FILE: Outer.assembly --- module wamas { assembly implements Outer { component Inner inner; connect inner.input to this.input; connect this.out1 to inner.out1; connect this.out2 to inner.out2; }; }; --- NEW FILE: Pusher.idl --- module wamas { interface Pusher { void push(in string value); }; }; --- NEW FILE: Makefile --- all: local local: ccmtools c++local -o gen/itf Pusher.idl ccmtools c++local -a -o gen/inner Inner.idl ccmtools c++local -o gen/outer Outer.idl ccmtools c++assembly -o gen/outer Outer.idl Outer.assembly Inner.idl check: local ccmconfix -confix2 -o gen -pname "assembly-multiple-receptacles" -pversion "0.0.1" cd gen && confix2.py --bootstrap --configure --make --targets=check clean: cd gen && confix2.py --make --targets=clean rm -rf gen --- NEW FILE: Outer.idl --- #include "Pusher.idl" module wamas { component Outer { provides Pusher input; uses Pusher out1; uses multiple Pusher out2; }; home OuterHome manages Outer {}; }; --- NEW FILE: Inner.idl --- #include "Pusher.idl" module wamas { component Inner { provides Pusher input; uses Pusher out1; uses multiple Pusher out2; }; home InnerHome manages Inner {}; }; |
From: Robert L. <rle...@us...> - 2007-03-01 15:57:43
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/multiple_receptacles In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27424/test/CppAssembly/multiple_receptacles Log Message: Directory /cvsroot/ccmtools/ccmtools/test/CppAssembly/multiple_receptacles added to the repository |
From: Robert L. <rle...@us...> - 2007-03-01 15:55:25
|
Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/CppGenerator In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26491/src/ccmtools/CppGenerator Modified Files: CppAssemblyGenerator.java CppGenerator.java Log Message: *) disconnect implemented *) multiple receptacle prepared Index: CppGenerator.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/CppGenerator/CppGenerator.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** CppGenerator.java 19 Jan 2007 12:07:16 -0000 1.38 --- CppGenerator.java 1 Mar 2007 15:55:20 -0000 1.39 *************** *** 1091,1094 **** --- 1091,1113 ---- return getLocalCxxName((MUsesDef)currentNode, Text.SCOPE_SEPARATOR); } + else if (data_type.equals("MultipleReceptacleType")) + { + MUsesDef uses = (MUsesDef) currentNode; + MComponentDef component = uses.getComponent(); + return component.getIdentifier() + "_" + uses.getIdentifier() + "_Connections"; + } + else if (data_type.equals("MultipleReceptacleName")) + { + MUsesDef uses = (MUsesDef) currentNode; + MComponentDef component = uses.getComponent(); + MContainer module = component.getDefinedIn(); + if (module == null) + { + return Text.SCOPE_SEPARATOR + component.getIdentifier() + "_" + + uses.getIdentifier() + "_Connections"; + } + return getLocalCxxName(module, Text.SCOPE_SEPARATOR) + Text.SCOPE_SEPARATOR + + component.getIdentifier() + "_" + uses.getIdentifier() + "_Connections"; + } else if(data_type.startsWith("MOperation")) { Index: CppAssemblyGenerator.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/CppGenerator/CppAssemblyGenerator.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CppAssemblyGenerator.java 28 Feb 2007 10:54:52 -0000 1.6 --- CppAssemblyGenerator.java 1 Mar 2007 15:55:20 -0000 1.7 *************** *** 16,19 **** --- 16,20 ---- import java.util.List; import java.util.Map; + import java.util.Set; import java.util.logging.Logger; import ccmtools.CcmtoolsException; *************** *** 34,37 **** --- 35,39 ---- import ccmtools.parser.idl.metamodel.ComponentIDL.MHomeDef; import ccmtools.parser.idl.metamodel.ComponentIDL.MProvidesDef; + import ccmtools.parser.idl.metamodel.ComponentIDL.MUsesDef; import ccmtools.ui.UserInterfaceDriver; import ccmtools.utils.Text; *************** *** 166,169 **** --- 168,175 ---- return variable_AssemblyCcmRemove(); } + if (data_type.equals("AssemblyDisconnect")) + { + return variable_AssemblyDisconnect(); + } return super.data_MComponentDef(data_type, data_value); } *************** *** 353,384 **** { Connection c = (Connection) e; ! StringBuilder code = new StringBuilder(); ! String code_tail; ! Port target = c.getReceptacle(); ! String target_name = target.getConnector(); ! if (target.getComponent() == null) ! { ! // connect to an outer facet ! code.append(TAB2 + "if(" + target_name + "_) {\n"); ! String real_type = comp_def.getIdentifier() + "_" + target_name + "_impl"; ! code.append(TAB3 + real_type + "* facet = dynamic_cast<" + real_type + "*>(" ! + target_name + "_);\n"); ! code.append(TAB3 + "facet->target = "); ! code_tail = ";\n" + TAB2 + "}\n"; ! outer_facets.add(target_name); ! } ! else ! { ! // connect to the receptacle of an inner component ! code.append(TAB2); ! code.append(target.getComponent()); ! code.append("_->connect_"); ! code.append(target_name); ! code.append("("); ! code_tail = ");\n"; ! } ! Port source = c.getFacet(); ! code.append(getFacetValue(source)); ! code.append(code_tail); activation_code.append(code); } --- 359,363 ---- { Connection c = (Connection) e; ! StringBuilder code = generate_AssemblyCcmActivate(c, comp_def, outer_facets); activation_code.append(code); } *************** *** 417,420 **** --- 396,488 ---- } + private StringBuilder generate_AssemblyCcmActivate( Connection c, MComponentDef comp_def, + Set<String> outer_facets ) + { + StringBuilder code = new StringBuilder(); + Port source = c.getFacet(); + String source_value = getFacetValue(source, comp_def); + Port target = c.getReceptacle(); + String target_name = target.getConnector(); + if (target.getComponent() == null) + { + // connect to an outer facet + if (outer_multiple_receptacle_) + { + throw new RuntimeException("invalid loop"); + } + code.append(TAB2 + "if(" + target_name + "_) {\n"); + String real_type = comp_def.getIdentifier() + "_" + target_name + "_impl"; + code.append(TAB3 + real_type + "* facet = dynamic_cast<" + real_type + "*>(" + + target_name + "_);\n"); + code.append(TAB3 + "facet->target = "); + outer_facets.add(target_name); + code.append(source_value); + code.append(";\n" + TAB2 + "}\n"); + } + else + { + // connect to the receptacle of an inner component + if (outer_multiple_receptacle_) + { + // TODO + code.append(TAB2 + "// TODO: multiple receptacle\n"); + } + else + { + code.append(TAB2); + code.append(target.getComponent()); + code.append("_->connect_"); + code.append(target_name); + code.append("("); + code.append(source_value); + code.append(");\n"); + } + } + return code; + } + + private static MUsesDef outer_receptacle_; + + private static boolean outer_multiple_receptacle_; + + private static String getFacetValue( Port source, MComponentDef comp_def ) + { + outer_receptacle_ = null; + outer_multiple_receptacle_ = false; + StringBuilder code = new StringBuilder(); + String source_name = source.getConnector(); + if (source.getComponent() == null) + { + // connect from an outer receptacle + for (Object o : comp_def.getReceptacles()) + { + MUsesDef u = (MUsesDef) o; + if (u.getIdentifier().equals(source_name)) + { + outer_receptacle_ = u; + break; + } + } + if (outer_receptacle_ == null) + { + throw new RuntimeException("cannot find receptacle: " + source_name); + } + outer_multiple_receptacle_ = outer_receptacle_.isMultiple(); + if (outer_multiple_receptacle_) + code.append("ctx->get_connections_"); + else + code.append("ctx->get_connection_"); + } + else + { + // connect from the facet of an inner component + code.append(source.getComponent()); + code.append("_->provide_"); + } + code.append(source_name); + code.append("()"); + return code.toString(); + } + protected String variable_AssemblyCcmRemove() { *************** *** 428,431 **** --- 496,551 ---- } + protected String variable_AssemblyDisconnect() + { + if (currentAssembly == null) + return ""; + StringBuilder code = new StringBuilder(); + for (AssemblyElement e : currentAssembly.getElements()) + { + if (e instanceof Connection) + { + Connection c = (Connection) e; + Port source = c.getFacet(); + if (source.getComponent() == null) + { + code.append(TAB).append("if(receptacle==\""); + code.append(source.getConnector()).append("\") {\n"); + Port target = c.getReceptacle(); + if (target.getComponent() == null) + { + // the user disconnects a receptacle which has been + // connected to a facet implementation of the assembly + code.append(TAB2).append("throw ::Components::Exception("); + code.append("\"cannnot disconnect loop\");\n"); + } + else + { + // disconnect from inner component + { + // calculate 'outer_multiple_receptacle_' + getFacetValue(source, currentAssembly.getCcmComponent()); + } + code.append(TAB2).append("try {\n"); + if (outer_multiple_receptacle_) + { + // TODO disconnect multiple receptacle + code.append(TAB3 + "// TODO: multiple receptacle\n"); + } + else + { + code.append(TAB3).append(target.getComponent()); + code.append("_->disconnect_").append(target.getConnector()); + code.append("();\n"); + } + code.append(TAB2).append("} catch(...) {/* OOPS */}\n"); + code.append(TAB2).append("return;\n"); + } + code.append(TAB).append("}\n"); + } + } + } + return code.toString(); + } + private Map<String, Map<String, MComponentDef>> assembly_local_components_ = new HashMap<String, Map<String, MComponentDef>>(); *************** *** 533,538 **** if (target.getComponent() == null && target.getConnector().equals(name)) { Port source = c.getFacet(); ! return getFacetValue(source); } } --- 653,659 ---- if (target.getComponent() == null && target.getConnector().equals(name)) { + MComponentDef comp_def = currentAssembly.getCcmComponent(); Port source = c.getFacet(); ! return getFacetValue(source, comp_def); } } *************** *** 541,563 **** } - private static String getFacetValue( Port source ) - { - StringBuilder code = new StringBuilder(); - if (source.getComponent() == null) - { - // connect from an outer receptacle - code.append("ctx->get_connection_"); - } - else - { - // connect from the facet of an inner component - code.append(source.getComponent()); - code.append("_->provide_"); - } - code.append(source.getConnector()); - code.append("()"); - return code.toString(); - } - protected String generateOperationImpl( MProvidesDef provides, MOperationDef op ) { --- 662,665 ---- |
Update of /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26491/src/templates/CppLocalTemplates Modified Files: MComponentDef MUsesDefGetConnectionPrototypeVVMultiple MUsesDefAdapterDefinitionMultiple MUsesDefGetConnectionCtxImplDefinitionMultiple MUsesDefConnectionMapMultiple MUsesDefConnectPrototype MUsesDefGetConnectionPrototype MUsesDefGetConnectionPrototypeMultiple MUsesDefAdapterDefinition MUsesDefGetCtxConnectionPrototypeMultiple MUsesDefAdapterVariableMultiple Log Message: *) disconnect implemented *) multiple receptacle prepared Index: MUsesDefGetConnectionPrototype =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefGetConnectionPrototype,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MUsesDefGetConnectionPrototype 5 Jan 2007 14:17:25 -0000 1.9 --- MUsesDefGetConnectionPrototype 1 Mar 2007 15:55:19 -0000 1.10 *************** *** 1,4 **** %(UsesType)s::SmartPtr get_connection_%(Identifier)s() ! throw(::Components::NoConnection); --- 1,4 ---- %(UsesType)s::SmartPtr get_connection_%(Identifier)s() ! throw(::Components::NoConnection, ::Components::InvalidConnection); Index: MUsesDefAdapterVariableMultiple =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefAdapterVariableMultiple,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MUsesDefAdapterVariableMultiple 3 Jan 2007 12:09:28 -0000 1.4 --- MUsesDefAdapterVariableMultiple 1 Mar 2007 15:55:19 -0000 1.5 *************** *** 1,3 **** long %(Identifier)s_receptacle_counter; ! %(UsesName)sConnections %(Identifier)s_receptacles; --- 1,3 ---- long %(Identifier)s_receptacle_counter; ! %(MultipleReceptacleName)s %(Identifier)s_receptacles; Index: MUsesDefGetConnectionCtxImplDefinitionMultiple =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefGetConnectionCtxImplDefinitionMultiple,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MUsesDefGetConnectionCtxImplDefinitionMultiple 3 Jan 2007 12:09:28 -0000 1.6 --- MUsesDefGetConnectionCtxImplDefinitionMultiple 1 Mar 2007 15:55:19 -0000 1.7 *************** *** 1,3 **** ! %(UsesName)sConnections& CCM_%(ComponentType)s_Context_impl::get_connections_%(Identifier)s() { --- 1,3 ---- ! %(MultipleReceptacleName)s& CCM_%(ComponentType)s_Context_impl::get_connections_%(Identifier)s() { Index: MUsesDefAdapterDefinitionMultiple =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefAdapterDefinitionMultiple,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MUsesDefAdapterDefinitionMultiple 5 Jan 2007 14:17:24 -0000 1.12 --- MUsesDefAdapterDefinitionMultiple 1 Mar 2007 15:55:19 -0000 1.13 *************** *** 35,39 **** } ! %(UsesName)sConnections& %(ComponentType)s::get_connections_%(Identifier)s ( ) { --- 35,39 ---- } ! %(MultipleReceptacleName)s& %(ComponentType)s::get_connections_%(Identifier)s ( ) { Index: MUsesDefGetConnectionPrototypeVVMultiple =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefGetConnectionPrototypeVVMultiple,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MUsesDefGetConnectionPrototypeVVMultiple 31 May 2005 17:52:17 -0000 1.2 --- MUsesDefGetConnectionPrototypeVVMultiple 1 Mar 2007 15:55:19 -0000 1.3 *************** *** 1,2 **** ! virtual %(Identifier)sConnections& get_connections_%(Identifier)s() = 0; --- 1,2 ---- ! virtual %(MultipleReceptacleType)s& get_connections_%(Identifier)s() = 0; Index: MComponentDef =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MComponentDef,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** MComponentDef 27 Feb 2007 15:19:23 -0000 1.26 --- MComponentDef 1 Mar 2007 15:55:19 -0000 1.27 *************** *** 359,362 **** --- 359,364 ---- virtual ~CCM_%(Identifier)s() {} + + virtual void disconnect(const std::string& receptacle) = 0; %(MAttributeDefPrototypeVV)s *************** *** 453,456 **** --- 455,460 ---- virtual void ccm_remove() throw(Components::CCMException); + + virtual void disconnect(const std::string& receptacle); }; *************** *** 539,542 **** --- 543,552 ---- } + void + %(Identifier)s_impl::disconnect(const std::string& receptacle) + { + %(AssemblyDisconnect)s + } + %(MProvidesDefGetFacetDefinition)s Index: MUsesDefConnectPrototype =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefConnectPrototype,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MUsesDefConnectPrototype 5 Jan 2007 14:17:25 -0000 1.9 --- MUsesDefConnectPrototype 1 Mar 2007 15:55:19 -0000 1.10 *************** *** 5,9 **** %(UsesType)s::SmartPtr disconnect_%(Identifier)s() ! throw(::Components::NoConnection); --- 5,9 ---- %(UsesType)s::SmartPtr disconnect_%(Identifier)s() ! throw(::Components::NoConnection, ::Components::InvalidConnection); Index: MUsesDefAdapterDefinition =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefAdapterDefinition,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MUsesDefAdapterDefinition 28 Feb 2007 08:03:28 -0000 1.12 --- MUsesDefAdapterDefinition 1 Mar 2007 15:55:19 -0000 1.13 *************** *** 16,20 **** %(UsesType)s::SmartPtr %(ComponentType)s::disconnect_%(Identifier)s() ! throw(::Components::NoConnection) { if(!ValidConnection) --- 16,20 ---- %(UsesType)s::SmartPtr %(ComponentType)s::disconnect_%(Identifier)s() ! throw(::Components::NoConnection, ::Components::InvalidConnection) { if(!ValidConnection) *************** *** 26,29 **** --- 26,30 ---- throw ::Components::NoConnection(); } + local_component->disconnect("%(Identifier)s"); %(UsesType)s::SmartPtr f = %(Identifier)s_receptacle; %(Identifier)s_receptacle.forget(); *************** *** 33,37 **** %(UsesType)s::SmartPtr %(ComponentType)s::get_connection_%(Identifier)s() ! throw(::Components::NoConnection) { if(!ValidConnection) --- 34,38 ---- %(UsesType)s::SmartPtr %(ComponentType)s::get_connection_%(Identifier)s() ! throw(::Components::NoConnection, ::Components::InvalidConnection) { if(!ValidConnection) Index: MUsesDefGetCtxConnectionPrototypeMultiple =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefGetCtxConnectionPrototypeMultiple,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MUsesDefGetCtxConnectionPrototypeMultiple 3 Jan 2007 12:09:28 -0000 1.4 --- MUsesDefGetCtxConnectionPrototypeMultiple 1 Mar 2007 15:55:19 -0000 1.5 *************** *** 1,2 **** ! %(UsesName)sConnections& get_connections_%(Identifier)s(); --- 1,2 ---- ! %(MultipleReceptacleName)s& get_connections_%(Identifier)s(); Index: MUsesDefConnectionMapMultiple =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefConnectionMapMultiple,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MUsesDefConnectionMapMultiple 5 Jan 2007 14:17:25 -0000 1.7 --- MUsesDefConnectionMapMultiple 1 Mar 2007 15:55:19 -0000 1.8 *************** *** 1,4 **** typedef std::map< ::Components::Cookie, ! %(CCMUsesType)s::SmartPtr> %(Identifier)sConnections; --- 1,4 ---- typedef std::map< ::Components::Cookie, ! %(CCMUsesType)s::SmartPtr> %(MultipleReceptacleType)s; Index: MUsesDefGetConnectionPrototypeMultiple =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/templates/CppLocalTemplates/MUsesDefGetConnectionPrototypeMultiple,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MUsesDefGetConnectionPrototypeMultiple 3 Jan 2007 12:09:28 -0000 1.4 --- MUsesDefGetConnectionPrototypeMultiple 1 Mar 2007 15:55:19 -0000 1.5 *************** *** 1,2 **** ! %(UsesName)sConnections& get_connections_%(Identifier)s(); --- 1,2 ---- ! %(MultipleReceptacleName)s& get_connections_%(Identifier)s(); |
From: Robert L. <rle...@us...> - 2007-02-28 10:58:55
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/deploy_logger In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv1956/test/CppAssembly/deploy_logger Added Files: stderr_logger.assembly io.idl _check_main.cc OutputStreamLogger_logger_impl.cc stderr_logger.idl Makefile .cvsignore logger.idl console.idl Console_stderr_impl.cc Log Message: C++ assemblies --- NEW FILE: .cvsignore --- gen --- NEW FILE: stderr_logger.idl --- #include "logger.idl" #include "console.idl" module wamas { module helpers { component StdErrLogger { provides wamas::io::LoggerItf logger; }; home StdErrLoggerHome manages StdErrLogger {}; }; // /module helpers }; // /module wamas --- NEW FILE: io.idl --- #ifndef wamas_io_IDL #define wamas_io_IDL module wamas { module io { interface InputStream { char read(); }; interface OutputStream { void write(in char c); }; }; // /module io }; // /module wamas #endif --- NEW FILE: Makefile --- IDL_INCLUDE=-Igen/idl/interface -Igen/idl/component WAMAS_IDL=gen/idl/component/wamas all: local idl: ccmidl -idl3 -o gen/idl *.idl local: idl ccmtools c++local ${IDL_INCLUDE} -a -o gen/interfaces `find gen/idl/interface -name '*.idl'` ccmtools c++local ${IDL_INCLUDE} -a -o gen/io ${WAMAS_IDL}/io/*.idl ccmtools c++local ${IDL_INCLUDE} -a -o gen/system ${WAMAS_IDL}/system/*.idl ccmtools c++local ${IDL_INCLUDE} -a -o gen/helpers ${WAMAS_IDL}/helpers/*.idl ccmtools c++assembly -o gen/helpers stderr_logger.idl stderr_logger.assembly check: local cp -p Console_stderr_impl.cc `find gen -name Console_stderr_impl.cc` cp -p OutputStreamLogger_logger_impl.cc `find gen -name OutputStreamLogger_logger_impl.cc` mkdir -p gen/bin cp -p _check_main.cc gen/bin/_check_main.cc ccmconfix -confix2 -o gen -pname "assembly-sample_logger" -pversion "0.0.1" cd gen && confix2.py --bootstrap --configure --make --targets=check clean: cd gen && confix2.py --make --targets=clean rm -rf gen --- NEW FILE: _check_main.cc --- #include <iostream> #include <wamas/helpers/StdErrLoggerHome_gen.h> #include <wamas/system/ConsoleHome_gen.h> using namespace wamas::helpers; int main() { // objects StdErrLogger::SmartPtr comp; ::wamas::io::LoggerItf::SmartPtr logger; // setup try { { std::cout << "# register Console" << std::endl; ::Components::CCMHome::SmartPtr sp(new ::wamas::system::ConsoleHome); ::Components::HomeFinder::Instance()->register_home(sp, "Console"); } { std::cout << "# creating home" << std::endl; StdErrLoggerHome home; std::cout << "# creating component" << std::endl; comp = home.create(); } std::cout << "# provide logger" << std::endl; logger = comp->provide_logger(); std::cout << "# configuration complete" << std::endl; comp->configuration_complete(); } catch(...) { std::cerr << "\n SETUP FAILED\n"; return 1; } // business logic try { std::cout << "# business logic" << std::endl; logger->print("Hello World!"); } catch(...) { std::cerr << "\n B.L. FAILED\n"; return 1; } // tear down try { std::cout << "# tear down" << std::endl; comp->remove(); } catch(...) { std::cerr << "\n TEAR-DOWN FAILED\n"; return 1; } return 0; } --- NEW FILE: logger.idl --- #ifndef wamas_logger_IDL #define wamas_logger_IDL #include "io.idl" module wamas { module io { interface LoggerItf { void print(in string message); }; component OutputStreamLogger { provides LoggerItf logger; uses OutputStream stream; }; home OutputStreamLoggerHome manages OutputStreamLogger {}; }; // /module io }; // /module wamas #endif --- NEW FILE: console.idl --- #ifndef wamas_console_IDL #define wamas_console_IDL #include "io.idl" module wamas { module system { component Console { provides wamas::io::InputStream stdin; provides wamas::io::OutputStream stdout; provides wamas::io::OutputStream stderr; }; home ConsoleHome manages Console { }; }; // /module system }; // /module wamas #endif --- NEW FILE: OutputStreamLogger_logger_impl.cc --- /** * This file was automatically generated by CCM Tools version 0.9.0 * <http://ccmtools.sourceforge.net/> * * ::wamas::io::CCM_LoggerItf facet class implementation. * * // TODO: WRITE YOUR DESCRIPTION HERE! * * @author * @version **/ #include <cassert> #include <iostream> #include "OutputStreamLogger_logger_impl.h" using namespace std; namespace wamas { namespace io { OutputStreamLogger_logger_impl::OutputStreamLogger_logger_impl( OutputStreamLogger_impl* component_impl) : component(component_impl) { // OPTIONAL : IMPLEMENT ME HERE ! } OutputStreamLogger_logger_impl::~OutputStreamLogger_logger_impl() { // OPTIONAL : IMPLEMENT ME HERE ! } void OutputStreamLogger_logger_impl::print(const std::string& message) throw(::Components::CCMException) { ::wamas::io::OutputStream::SmartPtr os = component->ctx->get_connection_stream(); for(std::string::const_iterator it=message.begin(); it!=message.end(); ++it) { os->write(*it); } os->write('\n'); } } // /namespace io } // /namespace wamas --- NEW FILE: Console_stderr_impl.cc --- /** * This file was automatically generated by CCM Tools version 0.9.0 * <http://ccmtools.sourceforge.net/> * * ::wamas::io::CCM_OutputStream facet class implementation. * * // TODO: WRITE YOUR DESCRIPTION HERE! * * @author * @version **/ #include <cassert> #include <iostream> #include "Console_stderr_impl.h" using namespace std; namespace wamas { namespace system { Console_stderr_impl::Console_stderr_impl( Console_impl* component_impl) : component(component_impl) { // OPTIONAL : IMPLEMENT ME HERE ! } Console_stderr_impl::~Console_stderr_impl() { // OPTIONAL : IMPLEMENT ME HERE ! } void Console_stderr_impl::write(const char c) throw(::Components::CCMException) { std::cerr << c; } } // /namespace system } // /namespace wamas --- NEW FILE: stderr_logger.assembly --- module wamas { module helpers { assembly implements StdErrLogger { component wamas::system::Console alias "Console" console; component wamas::io::OutputStreamLogger os_logger; connect console.stderr to os_logger.stream; connect os_logger.logger to this.logger; }; }; // /module helpers }; // /module wamas |
From: Robert L. <rle...@us...> - 2007-02-28 10:58:50
|
Update of /cvsroot/ccmtools/ccmtools/test/CppAssembly/deploy_logger In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv1946/test/CppAssembly/deploy_logger Log Message: Directory /cvsroot/ccmtools/ccmtools/test/CppAssembly/deploy_logger added to the repository |
From: Robert L. <rle...@us...> - 2007-02-28 10:54:59
|
Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/CppGenerator In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv326/src/ccmtools/CppGenerator Modified Files: CppAssemblyGenerator.java Log Message: C++ assemblies Index: CppAssemblyGenerator.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/CppGenerator/CppAssemblyGenerator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CppAssemblyGenerator.java 28 Feb 2007 08:03:28 -0000 1.5 --- CppAssemblyGenerator.java 28 Feb 2007 10:54:52 -0000 1.6 *************** *** 191,194 **** --- 191,214 ---- } + private static int local_var_counter_; + + private static String createLocalVar( Map<String, String> var_map, String var_type, + StringBuilder code ) + { + String local_var = var_map.get(var_type); + if (local_var == null) + { + local_var = "var" + local_var_counter_; + ++local_var_counter_; + var_map.put(var_type, local_var); + code.append(TAB); + code.append(var_type); + code.append(" "); + code.append(local_var); + code.append(";\n"); + } + return local_var; + } + protected String variable_AssemblyInnerComponentVariableCreation() { *************** *** 197,202 **** StringBuilder code_homes = new StringBuilder(); StringBuilder code_creation = new StringBuilder(); ! HashMap<String, String> home_map = new HashMap<String, String>(); ! int counter = 0; Map<String, MComponentDef> map = getAssemblyLocalComponents(); for (String key : map.keySet()) --- 217,222 ---- StringBuilder code_homes = new StringBuilder(); StringBuilder code_creation = new StringBuilder(); ! HashMap<String, String> local_var_map = new HashMap<String, String>(); ! boolean have_finder = false; Map<String, MComponentDef> map = getAssemblyLocalComponents(); for (String key : map.keySet()) *************** *** 207,228 **** { // calling home-finder ! throw new RuntimeException("no yet implemented"); // TODO } else { MHomeDef home = getHome(comp_def); String home_type = getLocalCxxName(home, "::"); ! String home_var = home_map.get(home_type); ! if (home_var == null) ! { ! home_var = "home" + counter; ! ++counter; ! home_map.put(home_type, home_var); ! code_homes.append(TAB); ! code_homes.append(home_type); ! code_homes.append(" "); ! code_homes.append(home_var); ! code_homes.append(";\n"); ! } code_creation.append(TAB); code_creation.append(key); --- 227,268 ---- { // calling home-finder ! final String finder_type = "::Components::HomeFinder*"; ! String finder_var = createLocalVar(local_var_map, finder_type, code_homes); ! if (!have_finder) ! { ! code_creation.append(TAB).append(finder_var); ! code_creation.append(" = ::Components::HomeFinder::Instance();\n"); ! code_creation.append(TAB).append("assert("); ! code_creation.append(finder_var).append(");\n"); ! have_finder = true; ! } ! final String home_type = "::Components::CCMHome::SmartPtr"; ! String home_var = createLocalVar(local_var_map, home_type, code_homes); ! code_creation.append(TAB).append(home_var); ! code_creation.append(" = ").append(finder_var); ! code_creation.append("->find_home_by_name(\""); ! code_creation.append(comp_alias).append("\");\n"); ! final String keyless_type = "::Components::KeylessCCMHome*"; ! String keyless_var = createLocalVar(local_var_map, keyless_type, code_homes); ! code_creation.append(TAB).append(keyless_var); ! code_creation.append(" = dynamic_cast< ").append(keyless_type); ! code_creation.append(">(").append(home_var).append(".ptr());\n"); ! code_creation.append(TAB).append("assert("); ! code_creation.append(keyless_var).append(");\n"); ! final String obj_type = "::wamas::platform::utils::SmartPtr< ::Components::CCMObject>"; ! String obj_var = createLocalVar(local_var_map, obj_type, code_homes); ! code_creation.append(TAB).append(obj_var); ! code_creation.append(" = ").append(keyless_var).append("->create_component();\n"); ! String cpp_type = getLocalCxxName(comp_def, "::"); ! code_creation.append(TAB).append(key); ! code_creation.append("_.eat(dynamic_cast< ").append(cpp_type); ! code_creation.append("*>(").append(obj_var).append(".ptr()));\n"); } else { + // using first home MHomeDef home = getHome(comp_def); String home_type = getLocalCxxName(home, "::"); ! String home_var = createLocalVar(local_var_map, home_type, code_homes); code_creation.append(TAB); code_creation.append(key); *************** *** 231,234 **** --- 271,276 ---- code_creation.append(".create();\n"); } + code_creation.append(TAB).append("assert("); + code_creation.append(key).append("_);\n"); } StringBuilder result = new StringBuilder(); |