Skip to content

Commit

Permalink
Merge pull request RemedyIT#360 from jwillemsen/jwi-nocrobaclean
Browse files Browse the repository at this point in the history
Reduce includes and generated code, move sequence conversion helpers to their own header
  • Loading branch information
jwillemsen authored Mar 18, 2024
2 parents c00f463 + ffd01ee commit 581f182
Show file tree
Hide file tree
Showing 23 changed files with 131 additions and 95 deletions.
10 changes: 5 additions & 5 deletions ridlbe/base/writerbase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -416,15 +416,15 @@ def run(parser)
parser.visit_nodes(self)
end

def pre_visit(parser); end
def pre_visit(_parser); end

def post_visit(parser); end
def post_visit(_parser); end

def visit_include(node); end
def visit_include(_node); end

def enter_include(node); end
def enter_include(_node); end

def leave_include(node); end
def leave_include(_node); end

def enter_module(node)
return if self.no_scope_tracking?(node)
Expand Down
4 changes: 2 additions & 2 deletions ridlbe/c++11/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def self.add_extended_options(ol, _idl_params)
'impl_export_macro' => { description: "-Wb,impl_export_macro=MACRO\tSet export macro for implementation files" },
'impl_export_include' => { description: "-Wb,impl_export_include=FILE\tSet export include file for implementation files" },
'impl_export_file' => { description: "-Wb,impl_export_file=FILE\t\tSet implementation export file to generate for -Gxhimpl" },
'anytypecode_export_macro' => { description: "-Wb,anytypecode_export_macro=MACRO\tSet export macro for Any ops en TypeCode" },
'anytypecode_export_include' => { description: "-Wb,anytypecode_export_include=FILE\tSet export include file for Any ops en TypeCode" },
'anytypecode_export_macro' => { description: "-Wb,anytypecode_export_macro=MACRO\tSet export macro for Any ops and TypeCode" },
'anytypecode_export_include' => { description: "-Wb,anytypecode_export_include=FILE\tSet export include file for Any ops and TypeCode" },
'include_guard' => { description: "-Wb,include_guard=MACRO\t\tguard to prevent the generated client header file to be included" },
'safe_include' => { description: "-Wb,safe_include=FILE\t\tinclude that should be used instead of the own generated client header file" },
'unique_include' => { description: "-Wb,unique_include=FILE\t\tinclude that should be generated as only contents of the generated client header file" }
Expand Down
14 changes: 7 additions & 7 deletions ridlbe/c++11/writers/amistubheader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def initialize(output = STDOUT, opts = {})
end
end
@default_post_includes << 'tao/x11/anytypecode/typecode_constants.h' if params[:gen_typecodes]
@default_post_includes << 'tao/x11/corba_ostream.h'
@default_post_includes << 'tao/x11/corba_ostream.h' if params[:gen_ostream_operators]
@default_post_includes << 'tao/x11/messaging/messaging.h'
@default_post_includes << 'tao/x11/amic_traits_t.h'
@default_post_includes << 'tao/x11/portable_server/servantbase.h'
Expand Down Expand Up @@ -365,7 +365,7 @@ def initialize(output = STDOUT, opts = {})
super
end

def pre_visit(parser)
def pre_visit(_parser)
super
println
printiln('// generated from AmiStubHeaderAnyOpWriter#pre_visit')
Expand All @@ -374,7 +374,7 @@ def pre_visit(parser)
inc_nest
end

def post_visit(parser)
def post_visit(_parser)
dec_nest
println
println(' } // namespace TAOX11_NAMESPACE::CORBA')
Expand All @@ -401,17 +401,17 @@ def initialize(output = STDOUT, opts = {})
self.template_root = File.join('cli', 'inl')
end

def pre_visit(parser)
def pre_visit(_parser)
super
end

def post_visit(parser)
def post_visit(_parser)
super
end

def enter_interface(node); end
def enter_interface(_node); end

def leave_interface(node); end
def leave_interface(_node); end
end # AmiStubInlineWriter

class AmiStubHeaderOSWriter < AmiStubHeaderBaseWriter
Expand Down
4 changes: 2 additions & 2 deletions ridlbe/c++11/writers/amistubproxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,12 @@ def initialize(output = STDOUT, opts = {})
super
end

def pre_visit(parser)
def pre_visit(_parser)
super
printiln('// generated from AmiStubProxyCDRWriter#pre_visit')
end

