-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Smart pointer constructors for Secure Session (#378)
* Smart pointer constructors for Secure Session Using legacy C++03 interface of Secure Session may be a bit hard with modern practices introduced by C++11. Let's provide a more idiomatic interface where Secure Session assumes ownership over the provided instance of "secure_session_callback_interface_t" via smart pointers. We do so using the shared_ptr instance. This allows both shared and unique ownership over the provided callback interface. For example, if the users need only get_public_key_for_id() interface then they can share an instance of secure_session_callback_interface_t between all Secure Sessions. However, if they need to use the transport interface (send_data/receive_data) then they are likely to provide a unique instance for each Secure Session. We keep the old non-owning constructor for backwards compatibility. However, we mark is deprecated to incite the users to move on to a more safe and idiomatic interface with smart pointers. We still need to test the old interface so silence the relevant warning in this file.
- Loading branch information
Showing
3 changed files
with
96 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters