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
4 changes: 2 additions & 2 deletions libs/elevator/include/elevator/elevator_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ElevatorState {
uint64_t Version() const;
common::BoolTable Requests() const;
common::Inertia Inertia() const;
bool Valid() const;
[[nodiscard]] bool Valid() const;

// Setters
void SetId(int id);
Expand All @@ -45,7 +45,7 @@ class ElevatorState {
void OnUpdate(const ElevatorState& state);
void IncrementVersion() { version_++; }
void OnWatchdogTimeout();
bool Usable() const;
[[nodiscard]] bool Usable() const;

private:
int id_{-1};
Expand Down
6 changes: 3 additions & 3 deletions libs/network/include/network/udp_bcast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class NetworkPacket {
elev::ordersync::CabOrderTable* cab_button_orders);

int Id() const { return id_; }
bool Valid() const;
[[nodiscard]] bool Valid() const;
elev::ordersync::OrderTable* Orders() { return &orders_; }
const elev::ordersync::OrderTable* Orders() const { return &orders_; }
elev::elevator::ElevatorState* State() { return &state_; }
Expand All @@ -39,7 +39,7 @@ class UdpBroadcaster {
UdpBroadcaster(uint16_t port, const std::string& bcast_ip);
~UdpBroadcaster();

bool SendPacket(NetworkPacket* packet);
[[nodiscard]] bool SendPacket(NetworkPacket* packet);

private:
int socket_fd_{-1};
Expand All @@ -52,7 +52,7 @@ class UdpReciever {
~UdpReciever();

void Close();
bool RecievePacket(NetworkPacket* packet);
[[nodiscard]] bool RecievePacket(NetworkPacket* packet);

private:
int socket_fd_{-1};
Expand Down
6 changes: 3 additions & 3 deletions libs/ordersync/include/ordersync/ordersync.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class Order {
OrderStatus Status() const { return status_; }
int AssignedId() const { return assigned_id_; }
uint32_t ObservedMask() const { return observed_mask_; }
bool ObservedBy(int elev_id) const;
bool Valid() const;
[[nodiscard]] bool ObservedBy(int elev_id) const;
[[nodiscard]] bool Valid() const;

// State machine
void OnUpdate(const Order& rcv);
Expand Down Expand Up @@ -55,7 +55,7 @@ class OrderTable {
ordersync::Order* Order(int floor, int btn);
const ordersync::Order* Order(int floor, int btn) const;
BoolTable ToBoolTable(int elev_id) const;
bool Valid() const;
[[nodiscard]] bool Valid() const;

private:
std::array<std::array<ordersync::Order, kButtons>, kFloors> table_{};
Expand Down
Loading