Skip to content

Commit

Permalink
Merge branch 'master' into jwi-taocorbainclude
Browse files Browse the repository at this point in the history
  • Loading branch information
jwillemsen authored Jun 10, 2024
2 parents 7b96eb0 + 56efa85 commit a2eee55
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 39 deletions.
6 changes: 3 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
image:https://img.shields.io/badge/scoreboard-Remedy IT-brightgreen.svg[Scoreboard, link=https://www.taox11.org/scoreboard.html]
image:https://www.codefactor.io/repository/github/remedyit/taox11/badge[CodeFactor, link=https://www.codefactor.io/repository/github/remedyit/taox11]
image:https://github.com/RemedyIT/taox11/workflows/linux/badge.svg[Linux CI, link=https://github.com/RemedyIT/taox11/actions?query=workflow%3Alinux]
image:https://github.com/RemedyIT/taox11/workflows/windows/badge.svg[Windows CI, link=https://github.com/RemedyIT/taox11/actions?query=workflow%3Awindows]
image:https://github.com/RemedyIT/taox11/workflows/fuzzr/badge.svg[Fuzzr CI, link=https://github.com/RemedyIT/taox11/actions?query=workflow%3Afuzzr]
image:https://github.com/RemedyIT/taox11/actions/workflows/linux.yml/badge.svg[Linux CI, link=https://github.com/RemedyIT/taox11/actions?query=workflow%3Alinux]
// image:https://github.com/RemedyIT/taox11/actions/workflows/windows.yml/badge.svg[Windows CI, link=https://github.com/RemedyIT/taox11/actions?query=workflow%3Awindows]
image:https://github.com/RemedyIT/taox11/actions/workflows/fuzzr.yml/badge.svg[Fuzzr CI, link=https://github.com/RemedyIT/taox11/actions?query=workflow%3Afuzzr]
image:https://codecov.io/gh/RemedyIT/taox11/branch/master/graph/badge.svg[Codecov, link=https://codecov.io/gh/RemedyIT/taox11]

= TAOX11
Expand Down
1 change: 1 addition & 0 deletions bin/taox11_tests.lst
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ tests/typecode/run_test.pl: !CORBA_E_COMPACT !CORBA_E_MICRO
tests/typecode_adapter/orb_create/run_test.pl: !CORBA_E_COMPACT !CORBA_E_MICRO
tests/typecode_adapter/resolve_ref/run_test.pl: !CORBA_E_COMPACT !CORBA_E_MICRO
tests/typelib/nocpp/run_test.pl:
tests/typelib/proxyany/run_test.pl:
tests/typelib/shared/run_test.pl:
tests/typelib/stdlib/run_test.pl:
tests/typelib/taox11/run_test.pl:
Expand Down
6 changes: 3 additions & 3 deletions ridlbe/c++11/templates/cli/src/pre.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#if __has_include("tao/x11/base/tao_corba.h")
# include "tao/x11/base/tao_corba.h"
#endif
% pre_includes.each do |incfile|
#include "<%= incfile %>"
% end
% includes.each do |incfile|
#include "<%= incfile %>"
% end
#if __has_include("tao/x11/base/tao_corba.h")
# include "tao/x11/base/tao_corba.h"
#endif
% post_includes.each do |incfile|
#include "<%= incfile %>"
% end
Expand Down
40 changes: 23 additions & 17 deletions ridlbe/c++11/writers/anytypecodesrc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def visit_anyops(parser)
end

def visit_typecodes(parser)
writer(StubSourceTaoTypecodeWriter).visit_nodes(parser) unless params[:gen_stub_proxy_source]

writer(StubSourceTypecodeWriter).visit_nodes(parser)
end
end # AnyTypeCodeWriter
Expand All @@ -82,6 +84,10 @@ def initialize(output = STDOUT, opts = {})

attr_reader :includes

def generate_tao_anytypecode?
params[:gen_typecodes] && !params[:gen_stub_proxy_source]
end

def post_visit(_parser)
properties[:pre_includes] = @default_pre_includes
properties[:post_includes] = @default_post_includes
Expand All @@ -90,33 +96,33 @@ def post_visit(_parser)
end

def enter_interface(node)
add_pre_include('tao/AnyTypeCode/Objref_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/Objref_TypeCode_Static.h') if generate_tao_anytypecode?
add_post_include('tao/x11/anytypecode/any_basic_impl_t.h') if params[:gen_any_ops]
return if node.is_local? || node.is_pseudo? || node.is_abstract?

check_idl_type(node.idltype)
end

def enter_valuetype(node)
add_pre_include('tao/AnyTypeCode/Value_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/TypeCode_Value_Field.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/Value_TypeCode_Static.h') if generate_tao_anytypecode?
add_pre_include('tao/AnyTypeCode/TypeCode_Value_Field.h') if generate_tao_anytypecode?
add_post_include('tao/x11/anytypecode/any_basic_impl_t.h') if params[:gen_any_ops]
return if node.is_abstract? || node.is_local?

node.state_members.each { |m| check_idl_type(m.idltype) }
end

