Skip to content

Commit

Permalink
Revert "Remove optional typedef (#1440)" (#1464)
Browse files Browse the repository at this point in the history
This reverts commit e1cf950.

Signed-off-by: Daniel Kamkha <[email protected]>

Signed-off-by: Daniel Kamkha <[email protected]>
  • Loading branch information
DanielKamkha authored Aug 19, 2022
1 parent d4f3915 commit 9f7784a
Show file tree
Hide file tree
Showing 219 changed files with 2,257 additions and 2,192 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
### Bug fixes:
* Fixed Java compilation issue for enum set literals.
### Removed:
* The LIME generator was removed.
* The LIME generator was removed.
* Temporarily restored the `gluecodium::optional` type alias.

## 13.1.1
Release date: 2022-08-08
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#include "unit/test/Foo.h"

namespace unit::test {
::custom::common::Return< std::shared_ptr<Foo>, std::error_code >
Foo::make_foo(const std::optional< double >& parameter)
std::shared_ptr<Foo>
Foo::make_foo(const ::custom::common::optional< double >& parameter)
{
return {std::shared_ptr<Foo>{}};
return nullptr;
}
} // namespace unit::test
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@

#include "unit/test/Foo.h"

#include "unit/test/Bar.h"
#include <optional>

namespace unit::test {
::gluecodium::Return< std::shared_ptr<Foo>, std::error_code >
Foo::make_foo(const ::std::optional< double >& parameter)
std::shared_ptr<Foo>
Foo::make_foo(const ::gluecodium::optional< double >& parameter)
{
return {std::shared_ptr<Foo>{}};
return nullptr;
}
} // namespace unit::test
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,5 @@
package unit.test

class Foo {
constructor make_foo(parameter: Double?) throws Buz
constructor make_foo(parameter: Double?)
}

enum Bar { ONE, TWO }

exception Buz(Bar)
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace custom::common::unit::test {
std::shared_ptr<Foo>
Foo::make_foo(const ::std::optional< double >& parameter)
Foo::make_foo(const ::gluecodium::optional< double >& parameter)
{
return nullptr;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace unit::test {
std::shared_ptr<Foo>
Foo::make_foo(const ::std::optional< double >& parameter)
Foo::make_foo(const ::gluecodium::optional< double >& parameter)
{
return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion functional-tests/functional/input/src/cpp/Blobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ BlobNulls::get_breaking_null() {
return {};
}

std::optional<std::shared_ptr<std::vector<uint8_t>>>
lorem_ipsum::test::optional<std::shared_ptr<std::vector<uint8_t>>>
BlobNulls::get_valid_null() {
return {};
}
Expand Down
8 changes: 4 additions & 4 deletions functional-tests/functional/input/src/cpp/Dates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Dates::increase_date( const system_clock::time_point& input )
return input + hours(24) + hours(1) + minutes(1) + seconds(1);
}

std::optional< system_clock::time_point >
Dates::increase_date_maybe( const std::optional< system_clock::time_point >& input )
lorem_ipsum::test::optional< system_clock::time_point >
Dates::increase_date_maybe( const lorem_ipsum::test::optional< system_clock::time_point >& input )
{
return input ? *input + hours(24) + hours(1) + minutes(1) + seconds(1) : input;
}
Expand Down Expand Up @@ -69,8 +69,8 @@ DatesSteady::increase_date(const steady_clock::time_point& input) {
return input + hours(24) + hours(1) + minutes(1) + seconds(1);
}

std::optional<steady_clock::time_point>
DatesSteady::increase_date_maybe(const std::optional<steady_clock::time_point>& input) {
lorem_ipsum::test::optional<steady_clock::time_point>
DatesSteady::increase_date_maybe(const lorem_ipsum::test::optional<steady_clock::time_point>& input) {
return input ? *input + hours(24) + hours(1) + minutes(1) + seconds(1) : input;
}

Expand Down
8 changes: 4 additions & 4 deletions functional-tests/functional/input/src/cpp/Durations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ DurationSeconds::increase_duration(const seconds input) {
return input + seconds(1);
}

std::optional<seconds>
DurationSeconds::increase_duration_maybe(const std::optional<seconds>& input) {
lorem_ipsum::test::optional<seconds>
DurationSeconds::increase_duration_maybe(const lorem_ipsum::test::optional<seconds>& input) {
return input ? *input + seconds(1) : input;
}

Expand All @@ -47,8 +47,8 @@ DurationMilliseconds::increase_duration(const milliseconds input) {
return input + seconds(1);
}

std::optional<milliseconds>
DurationMilliseconds::increase_duration_maybe(const std::optional<milliseconds>& input) {
lorem_ipsum::test::optional<milliseconds>
DurationMilliseconds::increase_duration_maybe(const lorem_ipsum::test::optional<milliseconds>& input) {
return input ? *input + seconds(1) : input;
}

Expand Down
16 changes: 8 additions & 8 deletions functional-tests/functional/input/src/cpp/Lambdas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,18 @@ Lambdas::concatenate_in_struct(const std::string& string1,
return concatenator.concatenator(string1, string2);
}

std::optional<Lambdas::Concatenator>
Lambdas::get_concatenator_or_null(const std::optional<std::string>& delimiter)
lorem_ipsum::test::optional<Lambdas::Concatenator>
Lambdas::get_concatenator_or_null(const lorem_ipsum::test::optional<std::string>& delimiter)
{
if (!delimiter) return {};
return {[delimiter](const std::string& string1,
const std::string& string2){ return string1 + *delimiter + string2; }};
}

std::optional<std::string>
lorem_ipsum::test::optional<std::string>
Lambdas::concatenate_or_not(const std::string& string1,
const std::string& string2,
const std::optional<Lambdas::Concatenator>& concatenator)
const lorem_ipsum::test::optional<Lambdas::Concatenator>& concatenator)
{
if (!concatenator) return {};
return (*concatenator)(string1, string2);
Expand Down Expand Up @@ -121,8 +121,8 @@ Lambdas::reset_real_concatenator()
Lambdas::NullableConfuser
Lambdas::get_nullable_confuser()
{
return [](const std::optional<std::string>& value) ->
std::optional<StandaloneProducer>
return [](const lorem_ipsum::test::optional<std::string>& value) ->
lorem_ipsum::test::optional<StandaloneProducer>
{
if (value) {
return { [value] { return *value; } };
Expand All @@ -132,9 +132,9 @@ Lambdas::get_nullable_confuser()
};
}

std::optional<StandaloneProducer>
lorem_ipsum::test::optional<StandaloneProducer>
Lambdas::apply_nullable_confuser(const Lambdas::NullableConfuser& confuser,
const std::optional<std::string>& value)
const lorem_ipsum::test::optional<std::string>& value)
{
return confuser(value);
}
Expand Down
4 changes: 2 additions & 2 deletions functional-tests/functional/input/src/cpp/Locales.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Locales::locale_round_trip_strip_tag(const Locale& input) {
return Locale(input.language_code, input.country_code, input.script_code);
}

std::optional<Locale>
Locales::locale_round_trip_nullable(const std::optional<Locale>& input) {
optional<Locale>
Locales::locale_round_trip_nullable(const optional<Locale>& input) {
return input;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,23 @@ namespace test
{
using namespace lorem_ipsum::test;

std::optional<std::vector<std::string>>
UseNullableCollections::nullable_list_round_trip(const std::optional<std::vector<std::string>>& input) {
optional<std::vector<std::string>>
UseNullableCollections::nullable_list_round_trip(const optional<std::vector<std::string>>& input) {
return input;
}

std::optional<std::unordered_set<std::string>>
UseNullableCollections::nullable_set_round_trip(const std::optional<std::unordered_set<std::string>>& input) {
optional<std::unordered_set<std::string>>
UseNullableCollections::nullable_set_round_trip(const optional<std::unordered_set<std::string>>& input) {
return input;
}

std::optional<std::unordered_map<std::string, std::string>>
UseNullableCollections::nullable_map_round_trip(
const std::optional<std::unordered_map<std::string, std::string>>& input
) {
optional<std::unordered_map<std::string, std::string>>
UseNullableCollections::nullable_map_round_trip(const optional<std::unordered_map<std::string, std::string>>& input) {
return input;
}

NullableCollections
UseNullableCollections::nullable_collections_round_trip(const NullableCollections& input) {
return input;
}

}
Loading

0 comments on commit 9f7784a

Please sign in to comment.