Skip to content
Merged
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
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ cc_library(
":jni_bind",
":mock_jni_env",
":mock_jvm",
"//bind_lang/metaprogramming:function_traits",
"@googletest//:gtest_main",
],
)
Expand Down
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <type_traits>

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

template <typename Func>
struct All {
Expand All @@ -34,6 +34,6 @@ using All_t = typename All<Func>::template type<Ts...>;
template <typename Func, typename... Ts>
static constexpr bool All_v = All_t<Func, Ts...>::value;

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_ALL_H_
14 changes: 7 additions & 7 deletions bind_lang/metaprogramming/all_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
#include "same.h"
#include "unwrap.h"

using ::jni::metaprogramming::All;
using ::jni::metaprogramming::All_t;
using ::jni::metaprogramming::All_v;
using ::jni::metaprogramming::Invoke_t;
using ::jni::metaprogramming::Same;
using ::jni::metaprogramming::Unwrap;
using ::jni::metaprogramming::Unwrap_t;
using ::bind_lang::metaprogramming::All;
using ::bind_lang::metaprogramming::All_t;
using ::bind_lang::metaprogramming::All_v;
using ::bind_lang::metaprogramming::Invoke_t;
using ::bind_lang::metaprogramming::Same;
using ::bind_lang::metaprogramming::Unwrap;
using ::bind_lang::metaprogramming::Unwrap_t;

namespace {

Expand Down
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/all_unique.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "contains.h"

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

template <typename...>
struct AllUnique {
Expand All @@ -47,6 +47,6 @@ constexpr bool AllUniqueValues(const T1&& t1, const Ts&&... ts) {
return (!ContainsValue(t1, ts...)) && AllUniqueValues(ts...);
}

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_ALL_UNIQUE_H_
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/all_unique_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

namespace {

using ::jni::metaprogramming::AllUnique_v;
using ::jni::metaprogramming::AllUniqueValues;
using ::bind_lang::metaprogramming::AllUnique_v;
using ::bind_lang::metaprogramming::AllUniqueValues;

static_assert(AllUnique_v<>);
static_assert(AllUnique_v<void>);
Expand Down
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/any.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "tuple_manipulation.h"

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

template <typename Func>
struct Any {
Expand All @@ -42,6 +42,6 @@ using Any_Tup = TupleUnroller_t<Any<Func>, Ts>;
template <typename Func, typename Ts>
static constexpr bool Any_Tup_v = TupleUnroller_t<Any<Func>, Ts>::value;

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_ANY_H_
10 changes: 5 additions & 5 deletions bind_lang/metaprogramming/any_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include "invoke.h"
#include "same.h"

using ::jni::metaprogramming::Any;
using ::jni::metaprogramming::Any_t;
using ::jni::metaprogramming::Any_v;
using ::jni::metaprogramming::Invoke_t;
using ::jni::metaprogramming::Same;
using ::bind_lang::metaprogramming::Any;
using ::bind_lang::metaprogramming::Any_t;
using ::bind_lang::metaprogramming::Any_v;
using ::bind_lang::metaprogramming::Invoke_t;
using ::bind_lang::metaprogramming::Same;

namespace {

Expand Down
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/apply.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "tuple_manipulation.h"

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

// Forwards all arguments to a metafunction. Note, Apply<Func> is itself a type
// whose |type| (aka its metafunction's invocation).
Expand All @@ -37,6 +37,6 @@ using Apply_t = typename Apply<Function>::template type<Ts...>;
template <template <typename...> class Function, typename TupleType>
using ApplyTup_t = TupleUnroller_t<Apply<Function>, TupleType>;

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_APPLY_H_
10 changes: 5 additions & 5 deletions bind_lang/metaprogramming/apply_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#include "invoke.h"
#include "same.h"

using ::jni::metaprogramming::Apply;
using ::jni::metaprogramming::Apply_t;
using ::jni::metaprogramming::Invoke_t;
using ::jni::metaprogramming::InvokePerTupArg_t;
using ::jni::metaprogramming::Same;
using ::bind_lang::metaprogramming::Apply;
using ::bind_lang::metaprogramming::Apply_t;
using ::bind_lang::metaprogramming::Invoke_t;
using ::bind_lang::metaprogramming::InvokePerTupArg_t;
using ::bind_lang::metaprogramming::Same;

namespace {

Expand Down
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <type_traits>

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

template <typename BaseToTest>
struct Base {
Expand All @@ -30,6 +30,6 @@ struct Base {
template <typename BaseToTest, typename TypeToTest>
using Base_t = typename Base<BaseToTest>::template type<TypeToTest>;

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_BASE_H_
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/base_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "concatenate.h"

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

// Returns all elements derived from DesiredBase.
//
Expand Down Expand Up @@ -65,6 +65,6 @@ using BaseFilterWithDefault_t =
DefaultIfEmpty_Tup<BaseFilter_t<DesiredBase, Ts...>,
std::tuple<DefaultValue>>;

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_BASE_FILTER_H_
2 changes: 1 addition & 1 deletion bind_lang/metaprogramming/base_filter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <tuple>
#include <type_traits>

using ::jni::metaprogramming::BaseFilter_t;
using ::bind_lang::metaprogramming::BaseFilter_t;

namespace {

Expand Down
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/call.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <tuple>

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

// Call takes a tuple of arguments and returns a tuple of elements
// dereferenced once (with no arguments). Eventually, this should have
Expand All @@ -39,6 +39,6 @@ struct Call {
template <typename T>
using Call_t = typename Call::type<T>;

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_CALL_H_
2 changes: 1 addition & 1 deletion bind_lang/metaprogramming/call_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <tuple>
#include <type_traits>

using ::jni::metaprogramming::Call_t;
using ::bind_lang::metaprogramming::Call_t;

namespace {

Expand Down
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/cartesian_product.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "n_bit_sequence.h"
#include "type_of_nth_element.h"

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

// Metafunction that takes a list of tuples, and creates a counter where each
// value is the size of the corresponding tuple. This can be used to create
Expand Down Expand Up @@ -100,6 +100,6 @@ struct CartesianProduct {
template <typename... Tups>
using CartesianProduct_t = typename CartesianProduct::template type<Tups...>;

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_CARTESIAN_PRODUCT_H_
12 changes: 6 additions & 6 deletions bind_lang/metaprogramming/cartesian_product_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@

namespace {

using ::jni::metaprogramming::CartesianProduct;
using ::jni::metaprogramming::CartesianProduct_t;
using ::jni::metaprogramming::GenerateBitSequenceFromTupSets_t;
using ::jni::metaprogramming::InvokeAsPack_t;
using ::jni::metaprogramming::NBit;
using ::jni::metaprogramming::NBitSequence;
using ::bind_lang::metaprogramming::CartesianProduct;
using ::bind_lang::metaprogramming::CartesianProduct_t;
using ::bind_lang::metaprogramming::GenerateBitSequenceFromTupSets_t;
using ::bind_lang::metaprogramming::InvokeAsPack_t;
using ::bind_lang::metaprogramming::NBit;
using ::bind_lang::metaprogramming::NBitSequence;

template <typename... Ts>
using Tup = std::tuple<Ts...>;
Expand Down
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "invoke.h"

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

// Metafunction to invoke a metafunction and forward its output to another
// metafunction (or sequence of metafunctions). Note, unlike typical functional
Expand All @@ -42,6 +42,6 @@ struct Chain<FirstFunc, Funcs...> {
Invoke_t<Chain<Funcs...>, Invoke_t<FirstFunc, ArgsForFirstFunc...>>;
};

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_CHAIN_H_
10 changes: 5 additions & 5 deletions bind_lang/metaprogramming/chain_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#include "invoke.h"
#include "same.h"

using ::jni::metaprogramming::Chain;
using ::jni::metaprogramming::Increment;
using ::jni::metaprogramming::Increment_t;
using ::jni::metaprogramming::Invoke_t;
using ::jni::metaprogramming::Same;
using ::bind_lang::metaprogramming::Chain;
using ::bind_lang::metaprogramming::Increment;
using ::bind_lang::metaprogramming::Increment_t;
using ::bind_lang::metaprogramming::Invoke_t;
using ::bind_lang::metaprogramming::Same;

namespace {

Expand Down
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <string>
#include <string_view>

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

struct Color {
static constexpr std::string_view kNone{"\033[0m"};
Expand Down Expand Up @@ -71,6 +71,6 @@ inline std::string Colorize(std::string_view colour, std::string_view str,
std::string{Color::kNone};
}

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_COLOR_H_
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/color_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#include <gtest/gtest.h>

using ::jni::metaprogramming::Color;
using ::jni::metaprogramming::Colorize;
using ::bind_lang::metaprogramming::Color;
using ::bind_lang::metaprogramming::Colorize;

namespace {

Expand Down
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/combine.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <tuple>

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

// Takes two tuples and collapses them into a single tuple.
struct Combine {
Expand All @@ -41,6 +41,6 @@ struct Combine {
template <typename Tup1, typename Tup2>
using Combine_t = typename Combine::template type<Tup1, Tup2>;

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_COMBINE_H_
2 changes: 1 addition & 1 deletion bind_lang/metaprogramming/combine_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <tuple>
#include <type_traits>

using ::jni::metaprogramming::Combine_t;
using ::bind_lang::metaprogramming::Combine_t;

namespace {

Expand Down
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/concatenate.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "combine.h"
#include "reduce.h"

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

// Metafunction to generate a concatenation of variadic args.
struct Concatenate {
Expand All @@ -47,6 +47,6 @@ struct ConcatenateTup<std::tuple<T1s...>> {
template <typename... Tups>
using ConcatenateTup_t = Reduce_t<Combine, Tups...>;

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_CONCATENATE_H_
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/concatenate_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include <tuple>
#include <type_traits>

using ::jni::metaprogramming::Concatenate_t;
using ::jni::metaprogramming::ConcatenateTup_t;
using ::bind_lang::metaprogramming::Concatenate_t;
using ::bind_lang::metaprogramming::ConcatenateTup_t;

namespace {

Expand Down
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/conditional.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <tuple>
#include <type_traits>

namespace jni::metaprogramming {
namespace bind_lang::metaprogramming {

// For a given Func which takes values, returns std::tuple<Ts...> if
// Func<Ts...>::value is true, otherwise returns std::tuple. Func must have a
Expand All @@ -38,6 +38,6 @@ struct Conditional {
template <typename Func, typename... Ts>
using Conditional_t = typename Conditional<Func>::template type<Ts...>;

} // namespace jni::metaprogramming
} // namespace bind_lang::metaprogramming

#endif // JNI_BIND_BIND_LANG_METAPROGRAMMING_CONDITIONAL_H_
4 changes: 2 additions & 2 deletions bind_lang/metaprogramming/conditional_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

namespace {

using ::jni::metaprogramming::Conditional_t;
using ::jni::metaprogramming::Same;
using ::bind_lang::metaprogramming::Conditional_t;
using ::bind_lang::metaprogramming::Same;

struct A {};
struct B {};
Expand Down
Loading
Loading