def visit_valuebox(node)
add_pre_include('tao/AnyTypeCode/Alias_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/Alias_TypeCode_Static.h') if generate_tao_anytypecode?
add_post_include('tao/x11/anytypecode/any_basic_impl_t.h') if params[:gen_any_ops]
return if node.is_local?

check_idl_type(node.boxed_type)
end

def enter_struct(node)
add_pre_include('tao/AnyTypeCode/Struct_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/TypeCode_Struct_Field.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/Struct_TypeCode_Static.h') if generate_tao_anytypecode?
add_pre_include('tao/AnyTypeCode/TypeCode_Struct_Field.h') if generate_tao_anytypecode?
add_post_include('tao/x11/anytypecode/any_dual_impl_t.h') if params[:gen_any_ops]
return if node.is_local?

Expand All @@ -125,8 +131,8 @@ def enter_struct(node)
end

def enter_union(node)
add_pre_include('tao/AnyTypeCode/Union_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/TypeCode_Case_T.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/Union_TypeCode_Static.h') if generate_tao_anytypecode?
add_pre_include('tao/AnyTypeCode/TypeCode_Case_T.h') if generate_tao_anytypecode?
add_post_include('tao/x11/anytypecode/any_dual_impl_t.h') if params[:gen_any_ops]
add_post_include('tao/x11/anytypecode/typecode_case_t.h') if params[:gen_any_ops]
return if node.is_local?
Expand All @@ -136,49 +142,49 @@ def enter_union(node)
end

def enter_exception(node)
add_pre_include('tao/AnyTypeCode/Struct_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/TypeCode_Struct_Field.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/Struct_TypeCode_Static.h') if generate_tao_anytypecode?
add_pre_include('tao/AnyTypeCode/TypeCode_Struct_Field.h') if generate_tao_anytypecode?
add_post_include('tao/x11/anytypecode/any_dual_impl_t.h') if params[:gen_any_ops]
# arg template included in P.h
node.members.each { |m| check_idl_type(m.idltype) }
end

def visit_enum(_node)
add_pre_include('tao/AnyTypeCode/Enum_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/Enum_TypeCode_Static.h') if generate_tao_anytypecode?
add_post_include('tao/x11/anytypecode/any_basic_impl_t.h') if params[:gen_any_ops]
end

def visit_bitmask(_node)
add_pre_include('tao/AnyTypeCode/Enum_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/Enum_TypeCode_Static.h') if generate_tao_anytypecode?
add_post_include('tao/x11/anytypecode/any_basic_impl_t.h') if params[:gen_any_ops]
end

def visit_bitset(_node)
add_pre_include('tao/AnyTypeCode/Enum_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/Enum_TypeCode_Static.h') if generate_tao_anytypecode?
add_post_include('tao/x11/anytypecode/any_basic_impl_t.h') if params[:gen_any_ops]
end

def visit_typedef(node)
return if node.idltype.resolved_type.is_a?(IDL::Type::Native)

add_pre_include('tao/AnyTypeCode/Alias_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/Alias_TypeCode_Static.h') if generate_tao_anytypecode?
# just an alias or a sequence, array or fixed?
unless node.idltype.is_a?(IDL::Type::ScopedName)
add_post_include('tao/x11/anytypecode/any_dual_impl_t.h') if params[:gen_typecodes]
idl_type = node.idltype.resolved_type
case idl_type
when IDL::Type::String,
IDL::Type::WString
add_pre_include('tao/AnyTypeCode/String_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/String_TypeCode_Static.h') if generate_tao_anytypecode?
when IDL::Type::Sequence,
IDL::Type::Array
add_pre_include('tao/AnyTypeCode/Sequence_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/Sequence_TypeCode_Static.h') if generate_tao_anytypecode?
unless node.is_local?
check_idl_type(idl_type)
check_idl_type(idl_type.basetype)
end
when IDL::Type::Map
add_pre_include('tao/AnyTypeCode/Sequence_TypeCode_Static.h') if params[:gen_typecodes]
add_pre_include('tao/AnyTypeCode/Sequence_TypeCode_Static.h') if generate_tao_anytypecode?
unless node.is_local?
check_idl_type(idl_type)
check_idl_type(idl_type.basetype)
Expand Down
23 changes: 17 additions & 6 deletions ridlbe/c++11/writers/stubproxysource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,19 @@ def initialize(output = STDOUT, opts = {})
super

@default_pre_includes = []
@default_pre_includes << 'tao/x11/corba.h'
@default_post_includes = []
@default_post_includes = [
'tao/x11/corba.h',
'tao/x11/anytypecode/typecode_impl.h',
'tao/x11/anytypecode/typecode.h'
]
unless params[:no_cdr_streaming]
@default_pre_includes << 'tao/CDR.h'
@default_post_includes << 'tao/x11/cdr_long_double.h'
end
if params[:gen_typecodes]
@default_pre_includes << 'tao/AnyTypeCode/TypeCode.h'
@default_pre_includes << 'tao/AnyTypeCode/TypeCode_Constants.h'
end
end

