Age | Commit message (Collapse) | Author |
|
|
|
This commit updates all usages of Network::ErrorResponse to specify at
least method name if not precise reason why operation failed.
|
|
|
|
|
|
Used in SavesSyncRequest to update Storage's last sync date.
|
|
Added ErrorResponse and ErrorCallback. Each Request now has an
ErrorCallback, which should be called instead of usual callback in case
of failure.
|
|
|
|
ConnectionManager now storages Request * (not generates ids for it),
Requests have control on their RequestState, RequestIdPair is now called
Response and storages Request * with some response together.
All related classes are changed to use it in more clean and
understandable way.
Request, RequestState and Response are carefully commented/documented.
|
|
With new ConnectionManager upgrade Requests indicate that they are
finished with RequestInfo.state. No need to use handle() return value
anymore.
|
|
Can be used with Callback<T> (means it's still type safe). It's used to
pass not only Request id to user's callback, but also a value user
wanted.
void *data field is removed from RequestInfo.
|
|
ConnectionManager upgrade: it now contains a special struct for each
request, so you can access request status and data by request id.
|
|
(Upgrading ConnectionManager step by step.)
|
|
It now contains not a pointer to a function, but an actual pointer,
which must be freed.
|
|
Cleaned up all example code and old callbacks.
New Callback classes are introduced in "common/callback.h" and
documented.
|
|
This commit also adds GlobalFunctionCallback, because it was needed in
order to replace plain C pointers to functions (which were used in
Request) into our object-oriented BaseCallback pointers.
|
|
These callbacks can call object's methods, not some global C functions.
DropboxStorage::info2() and DropboxStorage::infoMethodCallback()
demonstrate the idea.
|
|
Originally, I intended to add Storage API, StorageFile and StorageInfo
stubs. When I tried to implement a simple info() call, I ended up fixing
Request to contain some pointer field and all callbacks to have Request*
parameter. And, now I have to place callback pointer into Request. which
calls another callback.
And, eventually, these "simple" callbacks would again require another
pointer (to some caller class).
|
|
With ConnectionManager singleton one can start their Requests without
creating Storage instance. Moreover, Storage instance should contain
cloud API, not Requests-related handling and timer starting methods.
Thus, these methods were moved into ConnectionManager itself.
|