Skip to content

Commit

Permalink
HEAD:(zeroc-ice/ice@f2714f720c) DataStorm comments & minor fixes (zer…
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone authored and temp committed Dec 2, 2024
1 parent 9a0ecc5 commit 1680358
Show file tree
Hide file tree
Showing 1,528 changed files with 2,939 additions and 2,341 deletions.
22 changes: 11 additions & 11 deletions slice2cpp/cpp/src/DataStorm/Contract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,32 +230,32 @@ DataStormContract::SessionPrx::_iceI_announceElements(const ::std::shared_ptr<::
}

void
DataStormContract::SessionPrx::attachElements(::std::int64_t iceP_topic, const ElementSpecSeq& iceP_elements, bool iceP_initialize, const ::Ice::Context& context) const
DataStormContract::SessionPrx::attachElements(::std::int64_t iceP_topicId, const ElementSpecSeq& iceP_elements, bool iceP_initialize, const ::Ice::Context& context) const
{
::IceInternal::makePromiseOutgoing<void>(true, this, &SessionPrx::_iceI_attachElements, iceP_topic, iceP_elements, iceP_initialize, context).get();
::IceInternal::makePromiseOutgoing<void>(true, this, &SessionPrx::_iceI_attachElements, iceP_topicId, iceP_elements, iceP_initialize, context).get();
}

::std::future<void>
DataStormContract::SessionPrx::attachElementsAsync(::std::int64_t iceP_topic, const ElementSpecSeq& iceP_elements, bool iceP_initialize, const ::Ice::Context& context) const
DataStormContract::SessionPrx::attachElementsAsync(::std::int64_t iceP_topicId, const ElementSpecSeq& iceP_elements, bool iceP_initialize, const ::Ice::Context& context) const
{
return ::IceInternal::makePromiseOutgoing<void>(false, this, &SessionPrx::_iceI_attachElements, iceP_topic, iceP_elements, iceP_initialize, context);
return ::IceInternal::makePromiseOutgoing<void>(false, this, &SessionPrx::_iceI_attachElements, iceP_topicId, iceP_elements, iceP_initialize, context);
}

::std::function<void()>
DataStormContract::SessionPrx::attachElementsAsync(::std::int64_t iceP_topic, const ElementSpecSeq& iceP_elements, bool iceP_initialize, ::std::function<void()> response, ::std::function<void(::std::exception_ptr)> ex, ::std::function<void(bool)> sent, const ::Ice::Context& context) const
DataStormContract::SessionPrx::attachElementsAsync(::std::int64_t iceP_topicId, const ElementSpecSeq& iceP_elements, bool iceP_initialize, ::std::function<void()> response, ::std::function<void(::std::exception_ptr)> ex, ::std::function<void(bool)> sent, const ::Ice::Context& context) const
{
return ::IceInternal::makeLambdaOutgoing<void>(::std::move(response), ::std::move(ex), ::std::move(sent), this, &DataStormContract::SessionPrx::_iceI_attachElements, iceP_topic, iceP_elements, iceP_initialize, context);
return ::IceInternal::makeLambdaOutgoing<void>(::std::move(response), ::std::move(ex), ::std::move(sent), this, &DataStormContract::SessionPrx::_iceI_attachElements, iceP_topicId, iceP_elements, iceP_initialize, context);
}

void
DataStormContract::SessionPrx::_iceI_attachElements(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, ::std::int64_t iceP_topic, const ElementSpecSeq& iceP_elements, bool iceP_initialize, const ::Ice::Context& context) const
DataStormContract::SessionPrx::_iceI_attachElements(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, ::std::int64_t iceP_topicId, const ElementSpecSeq& iceP_elements, bool iceP_initialize, const ::Ice::Context& context) const
{
static constexpr ::std::string_view operationName = "attachElements";

outAsync->invoke(operationName, ::Ice::OperationMode::Normal, ::std::nullopt, context,
[&](::Ice::OutputStream* ostr)
{
ostr->writeAll(iceP_topic, iceP_elements, iceP_initialize);
ostr->writeAll(iceP_topicId, iceP_elements, iceP_initialize);
ostr->writePendingValues();
},
nullptr);
Expand Down Expand Up @@ -817,13 +817,13 @@ DataStormContract::Session::_iceD_attachElements(::Ice::IncomingRequest& request
_iceCheckMode(::Ice::OperationMode::Normal, request.current().mode);
auto istr = &request.inputStream();
istr->startEncapsulation();
::std::int64_t iceP_topic;
::std::int64_t iceP_topicId;
ElementSpecSeq iceP_elements;
bool iceP_initialize;
istr->readAll(iceP_topic, iceP_elements, iceP_initialize);
istr->readAll(iceP_topicId, iceP_elements, iceP_initialize);
istr->readPendingValues();
istr->endEncapsulation();
this->attachElements(iceP_topic, ::std::move(iceP_elements), iceP_initialize, request.current());
this->attachElements(iceP_topicId, ::std::move(iceP_elements), iceP_initialize, request.current());
sendResponse(::Ice::makeEmptyOutgoingResponse(request.current()));
}
/// \endcond
Expand Down
93 changes: 82 additions & 11 deletions slice2cpp/cpp/src/DataStorm/Contract.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

namespace DataStormContract
{
/// The ClearHistoryPolicy enumeration defines the policy that determines when a reader clears its
/// DataSample history in response to various events.
/// The ClearHistoryPolicy enumeration defines the policy that determines when a reader clears its DataSample
/// history in response to various events.
enum class ClearHistoryPolicy : ::std::uint8_t
{
/// The reader clears its history when a new DataSample is added.
Expand Down Expand Up @@ -220,17 +220,19 @@ class SessionPrx : public ::Ice::Proxy<SessionPrx, ::Ice::ObjectPrx>
/// \endcond

/// Announces new elements to the peer.
///
/// The peer will invoke `attachElements` for the elements it is interested in. The announced elements include
/// key readers, key writers, and filter readers associated with the specified topic.
/// the readers and writers associated with the specified topic.
/// @param topic The ID of the topic associated with the elements.
/// @param elements The sequence of elements to announce.
/// @param context The Context map to send with the invocation.
/// @see attachElements
void announceElements(::std::int64_t topic, const ElementInfoSeq& elements, const ::Ice::Context& context = ::Ice::noExplicitContext) const;

/// Announces new elements to the peer.
///
/// The peer will invoke `attachElements` for the elements it is interested in. The announced elements include
/// key readers, key writers, and filter readers associated with the specified topic.
/// the readers and writers associated with the specified topic.
/// @param topic The ID of the topic associated with the elements.
/// @param elements The sequence of elements to announce.
/// @param context The Context map to send with the invocation.
Expand All @@ -239,8 +241,9 @@ class SessionPrx : public ::Ice::Proxy<SessionPrx, ::Ice::ObjectPrx>
[[nodiscard]] ::std::future<void> announceElementsAsync(::std::int64_t topic, const ElementInfoSeq& elements, const ::Ice::Context& context = ::Ice::noExplicitContext) const;

/// Announces new elements to the peer.
///
/// The peer will invoke `attachElements` for the elements it is interested in. The announced elements include
/// key readers, key writers, and filter readers associated with the specified topic.
/// the readers and writers associated with the specified topic.
/// @param topic The ID of the topic associated with the elements.
/// @param elements The sequence of elements to announce.
/// @param response The response callback.
Expand All @@ -256,12 +259,32 @@ class SessionPrx : public ::Ice::Proxy<SessionPrx, ::Ice::ObjectPrx>
void _iceI_announceElements(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>&, ::std::int64_t, const ElementInfoSeq&, const ::Ice::Context&) const;
/// \endcond

void attachElements(::std::int64_t topic, const ElementSpecSeq& elements, bool initialize, const ::Ice::Context& context = ::Ice::noExplicitContext) const;
/// Attaches the given topic elements to all subscribers of the specified topic.
/// @param topicId The ID of the topic to which the elements belong.
/// @param elements The sequence of elements to attach to the topic's subscribers.
/// @param initialize True if called from attachTopic, false otherwise.
/// @param context The Context map to send with the invocation.
void attachElements(::std::int64_t topicId, const ElementSpecSeq& elements, bool initialize, const ::Ice::Context& context = ::Ice::noExplicitContext) const;

[[nodiscard]] ::std::future<void> attachElementsAsync(::std::int64_t topic, const ElementSpecSeq& elements, bool initialize, const ::Ice::Context& context = ::Ice::noExplicitContext) const;
/// Attaches the given topic elements to all subscribers of the specified topic.
/// @param topicId The ID of the topic to which the elements belong.
/// @param elements The sequence of elements to attach to the topic's subscribers.
/// @param initialize True if called from attachTopic, false otherwise.
/// @param context The Context map to send with the invocation.
/// @return The future object for the invocation.
[[nodiscard]] ::std::future<void> attachElementsAsync(::std::int64_t topicId, const ElementSpecSeq& elements, bool initialize, const ::Ice::Context& context = ::Ice::noExplicitContext) const;

/// Attaches the given topic elements to all subscribers of the specified topic.
/// @param topicId The ID of the topic to which the elements belong.
/// @param elements The sequence of elements to attach to the topic's subscribers.
/// @param initialize True if called from attachTopic, false otherwise.
/// @param response The response callback.
/// @param ex The exception callback.
/// @param sent The sent callback.
/// @param context The Context map to send with the invocation.
/// @return A function that can be called to cancel the invocation locally.
::std::function<void()>
attachElementsAsync(::std::int64_t topic, const ElementSpecSeq& elements, bool initialize, ::std::function<void()> response, ::std::function<void(::std::exception_ptr)> ex = nullptr, ::std::function<void(bool)> sent = nullptr, const ::Ice::Context& context = ::Ice::noExplicitContext) const;
attachElementsAsync(::std::int64_t topicId, const ElementSpecSeq& elements, bool initialize, ::std::function<void()> response, ::std::function<void(::std::exception_ptr)> ex = nullptr, ::std::function<void(bool)> sent = nullptr, const ::Ice::Context& context = ::Ice::noExplicitContext) const;

/// \cond INTERNAL
void _iceI_attachElements(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>&, ::std::int64_t, const ElementSpecSeq&, bool, const ::Ice::Context&) const;
Expand Down Expand Up @@ -410,10 +433,30 @@ class SubscriberSessionPrx : public ::Ice::Proxy<SubscriberSessionPrx, SessionPr
{
public:

/// Queue a sample with the subscribers of the topic element.
/// @param topicId The ID of the topic.
/// @param elementId The ID of the element.
/// @param sample The sample to queue.
/// @param context The Context map to send with the invocation.
void s(::std::int64_t topicId, ::std::int64_t elementId, const DataSample& sample, const ::Ice::Context& context = ::Ice::noExplicitContext) const;

/// Queue a sample with the subscribers of the topic element.
/// @param topicId The ID of the topic.
/// @param elementId The ID of the element.
/// @param sample The sample to queue.
/// @param context The Context map to send with the invocation.
/// @return The future object for the invocation.
[[nodiscard]] ::std::future<void> sAsync(::std::int64_t topicId, ::std::int64_t elementId, const DataSample& sample, const ::Ice::Context& context = ::Ice::noExplicitContext) const;

/// Queue a sample with the subscribers of the topic element.
/// @param topicId The ID of the topic.
/// @param elementId The ID of the element.
/// @param sample The sample to queue.
/// @param response The response callback.
/// @param ex The exception callback.
/// @param sent The sent callback.
/// @param context The Context map to send with the invocation.
/// @return A function that can be called to cancel the invocation locally.
::std::function<void()>
sAsync(::std::int64_t topicId, ::std::int64_t elementId, const DataSample& sample, ::std::function<void()> response, ::std::function<void(::std::exception_ptr)> ex = nullptr, ::std::function<void(bool)> sent = nullptr, const ::Ice::Context& context = ::Ice::noExplicitContext) const;

Expand Down Expand Up @@ -831,7 +874,7 @@ struct DataSamples
/// and encoded value.
struct ElementInfo
{
/// The unique identifier of the element. Filter IDs are negative.
/// The ID of the element. Filter IDs are negative, while key and tag IDs are positive.
::std::int64_t id;
/// The name of the filter. This field is empty for key and tag elements.
::std::string name;
Expand Down Expand Up @@ -906,13 +949,20 @@ struct FilterInfo
}
};

/// Represents the configuration of a reader or writer.
class ElementConfig : public ::Ice::Value
{
public:
/// Default constructor.
ElementConfig() noexcept = default;

/// One-shot constructor to initialize all data members.
/// @param sampleFilter An optional sample filter associated with the reader.
/// @param name An optional name for the reader or writer.
/// @param priority An optional priority for the writer.
/// @param sampleCount An optional sample count, specifying the number of samples queued in the writer or reader sample queue.
/// @param sampleLifetime An optional lifetime, specified in milliseconds, representing the maximum time samples are kept in the writer or reader sample queue.
/// @param clearHistory An optional clear history policy that determines when the reader or writer sample history is cleared.
ElementConfig(::std::optional<::std::string> facet, ::std::optional<::DataStormContract::FilterInfo> sampleFilter, ::std::optional<::std::string> name, ::std::optional<::std::int32_t> priority, ::std::optional<::std::int32_t> sampleCount, ::std::optional<::std::int32_t> sampleLifetime, ::std::optional<::DataStormContract::ClearHistoryPolicy> clearHistory) noexcept :
facet(::std::move(facet)),
sampleFilter(::std::move(sampleFilter)),
Expand Down Expand Up @@ -942,11 +992,21 @@ class ElementConfig : public ::Ice::Value
ElementConfigPtr ice_clone() const { return ::std::static_pointer_cast<ElementConfig>(_iceCloneImpl()); }

::std::optional<::std::string> facet;
/// An optional sample filter associated with the reader. Sample filters are specified on the reader side.
::std::optional<::DataStormContract::FilterInfo> sampleFilter;
/// An optional name for the reader or writer.
::std::optional<::std::string> name;
/// An optional priority for the writer.
/// See also the `DataStorm.Topic.Priority` property.
::std::optional<::std::int32_t> priority;
/// An optional sample count, specifying the number of samples queued in the writer or reader sample queue.
/// See also the `DataStorm.Topic.SampleCount` property.
::std::optional<::std::int32_t> sampleCount;
/// An optional lifetime, specified in milliseconds, representing the maximum time samples are kept in the
/// writer or reader sample queue. See also the `DataStorm.Topic.SampleLifetime` property.
::std::optional<::std::int32_t> sampleLifetime;
/// An optional clear history policy that determines when the reader or writer sample history is cleared.
/// See also the `DataStorm.Topic.ClearHistory` property.
::std::optional<::DataStormContract::ClearHistoryPolicy> clearHistory;

protected:
Expand Down Expand Up @@ -1116,8 +1176,9 @@ class Session : public virtual ::Ice::Object
/// \endcond

/// Announces new elements to the peer.
///
/// The peer will invoke `attachElements` for the elements it is interested in. The announced elements include
/// key readers, key writers, and filter readers associated with the specified topic.
/// the readers and writers associated with the specified topic.
/// @param topic The ID of the topic associated with the elements.
/// @param elements The sequence of elements to announce.
/// @param current The Current object for the invocation.
Expand All @@ -1127,7 +1188,12 @@ class Session : public virtual ::Ice::Object
void _iceD_announceElements(::Ice::IncomingRequest&, ::std::function<void(::Ice::OutgoingResponse)>);
/// \endcond

virtual void attachElements(::std::int64_t topic, ElementSpecSeq elements, bool initialize, const ::Ice::Current& current) = 0;
/// Attaches the given topic elements to all subscribers of the specified topic.
/// @param topicId The ID of the topic to which the elements belong.
/// @param elements The sequence of elements to attach to the topic's subscribers.
/// @param initialize True if called from attachTopic, false otherwise.
/// @param current The Current object for the invocation.
virtual void attachElements(::std::int64_t topicId, ElementSpecSeq elements, bool initialize, const ::Ice::Current& current) = 0;
/// \cond INTERNAL
void _iceD_attachElements(::Ice::IncomingRequest&, ::std::function<void(::Ice::OutgoingResponse)>);
/// \endcond
Expand Down Expand Up @@ -1206,6 +1272,11 @@ class SubscriberSession : public virtual Session
/// @return A fully-scoped type ID.
static const char* ice_staticId() noexcept;

/// Queue a sample with the subscribers of the topic element.
/// @param topicId The ID of the topic.
/// @param elementId The ID of the element.
/// @param sample The sample to queue.
/// @param current The Current object for the invocation.
virtual void s(::std::int64_t topicId, ::std::int64_t elementId, DataSample sample, const ::Ice::Current& current) = 0;
/// \cond INTERNAL
void _iceD_s(::Ice::IncomingRequest&, ::std::function<void(::Ice::OutgoingResponse)>);
Expand Down
8 changes: 4 additions & 4 deletions slice2cpp/slice/Glacier2/Router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ Glacier2::RouterPrx::_iceI_createSession(const ::std::shared_ptr<::IceInternal::
{
ex.ice_throw();
}
catch(const PermissionDeniedException&)
catch(const CannotCreateSessionException&)
{
throw;
}
catch(const CannotCreateSessionException&)
catch(const PermissionDeniedException&)
{
throw;
}
Expand Down Expand Up @@ -155,11 +155,11 @@ Glacier2::RouterPrx::_iceI_createSessionFromSecureConnection(const ::std::shared
{
ex.ice_throw();
}
catch(const PermissionDeniedException&)
catch(const CannotCreateSessionException&)
{
throw;
}
catch(const CannotCreateSessionException&)
catch(const PermissionDeniedException&)
{
throw;
}
Expand Down
Loading

0 comments on commit 1680358

Please sign in to comment.