Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future release features #62

Open
d1vanov opened this issue Apr 19, 2023 · 0 comments
Open

Future release features #62

d1vanov opened this issue Apr 19, 2023 · 0 comments
Assignees

Comments

@d1vanov
Copy link
Owner

d1vanov commented Apr 19, 2023

It's not really an issue but rather the description of features which are already being prepared for some new future release. It's unspecified yet when this release would come out but nevertheless some features are already ready in branch feature/copy-on-write-types. Here are some highlights:

  1. I got rid of custom Optional template class in favour of std::optional from C++17 standard library. It's 2023 now and all major compilers out there support C++17 so there's no reason not to use good things from the updated standard library.
  2. Types from Evernote's data model now implement Qt style copy on write. Previously such types were structs containing only fields but not methods. Now these are classes which provide const and non-const (mutable) getters to the data inside the class as well as setters. The use of non-const getters and setters may cause deep copy of the instance which is otherwise shallow copied around. Most behaviour-less classes in Qt implement the same kind of copy on write so it should feel quite convenient and natural in Qt applications.
  3. I've implemented serialization and deserialization to/from JSON format for types within QEverCloud library. Qt's facilities for JSON handling are used so this feature doesn't involve any additional dependencies. While it might feel like an unnecessary feature in a library such as QEverCloud, it was quite convenient to implement this feature within QEverCloud due to the fact that a large portion of QEverCloud source code is automatically generated via QEverCloudGenerator. JSON serialization/deserialization and unit tests for it are generated automatically as well.
  4. Each type from Evernote's data model in QEverCloud now has a corresponding builder class which is convenient especially for testing purposes if you want to quickly initialize the instance of a type containing particular values of some fields e.g.
auto myValue = MyValueBuilder{}.setField1(value1).setField2(value2).build();

The code supporting these builders was also generated automatically.

The corresponding branch in QEverCloudGenerator repo is also called feature/copy-on-write-types.

@d1vanov d1vanov self-assigned this Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant