Skip to content

Commit

Permalink
Add missing licensing headers (#647)
Browse files Browse the repository at this point in the history
* Add missing licensing headers

* Apply consistent block comment and clang-format to files

* Fix weird formatting from clang
  • Loading branch information
jesswong authored Jan 23, 2025
1 parent 8be7b3c commit fdd2c23
Show file tree
Hide file tree
Showing 14 changed files with 222 additions and 9 deletions.
15 changes: 15 additions & 0 deletions examples/asynchronous_sleep.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <chrono>
#include <iostream>
Expand Down
15 changes: 15 additions & 0 deletions examples/synchronous_sleep.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <chrono>
#include <iostream>
Expand Down
19 changes: 17 additions & 2 deletions include/unifex/async_auto_reset_event.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

Expand Down Expand Up @@ -140,7 +154,8 @@ struct async_auto_reset_event::stream_view final {
typename stop_token_t::template callback_type<
decltype(stopCallback)>;

return std::optional<stop_callback_t>{std::in_place, stopToken, stopCallback};
return std::optional<stop_callback_t>{
std::in_place, stopToken, stopCallback};
},
[evt](auto& stopCallback) noexcept {
return unifex::let_value(
Expand Down
18 changes: 16 additions & 2 deletions include/unifex/cleanup_adapt_stream.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

Expand Down Expand Up @@ -45,7 +59,7 @@ inline constexpr struct _fn final {
std::is_nothrow_constructible_v<remove_cvref_t<Stream>, Stream>&&
std::is_nothrow_constructible_v<std::decay_t<AdaptFunc>, AdaptFunc>) {
return _cleanup_adapt::stream<Stream, AdaptFunc>{
(Stream &&) stream, (AdaptFunc &&) adapt};
(Stream&&)stream, (AdaptFunc&&)adapt};
}
} cleanup_adapt_stream{};
} // namespace _cleanup_adapt_cpo
Expand Down
18 changes: 17 additions & 1 deletion include/unifex/upon_done.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include <unifex/config.hpp>
Expand Down Expand Up @@ -184,7 +200,7 @@ struct _sender<Predecessor, Func>::type {
member_t<Sender, Predecessor>,
receiver_t<remove_cvref_t<Receiver>>>) //
friend auto tag_invoke(tag_t<unifex::connect>, Sender&& s, Receiver&& r) noexcept(
std::is_nothrow_constructible_v<remove_cvref_t<Receiver>, Receiver> &&
std::is_nothrow_constructible_v<remove_cvref_t<Receiver>, Receiver> &&
std::is_nothrow_constructible_v<Func, member_t<Sender, Func>> &&
is_nothrow_connectable_v<
member_t<Sender, Predecessor>,
Expand Down
18 changes: 17 additions & 1 deletion include/unifex/upon_error.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include <unifex/config.hpp>
Expand Down Expand Up @@ -164,7 +180,7 @@ struct _sender<Predecessor, Func>::type {
member_t<Sender, Predecessor>,
receiver_t<remove_cvref_t<Receiver>>>) //
friend auto tag_invoke(tag_t<unifex::connect>, Sender&& s, Receiver&& r) noexcept(
std::is_nothrow_constructible_v<remove_cvref_t<Receiver>, Receiver> &&
std::is_nothrow_constructible_v<remove_cvref_t<Receiver>, Receiver> &&
std::is_nothrow_constructible_v<Func, member_t<Sender, Func>> &&
is_nothrow_connectable_v<
member_t<Sender, Predecessor>,
Expand Down
16 changes: 15 additions & 1 deletion source/async_auto_reset_event.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <unifex/async_auto_reset_event.hpp>

Expand Down
16 changes: 15 additions & 1 deletion test/async_auto_reset_event_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <gtest/gtest.h>

Expand Down
16 changes: 16 additions & 0 deletions test/detach_on_cancel_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <unifex/async_manual_reset_event.hpp>
#include <unifex/async_scope.hpp>
#include <unifex/detach_on_cancel.hpp>
Expand Down
16 changes: 16 additions & 0 deletions test/filter_stream_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <unifex/filter_stream.hpp>

#include <unifex/for_each.hpp>
Expand Down
16 changes: 16 additions & 0 deletions test/type_list_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <unifex/type_list.hpp>

using namespace unifex;
Expand Down
16 changes: 16 additions & 0 deletions test/upon_done_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <unifex/upon_done.hpp>

#include <unifex/just.hpp>
Expand Down
16 changes: 16 additions & 0 deletions test/upon_error_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <unifex/upon_error.hpp>

#include <unifex/just.hpp>
Expand Down
16 changes: 15 additions & 1 deletion test/when_all_range_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <gtest/gtest.h>

Expand Down

0 comments on commit fdd2c23

Please sign in to comment.