Skip to content

Commit 67822bd

Browse files
committed
check and fix use of noexcept
1 parent 730644b commit 67822bd

7 files changed

Lines changed: 21 additions & 21 deletions

File tree

include/dtlmod/ActorRegistry.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ActorRegistry {
3131
ActorRegistry() = default;
3232

3333
void add(sg4::ActorPtr actor) { actors_.insert(actor); }
34-
void remove(sg4::ActorPtr actor) noexcept { actors_.erase(actor); }
34+
void remove(sg4::ActorPtr actor) { actors_.erase(actor); }
3535
[[nodiscard]] bool contains(sg4::ActorPtr actor) const noexcept { return actors_.find(actor) != actors_.end(); }
3636
[[nodiscard]] size_t count() const noexcept { return actors_.size(); }
3737
[[nodiscard]] const std::set<sg4::ActorPtr>& get_actors() const noexcept { return actors_; }

include/dtlmod/DTL.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class DTL {
2828

2929
protected:
3030
/// \cond EXCLUDE_FROM_DOCUMENTATION
31-
void lock() noexcept { mutex_->lock(); }
32-
void unlock() noexcept { mutex_->unlock(); }
31+
void lock() { mutex_->lock(); }
32+
void unlock() { mutex_->unlock(); }
3333
/// \endcond
3434

3535
public:

include/dtlmod/FileTransport.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ class FileTransport : public Transport {
3131
void close_pub_files() const;
3232
void close_sub_files(sg4::ActorPtr self);
3333
const std::vector<std::pair<std::shared_ptr<sgfs::File>, sg_size_t>>&
34-
get_to_write_in_transaction_by_actor(sg4::ActorPtr actor) noexcept
34+
get_to_write_in_transaction_by_actor(sg4::ActorPtr actor)
3535
{
3636
return to_write_in_transaction_[actor];
3737
}
38-
void clear_to_write_in_transaction(sg4::ActorPtr actor) noexcept { to_write_in_transaction_[actor].clear(); }
38+
void clear_to_write_in_transaction(sg4::ActorPtr actor) { to_write_in_transaction_[actor].clear(); }
3939

4040
const std::vector<std::pair<std::shared_ptr<sgfs::File>, sg_size_t>>&
41-
get_to_read_in_transaction_by_actor(sg4::ActorPtr actor) noexcept
41+
get_to_read_in_transaction_by_actor(sg4::ActorPtr actor)
4242
{
4343
return to_read_in_transaction_[actor];
4444
}
45-
void clear_to_read_in_transaction(sg4::ActorPtr actor) noexcept { to_read_in_transaction_[actor].clear(); }
45+
void clear_to_read_in_transaction(sg4::ActorPtr actor) { to_read_in_transaction_[actor].clear(); }
4646

4747
public:
4848
void put(const std::shared_ptr<Variable>& var, size_t size) override;

include/dtlmod/StagingTransport.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ class StagingTransport : public Transport {
2626

2727
// Create a message queue to receive request for variable pieces from subscribers
2828
void set_publisher_put_requests_mq(const std::string& publisher_name);
29-
[[nodiscard]] sg4::MessageQueue* get_publisher_put_requests_mq(const std::string& publisher_name) const noexcept;
30-
[[nodiscard]] bool pending_put_requests_exist_for(const std::string& pub_name) noexcept
29+
[[nodiscard]] sg4::MessageQueue* get_publisher_put_requests_mq(const std::string& publisher_name) const;
30+
[[nodiscard]] bool pending_put_requests_exist_for(const std::string& pub_name)
3131
{
3232
return not pending_put_requests_[pub_name].empty();
3333
}
34-
[[nodiscard]] sg4::ActivityPtr wait_any_pending_put_request_for(const std::string& pub_name) noexcept
34+
[[nodiscard]] sg4::ActivityPtr wait_any_pending_put_request_for(const std::string& pub_name)
3535
{
3636
return pending_put_requests_[pub_name].wait_any();
3737
}

include/dtlmod/Stream.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ class Stream : public std::enable_shared_from_this<Stream> {
8989
[[nodiscard]] const char* get_cname() const noexcept { return name_.c_str(); }
9090
/// @brief Helper function to print out the Engine::Type of the Stream.
9191
/// @return The corresponding C-string
92-
[[nodiscard]] const char* get_engine_type_str() const;
92+
[[nodiscard]] const char* get_engine_type_str() const noexcept;
9393
/// @brief Helper function to print out the Transport::Method of the Stream.
9494
/// @return The corresponding C-string
95-
[[nodiscard]] const char* get_transport_method_str() const;
95+
[[nodiscard]] const char* get_transport_method_str() const noexcept;
9696
/// @brief Helper function to know the access Mode of the Stream.
9797
/// @return The corresponding Stream::Mode
9898
[[nodiscard]] Mode get_access_mode() const noexcept { return access_mode_; }
@@ -113,10 +113,10 @@ class Stream : public std::enable_shared_from_this<Stream> {
113113
Stream& set_transport_method(const Transport::Method& transport_method);
114114
/// @brief Stream configuration function: specify that metadata must be exported
115115
/// @return The calling Stream (enable method chaining).
116-
Stream& set_metadata_export();
116+
Stream& set_metadata_export() noexcept;
117117
/// @brief Stream configuration function: specify that metadata must not be exported
118118
/// @return The calling Stream (enable method chaining).
119-
Stream& unset_metadata_export();
119+
Stream& unset_metadata_export() noexcept;
120120
/// @brief Get the name of the file in which the stream stores metadata
121121
/// @return The name of the file.
122122
[[nodiscard]] const std::string& get_metadata_file_name() const noexcept { return metadata_file_; }
@@ -131,10 +131,10 @@ class Stream : public std::enable_shared_from_this<Stream> {
131131

132132
/// @brief Helper function to obtain the number of actors connected to Stream in Mode::Publish.
133133
/// @return The number of publishers for that Stream.
134-
[[nodiscard]] size_t get_num_publishers() const noexcept { return engine_->get_publishers().count(); }
134+
[[nodiscard]] size_t get_num_publishers() const { return engine_->get_publishers().count(); }
135135
/// @brief Helper function to obtain the number of actors connected to Stream in Mode::Subscribe.
136136
/// @return The number of subscribers for that Stream.
137-
[[nodiscard]] size_t get_num_subscribers() const noexcept { return engine_->get_subscribers().count(); }
137+
[[nodiscard]] size_t get_num_subscribers() const { return engine_->get_subscribers().count(); }
138138

139139
/******* Variable Factory *******/
140140

src/StagingTransport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void StagingTransport::set_publisher_put_requests_mq(const std::string& publishe
2525
publisher_put_requests_mq_[publisher_name] = sg4::MessageQueue::by_name(publisher_name);
2626
}
2727

28-
sg4::MessageQueue* StagingTransport::get_publisher_put_requests_mq(const std::string& publisher_name) const noexcept
28+
sg4::MessageQueue* StagingTransport::get_publisher_put_requests_mq(const std::string& publisher_name) const
2929
{
3030
return publisher_put_requests_mq_.at(publisher_name);
3131
}

src/Stream.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(dtlmod_stream, dtlmod, "DTL logging about Stream
1818

1919
namespace dtlmod {
2020

21-
const char* Stream::get_engine_type_str() const
21+
const char* Stream::get_engine_type_str() const noexcept
2222
{
2323
const std::map<Engine::Type, const char*> EnumStrings{
2424
{Engine::Type::File, "Engine::Type::File"},
@@ -60,7 +60,7 @@ Stream& Stream::set_engine_type(const Engine::Type& engine_type)
6060
return *this;
6161
}
6262

63-
const char* Stream::get_transport_method_str() const
63+
const char* Stream::get_transport_method_str() const noexcept
6464
{
6565
const std::map<Transport::Method, const char*> EnumStrings{
6666
{Transport::Method::File, "Transport::Method::File"},
@@ -104,12 +104,12 @@ Stream& Stream::set_transport_method(const Transport::Method& transport_method)
104104
return *this;
105105
}
106106

107-
Stream& Stream::set_metadata_export()
107+
Stream& Stream::set_metadata_export() noexcept
108108
{
109109
metadata_export_ = true;
110110
return *this;
111111
}
112-
Stream& Stream::unset_metadata_export()
112+
Stream& Stream::unset_metadata_export() noexcept
113113
{
114114
metadata_export_ = false;
115115
return *this;

0 commit comments

Comments
 (0)