Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequence type indirection support #1047

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions TAO/tao/AnyTypeCode/TypeCode_CDR_Extraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,7 @@ namespace
// Only struct, union, event and valuetype TypeCodes may be
// recursive. However non-recursive ALIAS may be indirected.
|| !(kind == CORBA::tk_struct
|| kind == CORBA::tk_sequence
|| kind == CORBA::tk_union
|| kind == CORBA::tk_value
|| kind == CORBA::tk_event
Expand All @@ -1400,6 +1401,15 @@ namespace
return false;
}

if (CORBA::tk_sequence == kind || CORBA::tk_array == kind) // @todo 1. check if recursion is properly handled 2. check need for other complex types
{
return TAO::TypeCodeFactory::tc_sequence_factory (static_cast<CORBA::TCKind> (kind),
indir_stream,
tc,
indirect_infos,
direct_infos);
}

// Currently all recursive TypeCodes have complex parameter
// lists, meaning they are encoded as CDR encapsulations.
TAO_InputCDRByteOrderGuard boguard (indir_stream);
Expand Down
17 changes: 17 additions & 0 deletions TAO/tests/Any/Indirected/client.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "seq_indirection_bin.h"

#include "testC.h"
#include "tao/IFR_Client/IFR_BaseC.h"
#include "tao/TypeCodeFactory/TypeCodeFactory_Loader.h"
Expand Down Expand Up @@ -226,6 +228,21 @@ recursive_union_test ()
ACE_DEBUG ((LM_INFO,
"> Anys destructed\n"));


ACE_DEBUG ((LM_INFO,
"* Indirected sequence type demarshaling\n"));
{
TAO_InputCDR strm((const char*)a_raw, a_raw_len, 0, 1, 2); // big endian, IIOP 1.2

Test::StructuredEvent notifications;
if ((strm >> notifications) == 0)
{
ACE_ERROR ((LM_ERROR,
"ERROR: Failed to demarshal indirected sequence\n"));
throw Test::Sequence_Indirection_Test_Failed();
}
}

return rc;
}

Expand Down
Loading