Skip to content

Commit

Permalink
Merge branch 'main' into xxx-identifier-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
InsertCreativityHere authored Jan 15, 2025
2 parents 3dc8134 + 603000d commit 951a19b
Show file tree
Hide file tree
Showing 344 changed files with 3,550 additions and 3,763 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Checks:
-modernize-avoid-c-arrays,
-modernize-use-trailing-return-type,
-modernize-concat-nested-namespaces,
-modernize-use-default-member-init,
performance-*,
-performance-avoid-endl
'
Expand Down
1 change: 1 addition & 0 deletions config/PropertyNames.xml
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@
</section>

<section name="DataStorm" opt-in="true">
<property name="Node.Name" languages="cpp" />
<property name="Node.ConnectTo" languages="cpp" />
<property name="Node.Multicast" class="ObjectAdapter" languages="cpp" />
<property name="Node.Multicast.Enabled" default="1" languages="cpp" />
Expand Down
11 changes: 5 additions & 6 deletions cpp/include/DataStorm/DataStorm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1371,9 +1371,9 @@ namespace DataStorm
auto unread = _impl->getAllUnread();
std::vector<Sample<Key, Value, UpdateTag>> samples;
samples.reserve(unread.size());
for (auto sample : unread)
for (const auto& sample : unread)
{
samples.emplace_back(sample);
samples.push_back(sample);
}
return samples;
}
Expand Down Expand Up @@ -1658,9 +1658,9 @@ namespace DataStorm
auto all = _impl->getAll();
std::vector<Sample<Key, Value, UpdateTag>> samples;
samples.reserve(all.size());
for (auto sample : all)
for (const auto& sample : all)
{
samples.emplace_back(sample);
samples.push_back(sample);
}
return samples;
}
Expand Down Expand Up @@ -1865,8 +1865,7 @@ namespace DataStorm
};

/** @private */
template<typename T, typename V>
struct RegexFilter<T, V, typename std::enable_if<DataStormI::is_streamable<V>::value>::type>
template<typename T, typename V> struct RegexFilter<T, V, std::enable_if_t<DataStormI::is_streamable<V>::value>>
{
template<typename F> static void add(F factory)
{
Expand Down
10 changes: 5 additions & 5 deletions cpp/include/DataStorm/InternalT.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ namespace DataStormI
}
};

template<typename T> struct EncoderT<T, typename std::enable_if<has_communicator_parameter<T>::value>::type>
template<typename T> struct EncoderT<T, std::enable_if_t<has_communicator_parameter<T>::value>>
{
static Ice::ByteSeq encode(const Ice::CommunicatorPtr& communicator, const T& value)
{
return DataStorm::Encoder<T>::encode(communicator, value);
}
};

template<typename T> struct DecoderT<T, typename std::enable_if<has_communicator_parameter<T>::value>::type>
template<typename T> struct DecoderT<T, std::enable_if_t<has_communicator_parameter<T>::value>>
{
static T decode(const Ice::CommunicatorPtr& communicator, const Ice::ByteSeq& data)
{
Expand Down Expand Up @@ -97,7 +97,7 @@ namespace DataStormI
}
};

