-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #331 from jwillemsen/jwi-idl4optional
Beta support for IDL optional annotation
- Loading branch information
Showing
9 changed files
with
200 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// -*- C++ -*- | ||
/** | ||
* @file optional_t.h | ||
* @author Johnny Willemsen | ||
* | ||
* @brief template for IDL4 optional annotaiton | ||
* | ||
* @copyright Copyright (c) Remedy IT Expertise BV | ||
*/ | ||
|
||
#if !defined (__IDL__OPTIONAL_T_H_INCLUDED__) | ||
#define __IDL__OPTIONAL_T_H_INCLUDED__ | ||
|
||
#include <optional> | ||
#include "tao/x11/versioned_x11_namespace.h" | ||
|
||
#if defined (ACE_HAS_CPP17) | ||
|
||
namespace TAOX11_NAMESPACE | ||
{ | ||
namespace IDL | ||
{ | ||
template<typename T> | ||
using optional = std::optional<T>; | ||
} // namespace IDL | ||
} // namespace TAOX11_NAMESPACE | ||
|
||
#else | ||
|
||
namespace TAOX11_NAMESPACE | ||
{ | ||
namespace IDL | ||
{ | ||
template<typename T> | ||
class optional | ||
{ | ||
public: | ||
T value_; | ||
}; | ||
} | ||
} | ||
#endif | ||
|
||
#endif // __IDL__OPTIONAL_T_H_INCLUDED__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* @file client.cpp | ||
* @author Johnny Willemsen | ||
* | ||
* @brief CORBA C++11 client application | ||
* | ||
* @copyright Copyright (c) Remedy IT Expertise BV | ||
*/ | ||
|
||
#include "testC.h" | ||
#include "testlib/taox11_testlog.h" | ||
|
||
int main (int /*argc*/, char* /*argv*/[]) | ||
{ | ||
int retval {}; | ||
bar mybar; | ||
|
||
TAOX11_TEST_INFO << "mybar: " << mybar << std::endl; | ||
return retval; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: const returned $server\n"; | ||
$status = 1; | ||
} | ||
|
||
$target->GetStderrLog(); | ||
|
||
exit $status; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* @file test.idl | ||
* @author Johnny Willemsen | ||
* | ||
* @copyright Copyright (c) Remedy IT Expertise BV | ||
*/ | ||
|
||
struct bar | ||
{ | ||
short x; | ||
string y; | ||
@optional short z; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// -*- MPC -*- | ||
|
||
project(*optional_gen_idl): ridl_ostream_defaults { | ||
IDL_Files { | ||
test.idl | ||
idlflags += --idl-version=4 -Scdr | ||
} | ||
custom_only = 1 | ||
} | ||
|
||
project(*optional_client): taox11_client { | ||
after += *optional_gen_idl | ||
Source_Files { | ||
client.cpp | ||
} | ||
Source_Files { | ||
testC.cpp | ||
} | ||
} | ||
|