# Object traits are only required for interfaces and valuetypes
Expand All @@ -59,6 +66,8 @@ def enter_valuetype(node)
def pre_visit(parser)
visit_includes(parser)

visit_tao_typecodes(parser) if params[:gen_typecodes]

super
end

Expand Down Expand Up @@ -97,6 +106,10 @@ def visit_proxy_object_ref_traits_specializations(parser)
def visit_proxy_implementation(parser)
writer(StubProxySourceProxyImplWriter).visit_nodes(parser)
end

def visit_tao_typecodes(parser)
writer(StubSourceTaoTypecodeWriter).visit_nodes(parser)
end
end # StubProxySourceWriter

class StubProxySourceCDRWriter < StubProxySourceBaseWriter
Expand Down Expand Up @@ -233,7 +246,7 @@ def initialize(output = STDOUT, opts = {})
end

def generate_typecodes?
params[:gen_typecodes] && !params[:gen_anytypecode_source]
params[:gen_typecodes] && params[:gen_stub_proxy_source]
end

def generate_anyops?
Expand Down Expand Up @@ -304,9 +317,7 @@ def enter_valuetype(node)
end

def visit_valuebox(node)
if generate_typecodes?
add_pre_include('tao/AnyTypeCode/Alias_TypeCode_Static.h')
end
add_pre_include('tao/AnyTypeCode/Alias_TypeCode_Static.h') if generate_typecodes?
add_post_include('tao/x11/anytypecode/any_basic_impl_t.h') if generate_anyops?
add_post_include('tao/x11/anytypecode/typecode.h') # in case not added yet
add_post_include('tao/x11/valuetype/valuetype_proxies.h') # after typecode includes
Expand Down
13 changes: 3 additions & 10 deletions ridlbe/c++11/writers/stubsource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ def visit_proxy_object_ref_traits_specializations(parser)
end

def visit_typecodes(parser)
writer(StubSourceTypecodeWriter).visit_nodes(parser)
writer(StubSourceTaoTypecodeWriter).visit_nodes(parser) unless params[:gen_stub_proxy_source]
writer(StubSourceTypecodeWriter).visit_nodes(parser) unless params[:gen_anytypecode_source]
end

def visit_cdr(parser)
Expand Down Expand Up @@ -254,9 +255,7 @@ def enter_valuetype(node)
end

def visit_valuebox(node)
if generate_typecodes?
add_pre_include('tao/AnyTypeCode/Alias_TypeCode_Static.h')
end
add_pre_include('tao/AnyTypeCode/Alias_TypeCode_Static.h') if generate_typecodes?
add_post_include('tao/x11/anytypecode/any_basic_impl_t.h') if generate_anyops?
add_post_include('tao/x11/anytypecode/typecode.h') # in case not added yet
add_post_include('tao/x11/valuetype/valuetype_proxies.h') # after typecode includes
Expand Down Expand Up @@ -517,12 +516,6 @@ def initialize(output = STDOUT, opts = {})
super
end

def pre_visit(parser)
writer(StubSourceTaoTypecodeWriter).visit_nodes(parser)

super
end

def enter_interface(node)
visitor(InterfaceVisitor).visit_typecode(node)
end
Expand Down
31 changes: 31 additions & 0 deletions tests/typelib/proxyany/client.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* @file client.cpp
* @author Johnny Willemsen
*
* @brief C++11 client application which uses IDL defines types
* and TAOX11. This version of the test has proxy and anytypecode
* in one file
*
* @copyright Copyright (c) Remedy IT Expertise BV
*/

#include "testC.h"

// Check for ACE define

int
main(int, char* [])
{
int result {};

Test::Bar mybar;

try
{
}
catch (const std::exception& e)
{
return 1;
}
return result;
}
23 changes: 23 additions & 0 deletions tests/typelib/proxyany/proxyanycombined.mpc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// -*- MPC -*-

project(*proxyany_gen_Idl): ridl_ostream_defaults {
idlflags += -Gcpc
idlflags -= -Sa -St
IDL_Files {
../test.idl
}
custom_only = 1
}

project(*proxyany_taox11_Client): taox11_client, taox11_anytypecode {
after += *proxyany_gen_Idl
Source_Files {
client.cpp
}
Source_Files {
testC.cpp
testCP.cpp
}
}


31 changes: 31 additions & 0 deletions tests/typelib/proxyany/run_test.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#---------------------------------------------------------------------
# @file run_test.pl
# @author Marcel Smit
#
# @copyright Copyright (c) Remedy IT Expertise BV
#---------------------------------------------------------------------
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec perl -S $0 $argv:q'
if 0;

# -*- perl -*-

use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::TestTarget;

my $target = PerlACE::TestTarget::create_target(2) || die "Create target 2 failed\n";

$status = 0;

$SV = $target->CreateProcess ("client");

$server = $SV->SpawnWaitKill ($target->ProcessStartWaitInterval());

if ($server != 0) {
print STDERR "ERROR: client returned $server\n";
$status = 1;
}

$target->GetStderrLog();

exit $status;

0 comments on commit a2eee55

Please sign in to comment.