template<typename T> struct Stringifier<T, typename std::enable_if<is_streamable<T>::value>::type>
template<typename T> struct Stringifier<T, std::enable_if_t<is_streamable<T>::value>>
{
static std::string toString(const T& value)
{
Expand Down Expand Up @@ -464,7 +464,7 @@ namespace DataStormI
class FilterFactoryT final : public FilterFactory, public AbstractFactoryT<C, FilterT<C, V>>
{
public:
FilterFactoryT() {}
FilterFactoryT() = default;

[[nodiscard]] std::shared_ptr<Filter> get(std::int64_t id) const final
{
Expand All @@ -481,7 +481,7 @@ namespace DataStormI

template<typename ValueT> class FilterManagerT final : public FilterManager
{
using Value = typename std::remove_reference<decltype(std::declval<ValueT>().get())>::type;
using Value = std::remove_reference_t<decltype(std::declval<ValueT>().get())>;

struct Factory
{
Expand Down
10 changes: 5 additions & 5 deletions cpp/include/Ice/Communicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace Ice
* @return The proxy, or nullopt if <code>str</code> is an empty string.
* @see #proxyToString
*/
template<typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of<ObjectPrx, Prx>::value, bool> = true>
template<typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of_v<ObjectPrx, Prx>, bool> = true>
std::optional<Prx> stringToProxy(std::string_view str) const
{
auto reference = _stringToProxy(str);
Expand Down Expand Up @@ -115,7 +115,7 @@ namespace Ice
* @param property The base property name.
* @return The proxy, or nullopt if the property is not set.
*/
template<typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of<ObjectPrx, Prx>::value, bool> = true>
template<typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of_v<ObjectPrx, Prx>, bool> = true>
std::optional<Prx> propertyToProxy(std::string_view property) const
{
auto reference = _propertyToProxy(property);
Expand Down Expand Up @@ -210,15 +210,15 @@ namespace Ice
* @return The object adapter associated by default with new outgoing connections.
* @see Connection::getAdapter
*/
[[nodiscard]] ObjectAdapterPtr getDefaultObjectAdapter() const noexcept;
[[nodiscard]] ObjectAdapterPtr getDefaultObjectAdapter() const;

/**
* Sets the object adapter that will be associated with new outgoing connections created by this
* communicator. This function has no effect on existing outgoing connections, or on incoming connections.
* @param adapter The object adapter to associate with new outgoing connections.
* @see Connection::setAdapter
*/
void setDefaultObjectAdapter(ObjectAdapterPtr adapter) noexcept;
void setDefaultObjectAdapter(ObjectAdapterPtr adapter);

/**
* Get the implicit context associated with this communicator.
Expand Down Expand Up @@ -357,7 +357,7 @@ namespace Ice
* @return A proxy to the main ("") facet of the Admin object, or nullopt if no Admin object is configured.
* @see #createAdmin
*/
std::optional<ObjectPrx> getAdmin() const; // NOLINT:modernize-use-nodiscard
std::optional<ObjectPrx> getAdmin() const; // NOLINT(modernize-use-nodiscard)

/**
* Add a new facet to the Admin object. Adding a servant with a facet that is already registered throws
Expand Down
12 changes: 6 additions & 6 deletions cpp/include/Ice/Comparable.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ namespace Ice
template<
class C,
std::enable_if_t<
std::is_member_function_pointer<decltype(&C::ice_tuple)>::value && !std::is_polymorphic_v<C>,
std::is_member_function_pointer_v<decltype(&C::ice_tuple)> && !std::is_polymorphic_v<C>,
bool> = true>
bool operator<(const C& lhs, const C& rhs)
{
Expand All @@ -141,7 +141,7 @@ namespace Ice
template<
class C,
std::enable_if_t<
std::is_member_function_pointer<decltype(&C::ice_tuple)>::value && !std::is_polymorphic_v<C>,
std::is_member_function_pointer_v<decltype(&C::ice_tuple)> && !std::is_polymorphic_v<C>,
bool> = true>
bool operator<=(const C& lhs, const C& rhs)
{
Expand All @@ -157,7 +157,7 @@ namespace Ice
template<
class C,
std::enable_if_t<
std::is_member_function_pointer<decltype(&C::ice_tuple)>::value && !std::is_polymorphic_v<C>,
std::is_member_function_pointer_v<decltype(&C::ice_tuple)> && !std::is_polymorphic_v<C>,
bool> = true>
bool operator>(const C& lhs, const C& rhs)
{
Expand All @@ -173,7 +173,7 @@ namespace Ice
template<
class C,
std::enable_if_t<
std::is_member_function_pointer<decltype(&C::ice_tuple)>::value && !std::is_polymorphic_v<C>,
std::is_member_function_pointer_v<decltype(&C::ice_tuple)> && !std::is_polymorphic_v<C>,
bool> = true>
bool operator>=(const C& lhs, const C& rhs)
{
Expand All @@ -189,7 +189,7 @@ namespace Ice
template<
class C,
std::enable_if_t<
std::is_member_function_pointer<decltype(&C::ice_tuple)>::value && !std::is_polymorphic_v<C>,
std::is_member_function_pointer_v<decltype(&C::ice_tuple)> && !std::is_polymorphic_v<C>,
bool> = true>
bool operator==(const C& lhs, const C& rhs)
{
Expand All @@ -205,7 +205,7 @@ namespace Ice
template<
class C,
std::enable_if_t<
std::is_member_function_pointer<decltype(&C::ice_tuple)>::value && !std::is_polymorphic_v<C>,
std::is_member_function_pointer_v<decltype(&C::ice_tuple)> && !std::is_polymorphic_v<C>,
bool> = true>
bool operator!=(const C& lhs, const C& rhs)
{
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/Ice/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@
#endif

// The Ice version.
// NOLINTBEGIN(modernize-macro-to-enum)
#define ICE_STRING_VERSION "3.8.0-alpha.0" // "A.B.C", with A=major, B=minor, C=patch
#define ICE_INT_VERSION 30850 // AABBCC, with AA=major, BB=minor, CC=patch
#define ICE_SO_VERSION "38a0" // "ABC", with A=major, B=minor, C=patch
// NOLINTEND(modernize-macro-to-enum)

#if !defined(ICE_BUILDING_ICE) && defined(ICE_API_EXPORTS)
# define ICE_BUILDING_ICE
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ namespace Ice
* @return A proxy that matches the given identity and uses this connection.
* @see #setAdapter
*/
template<typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of<ObjectPrx, Prx>::value, bool> = true>
template<typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of_v<ObjectPrx, Prx>, bool> = true>
[[nodiscard]] Prx createProxy(Identity id) const
{
return uncheckedCast<Prx>(_createProxy(std::move(id)));
Expand Down
1 change: 0 additions & 1 deletion cpp/include/Ice/FactoryTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <mutex>
#include <string>
#include <string_view>
#include <utility>

namespace IceInternal
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/IconvStringConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ namespace IceInternal
assert(rs == 0);
char* inbuf = reinterpret_cast<char*>(const_cast<std::byte*>(sourceStart));
assert(sourceEnd > sourceStart);
size_t inbytesleft = static_cast<size_t>(sourceEnd - sourceStart);
auto inbytesleft = static_cast<size_t>(sourceEnd - sourceStart);

char* outbuf = nullptr;
size_t outbytesleft = 0;
Expand Down
15 changes: 7 additions & 8 deletions cpp/include/Ice/InputStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace Ice
/// \cond INTERNAL
template<typename T> inline void patchValue(void* addr, const ValuePtr& v)
{
std::shared_ptr<T>* ptr = static_cast<std::shared_ptr<T>*>(addr);
auto* ptr = static_cast<std::shared_ptr<T>*>(addr);
*ptr = std::dynamic_pointer_cast<T>(v);
if (v && !(*ptr))
{
Expand Down Expand Up @@ -124,7 +124,7 @@ namespace Ice
clear(); // Not inlined.
}

for (auto d : _deleters)
for (const auto& d : _deleters)
{
d();
}
Expand Down Expand Up @@ -313,7 +313,7 @@ namespace Ice
{
std::uint8_t byte;
read(byte);
unsigned char val = static_cast<unsigned char>(byte);
auto val = static_cast<unsigned char>(byte);
if (val == 255)
{
std::int32_t v;
Expand Down Expand Up @@ -380,7 +380,7 @@ namespace Ice
* @param tag The tag ID.
* @param v Holds the extracted data (if any).
*/
template<typename T, std::enable_if_t<!std::is_base_of<ObjectPrx, T>::value, bool> = true>
template<typename T, std::enable_if_t<!std::is_base_of_v<ObjectPrx, T>, bool> = true>
void read(std::int32_t tag, std::optional<T>& v)
{
if (readOptional(
Expand All @@ -404,7 +404,7 @@ namespace Ice
* was set to nullopt (set to nullopt is supported for backward compatibility with Ice 3.7 and earlier
* releases).
*/
template<typename T, std::enable_if_t<std::is_base_of<ObjectPrx, T>::value, bool> = true>
template<typename T, std::enable_if_t<std::is_base_of_v<ObjectPrx, T>, bool> = true>
void read(std::int32_t tag, std::optional<T>& v)
{
if (readOptional(tag, OptionalFormat::FSize))
Expand Down Expand Up @@ -666,7 +666,7 @@ namespace Ice
* Reads a typed proxy from the stream.
* @param v The proxy as a user-defined type.
*/
template<typename Prx, std::enable_if_t<std::is_base_of<ObjectPrx, Prx>::value, bool> = true>
template<typename Prx, std::enable_if_t<std::is_base_of_v<ObjectPrx, Prx>, bool> = true>
void read(std::optional<Prx>& v)
{
IceInternal::ReferencePtr ref = readReference();
Expand All @@ -684,8 +684,7 @@ namespace Ice
* Reads a value (instance of a Slice class) from the stream (New mapping).
* @param v The instance.
*/
template<typename T, typename std::enable_if<std::is_base_of<Value, T>::value>::type* = nullptr>
void read(std::shared_ptr<T>& v)
template<typename T, std::enable_if_t<std::is_base_of_v<Value, T>>* = nullptr> void read(std::shared_ptr<T>& v)
{
read(patchValue<T>, &v);
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/LoggerUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace Ice
return LoggerOutputInserter<T, IsException<T>::value>::insert(out, val);
}

template<typename Prx, std::enable_if_t<std::is_base_of<ObjectPrx, Prx>::value, bool> = true>
template<typename Prx, std::enable_if_t<std::is_base_of_v<ObjectPrx, Prx>, bool> = true>
inline LoggerOutputBase& operator<<(LoggerOutputBase& os, const std::optional<Prx>& p)
{
return os << (p ? p->ice_toString() : "");
Expand Down
Loading

0 comments on commit 951a19b

Please sign in to comment.