Skip to content

Commit

Permalink
Session supports move assignment operator (#104)
Browse files Browse the repository at this point in the history
This allows users to create session pool, saving time for creating session every time when execute.
  • Loading branch information
Hacky-DH authored Nov 1, 2022
1 parent dad0939 commit 16632d7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/nebula/client/Session.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ class Session {
session.pool_ = nullptr;
session.offsetSecs_ = 0;
}
void operator=(Session&& session) {
sessionId_ = session.sessionId_;
username_ = std::move(session.username_);
password_ = std::move(session.password_);
timezoneName_ = std::move(session.timezoneName_);
offsetSecs_ = session.offsetSecs_;
session.sessionId_ = -1;
session.pool_ = nullptr;
session.offsetSecs_ = 0;
}
~Session() {
release();
}
Expand Down

0 comments on commit 16632d7

Please sign in to comment.