Skip to content

Commit

Permalink
chanegd arg to const ref
Browse files Browse the repository at this point in the history
Signed-off-by: pietfried <[email protected]>
  • Loading branch information
Pietfried committed Jul 23, 2024
1 parent d999495 commit 67aa756
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/ocpp/v16/charge_point.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class ChargePoint {
/// \return
bool start(const std::map<int, ChargePointStatus>& connector_status_map = {},
BootReasonEnum bootreason = BootReasonEnum::PowerUp,
const std::set<std::string> resuming_session_ids = {});
const std::set<std::string>& resuming_session_ids = {});

/// \brief Restarts the ChargePoint if it has been stopped before. The ChargePoint is reinitialized, connects to the
/// websocket and starts to communicate OCPP messages again
Expand Down
4 changes: 2 additions & 2 deletions include/ocpp/v16/charge_point_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class ChargePointImpl : ocpp::ChargingStationBase {
/// resuming_session_ids contain the internal session_id, this function attempts to resume the transaction by
/// initializing it and adding it to the \ref transaction_handler. If the session_id is not part of \p
/// resuming_session_ids a StopTransaction.req is initiated to properly close the transaction.
void try_resume_transactions(const std::set<std::string> resuming_session_ids);
void try_resume_transactions(const std::set<std::string>& resuming_session_ids);
void stop_all_transactions();
void stop_all_transactions(Reason reason);
bool validate_against_cache_entries(CiString<20> id_tag);
Expand Down Expand Up @@ -392,7 +392,7 @@ class ChargePointImpl : ocpp::ChargingStationBase {
/// it hasnt been stopped yet. Its ignored if this vector contains session_ids that are unknown to libocpp.
/// \return
bool start(const std::map<int, ChargePointStatus>& connector_status_map, BootReasonEnum bootreason,
const std::set<std::string> resuming_session_ids);
const std::set<std::string>& resuming_session_ids);

/// \brief Restarts the ChargePoint if it has been stopped before. The ChargePoint is reinitialized, connects to the
/// websocket and starts to communicate OCPP messages again
Expand Down
2 changes: 1 addition & 1 deletion lib/ocpp/v16/charge_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ChargePoint::ChargePoint(const std::string& config, const fs::path& share_path,
ChargePoint::~ChargePoint() = default;

bool ChargePoint::start(const std::map<int, ChargePointStatus>& connector_status_map, BootReasonEnum bootreason,
const std::set<std::string> resuming_session_ids) {
const std::set<std::string>& resuming_session_ids) {
return this->charge_point->start(connector_status_map, bootreason, resuming_session_ids);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/ocpp/v16/charge_point_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ void ChargePointImpl::update_clock_aligned_meter_values_interval() {
}
}

void ChargePointImpl::try_resume_transactions(const std::set<std::string> resuming_session_ids) {
void ChargePointImpl::try_resume_transactions(const std::set<std::string>& resuming_session_ids) {
std::vector<ocpp::v16::TransactionEntry> transactions;
try {
transactions = this->database_handler->get_transactions(true);
Expand Down Expand Up @@ -864,7 +864,7 @@ void ChargePointImpl::send_meter_value(int32_t connector, MeterValue meter_value
}

bool ChargePointImpl::start(const std::map<int, ChargePointStatus>& connector_status_map, BootReasonEnum bootreason,
const std::set<std::string> resuming_session_ids) {
const std::set<std::string>& resuming_session_ids) {
this->message_queue->start();
this->bootreason = bootreason;
this->init_state_machine(connector_status_map);
Expand Down

0 comments on commit 67aa756

Please sign in to comment.