@@ -82,20 +82,26 @@ class Engine {
8282
8383 virtual void create_transport (const Transport::Method& transport_method) = 0;
8484
85- void set_transport (std::shared_ptr<Transport> transport) { transport_ = transport; }
86- [[nodiscard]] std::shared_ptr<Transport> get_transport () const { return transport_; }
85+ void set_transport (std::shared_ptr<Transport> transport) noexcept { transport_ = transport; }
86+ [[nodiscard]] std::shared_ptr<Transport> get_transport () const noexcept { return transport_; }
8787
8888 void add_publisher (sg4::ActorPtr actor);
89- void rm_publisher (sg4::ActorPtr actor) { publishers_.erase (actor); }
90- [[nodiscard]] bool is_publisher (sg4::ActorPtr actor) const { return publishers_.find (actor) != publishers_.end (); }
89+ void rm_publisher (sg4::ActorPtr actor) noexcept { publishers_.erase (actor); }
90+ [[nodiscard]] bool is_publisher (sg4::ActorPtr actor) const noexcept
91+ {
92+ return publishers_.find (actor) != publishers_.end ();
93+ }
9194 // Synchronize publishers on engine closing
9295 [[nodiscard]] int is_last_publisher () const { return (pub_barrier_ && pub_barrier_->wait ()); }
9396
9497 void add_subscriber (sg4::ActorPtr actor);
95- void rm_subscriber (sg4::ActorPtr actor) { subscribers_.erase (actor); }
96- [[nodiscard]] bool is_subscriber (sg4::ActorPtr actor) const { return subscribers_.find (actor) != subscribers_.end (); }
98+ void rm_subscriber (sg4::ActorPtr actor) noexcept { subscribers_.erase (actor); }
99+ [[nodiscard]] bool is_subscriber (sg4::ActorPtr actor) const noexcept
100+ {
101+ return subscribers_.find (actor) != subscribers_.end ();
102+ }
97103 // Synchronize subscribers on engine closing
98- [[nodiscard]] int is_last_subscriber () const { return subscribers_.empty (); }
104+ [[nodiscard]] int is_last_subscriber () const noexcept { return subscribers_.empty (); }
99105
100106 void set_metadata_file_name ();
101107 // / \endcond
@@ -108,19 +114,21 @@ class Engine {
108114 }
109115 virtual ~Engine () = default ;
110116 // Public accessors for Transport classes to access ActivitySets
111- [[nodiscard]] sg4::ActivitySet& get_pub_transaction () { return pub_transaction_; }
112- [[nodiscard]] sg4::ActivitySet& get_sub_transaction () { return sub_transaction_; }
113- [[nodiscard]] const std::set<sg4::ActorPtr>& get_publishers () const { return publishers_; }
114- [[nodiscard]] size_t get_num_publishers () const { return publishers_.size (); }
115- [[nodiscard]] size_t get_num_subscribers () const { return subscribers_.size (); }
117+ [[nodiscard]] const sg4::ActivitySet& get_pub_transaction () const noexcept { return pub_transaction_; }
118+ [[nodiscard]] sg4::ActivitySet& get_pub_transaction () noexcept { return pub_transaction_; }
119+ [[nodiscard]] const sg4::ActivitySet& get_sub_transaction () const noexcept { return sub_transaction_; }
120+ [[nodiscard]] sg4::ActivitySet& get_sub_transaction () noexcept { return sub_transaction_; }
121+ [[nodiscard]] const std::set<sg4::ActorPtr>& get_publishers () const noexcept { return publishers_; }
122+ [[nodiscard]] size_t get_num_publishers () const noexcept { return publishers_.size (); }
123+ [[nodiscard]] size_t get_num_subscribers () const noexcept { return subscribers_.size (); }
116124 // / \endcond
117125
118126 // / @brief Helper function to print out the name of the Engine.
119127 // / @return the corresponding string
120- [[nodiscard]] const std::string& get_name () const { return name_; }
128+ [[nodiscard]] const std::string& get_name () const noexcept { return name_; }
121129 // / @brief Helper function to print out the name of the Engine.
122130 // / @return the corresponding C-string
123- [[nodiscard]] const char * get_cname () const { return name_.c_str (); }
131+ [[nodiscard]] const char * get_cname () const noexcept { return name_.c_str (); }
124132
125133 // / @brief Start a transaction on an Engine.
126134 void begin_transaction ();
@@ -143,11 +151,11 @@ class Engine {
143151
144152 // / @brief Get the id of the current transaction (on the Publish side).
145153 // / @return The id of the ongoing transaction.
146- [[nodiscard]] unsigned int get_current_transaction () const { return current_pub_transaction_id_; }
154+ [[nodiscard]] unsigned int get_current_transaction () const noexcept { return current_pub_transaction_id_; }
147155
148156 // / @brief Get the name of the file in which the engine stored metadata
149157 // / @return The name of the file.
150- [[nodiscard]] const std::string& get_metadata_file_name () const { return metadata_file_; }
158+ [[nodiscard]] const std::string& get_metadata_file_name () const noexcept { return metadata_file_; }
151159
152160 // / @brief Close the Engine associated to a Stream.
153161 void close ();
0 commit comments