def post_visit(parser)
def post_visit(_parser)
println
super
end
Expand Down
1 change: 1 addition & 0 deletions ridlbe/c++11/writers/amistubsource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def initialize(output = STDOUT, opts = {})
'tao/x11/portable_server/portableserver_proxies.h'
]
@default_post_includes = [
'tao/x11/sequence_conversion_t.h',
'tao/x11/portable_server/servant_proxy.h',
'tao/x11/portable_server/operation_table_std_map.h',
'tao/x11/portable_server/upcall_command.h',
Expand Down
18 changes: 13 additions & 5 deletions ridlbe/c++11/writers/stubheader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def initialize(output = STDOUT, opts = {})
@default_pre_includes = [
'tao/x11/stddef.h',
'tao/x11/basic_traits.h',
'tao/x11/corba.h',
'tao/x11/system_exception.h'
'tao/x11/corba.h'
]

@default_pre_includes << 'tao/x11/orb.h' unless params[:no_orb_include]
@default_post_includes = []
@default_post_includes << 'tao/x11/anytypecode/any.h' if params[:gen_any_ops]
Expand All @@ -43,7 +43,7 @@ def initialize(output = STDOUT, opts = {})
end
end
@default_post_includes << 'tao/x11/anytypecode/typecode_constants.h' if params[:gen_typecodes]
@default_post_includes << 'tao/x11/corba_ostream.h'
@default_post_includes << 'tao/x11/corba_ostream.h' if params[:gen_ostream_operators]

@include_guard = "__RIDL_#{File.basename(params[:output] || '').to_random_include_guard}_INCLUDED__"

Expand Down Expand Up @@ -373,12 +373,17 @@ def enter_interface(node)

unless node.is_abstract?
add_include('tao/x11/object.h')
add_include('tao/x11/system_exception.h')
else
add_post_include('tao/x11/anytypecode/typecode.h') # in case not added yet
add_post_include('tao/x11/valuetype/abstract_base.h') # after typecode include
end
end

def visit_exception(_node)
add_include('tao/x11/system_exception.h')
end

def visit_operation(node)
check_idl_type(node.idltype)
node.params.each { |parm| check_idl_type(parm.idltype) }
Expand All @@ -393,13 +398,15 @@ def declare_valuetype(_node)
end

def enter_valuetype(node)
add_include('tao/x11/system_exception.h')
add_post_include('tao/x11/anytypecode/typecode.h') # in case not added yet
add_post_include('tao/x11/valuetype/value_base.h') # after typecode include
add_post_include('tao/x11/valuetype/value_factory_base.h') unless node.is_abstract? # after typecode include
node.state_members.each { |m| check_idl_type(m.idltype) }
end

def visit_valuebox(node)
add_include('tao/x11/system_exception.h')
add_post_include('tao/x11/anytypecode/typecode.h') # in case not added yet
add_post_include('tao/x11/valuetype/value_box_t.h')
check_idl_type(node.boxed_type)
Expand All @@ -411,6 +418,7 @@ def enter_struct(node)
end

def enter_union(node)
add_include('tao/x11/system_exception.h')
node.members.each { |m| check_idl_type(m.idltype) }
end

Expand Down Expand Up @@ -606,7 +614,7 @@ def initialize(output = STDOUT, opts = {})
super
end

def pre_visit(parser)
def pre_visit(_parser)
super
println
printiln('// generated from StubHeaderAnyOpWriter#pre_visit')
Expand All @@ -615,7 +623,7 @@ def pre_visit(parser)
inc_nest
end

def post_visit(parser)
def post_visit(_parser)
dec_nest
println
println(' } // namespace TAOX11_NAMESPACE::CORBA')
Expand Down
16 changes: 11 additions & 5 deletions ridlbe/c++11/writers/stubsource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def initialize(output = STDOUT, opts = {})
super

self.only_record_module_scopes = true
# Object traits are only required for interfaces and valuetypes
@object_traits_specializations = false

@default_pre_includes = []
unless params[:no_cdr_streaming]
Expand Down Expand Up @@ -55,11 +57,13 @@ def post_visit(parser)

visit_anyops(parser) if params[:gen_any_ops] && !params[:gen_anytypecode_source]

# Object traits specializations
visit_object_traits_specializations(parser)
if @object_traits_specializations
# Object traits specializations
visit_object_traits_specializations(parser)

# Object ref traits specializations
visit_proxy_object_ref_traits_specializations(parser) unless params[:no_client_proxy]
# Object ref traits specializations
visit_proxy_object_ref_traits_specializations(parser) unless params[:no_client_proxy]
end

# CDR operators
visit_cdr(parser) unless params[:no_cdr_streaming]
Expand Down Expand Up @@ -103,6 +107,7 @@ def leave_module(node)
end

def enter_interface(node)
@object_traits_specializations = true
return if node.is_abstract?

visitor(InterfaceVisitor).visit_pre(node)
Expand All @@ -129,6 +134,7 @@ def visit_valuebox(node)
end

def enter_valuetype(node)
@object_traits_specializations = true
visitor(ValuetypeVisitor).visit_pre(node)
end

Expand All @@ -154,7 +160,7 @@ def visit_includes(parser)
end

def visit_proxy(parser)
writer(StubProxySourceWriter).visit_nodes(parser)
writer(StubProxySourceWriter).visit_nodes(parser) unless params[:no_client_proxy]
end

def visit_anyops(parser)
Expand Down
1 change: 1 addition & 0 deletions tao/x11/codecfactory/codec_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "tao/x11/exception_macros.h"
#include "tao/x11/anytypecode/any_util.h"
#include "tao/x11/anytypecode/typecode_impl.h"
#include "tao/x11/sequence_conversion_t.h"

namespace TAOX11_NAMESPACE
{
Expand Down
1 change: 1 addition & 0 deletions tao/x11/ior_interceptor/ior_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "tao/ObjRefTemplate/ObjectReferenceTemplate.h"
#include "tao/x11/objproxy.h"
#include "tao/x11/ior_interceptor/tao_ior_interceptor.h"
#include "tao/x11/sequence_conversion_t.h"

// X11 namespace dependencies
#include "tao/x11/ort/object_reference_template.h"
Expand Down
1 change: 1 addition & 0 deletions tao/x11/ior_interceptor/ior_interceptor_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "tao/x11/tao_corba.h"
#include "tao/x11/pi/tao_pi.h"
#include "tao/x11/ior_interceptor/tao_ior_interceptor.h"
#include "tao/x11/sequence_conversion_t.h"
#include "tao/ObjRefTemplate/ObjectReferenceTemplate.h"

// TAOX11 dependencies
Expand Down
1 change: 1 addition & 0 deletions tao/x11/orb_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "tao/x11/log.h"
#include "tao/x11/object_loader.h"
#include "tao/x11/exception_macros.h"
#include "tao/x11/sequence_conversion_t.h"

#include "ace/Dynamic_Service.h"

Expand Down
1 change: 1 addition & 0 deletions tao/x11/ort/object_reference_template_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
// TAO dependencies
#include "tao/x11/objproxy.h"
#include "tao/x11/sequence_conversion_t.h"
#include "tao/PortableServer/Root_POA.h"
#include "tao/x11/portable_server/portableserver_proxies.h"

Expand Down
1 change: 1 addition & 0 deletions tao/x11/pi/client_request_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "tao/x11/anytypecode/any_util.h"

#include "tao/x11/exception_macros.h"
#include "tao/x11/sequence_conversion_t.h"

namespace TAOX11_NAMESPACE
{
Expand Down
1 change: 1 addition & 0 deletions tao/x11/pi/orb_init_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// TAO namespace dependencies
#include "tao/x11/orbproxy.h"
#include "tao/x11/objproxy.h"
#include "tao/x11/sequence_conversion_t.h"

// X11 namespace dependencies
#include "tao/x11/pi/orb_init_info.h"
Expand Down
1 change: 1 addition & 0 deletions tao/x11/pi/request_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// TAO namespace dependencies
#include "tao/x11/tao_corba.h"
#include "tao/x11/objproxy.h"
#include "tao/x11/sequence_conversion_t.h"
#include "tao/AnyTypeCode/DynamicC.h"

#define TAO_DYN \
Expand Down
1 change: 1 addition & 0 deletions tao/x11/pi_server/server_request_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// TAO namespace dependencies
#include "tao/x11/tao_corba.h"
#include "tao/x11/objproxy.h"
#include "tao/x11/sequence_conversion_t.h"

// X11 namespace dependencies
#include "tao/x11/pi_server/server_request_info.h"
Expand Down
1 change: 1 addition & 0 deletions tao/x11/portable_server/portableserver_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
#include "tao/x11/objproxy.h"
#include "tao/x11/exception_macros.h"
#include "tao/x11/sequence_conversion_t.h"
#include "tao/x11/portable_server/portableserver_proxies.h"
#include "tao/x11/portable_server/servant_proxy.h"
#include "tao/x11/portable_server/servantbase.h"
Expand Down
1 change: 1 addition & 0 deletions tao/x11/portable_server/servant_activator_cb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "tao/x11/portable_server/portableserver_impl.h"
#include "tao/x11/portable_server/servantbase.h"
#include "tao/x11/objproxy.h"
#include "tao/x11/sequence_conversion_t.h"

#include "tao/x11/log.h"

Expand Down
1 change: 1 addition & 0 deletions tao/x11/portable_server/servant_locator_cb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "tao/x11/portable_server/servant_locator_cb.h"
#include "tao/x11/portable_server/servantbase.h"
#include "tao/x11/objproxy.h"
#include "tao/x11/sequence_conversion_t.h"

#include "tao/x11/log.h"

Expand Down
Loading

0 comments on commit 581f182

Please sign in to comment.