#6256 closed enhancement (fixed)
Implement classes to successfully archive complicated object hierarchies
Reported by: | yourpalal | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Kits/Support Kit | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | #5525, #6257, #6314 | |
Platform: | All |
Description
This ticket represents a part of my GSoC 2010 project, and relates directly to #5525. The classes contained in the patch allow for easy implementation of complicated archiving & unarchiving behaviours. Although these classes were created specifically to simplify archiving in the layout API, they should be useful elsewhere as well. These classes and the behaviours they expose have been tested fairly thoroughly.
Attachments (4)
Change History (13)
comment:1 by , 14 years ago
patch: | 0 → 1 |
---|
comment:3 by , 14 years ago
Component: | - General → Kits/Support Kit |
---|---|
Owner: | changed from | to
Type: | bug → enhancement |
Version: | R1/alpha2 → R1/Development |
by , 14 years ago
Attachment: | archivable.patch added |
---|
updated patch with fix for syntax error (oops, thanks luroh).
comment:4 by , 14 years ago
Blocking: | 6257 added |
---|
comment:5 by , 14 years ago
Starting to review. Will probably take a few hours though and I don't know, if I'll have enough time to finish today. Will reply on the gsoc list. I don't want to discourage anyone else from reviewing, but please don't apply before I'm done.
by , 14 years ago
Attachment: | archiving.2.patch added |
---|
Update to provide new template methods, better error handling, fix binary compatibility stuff, cleanup & refactor some code... probably more, also update Layout stuff to use the new methods provided & for a better archiving/unarchiving system.
comment:7 by , 14 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:8 by , 14 years ago
Blocking: | 6314 added |
---|
by , 14 years ago
Attachment: | archiving.3.patch added |
---|
slightly updated patch w/ better names, a little cleaner maybe, a specialization of BUnarchiver::InstantiateObject()
follow-up: 10 comment:9 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Thanks! I applied the patch in hrev37538. I couldn't resist doing a few small modifications:
- In the BUnarchiver class definition I indented the
enum ownership_policy
type to the type column and inserted a blank line before the constructor declaration. - I reorganized the generic BUnarchiver::InstantiateObject() implementation for two reasons:
- While I preferred single-exit style function implementations (using cascaded checks or rechecks) myself several years ago (I don't recall whether I still used it when writing the layout code originally, but at least in the storage kit I did so consequently), I finally had to agree with others that the staggered-early-return style code is more readable, and to some degree even prevents programming mistakes (particularly when also using the RAII-style auto locker/deleter classes). So while not required by our coding style, I wholeheartedly recommend using it.
- Somewhat related to the first point actually, the code relied on the method's BArchivable specialization to set the object return variable to NULL when returning an error (
interim
is deleted). While the specialized implementation does that indeed, from an API design point of view I find it only consequent that a failing function should not be required to do unnecessary things like setting reference parameters to NULL values. I don't really mind that the implementations do, but I don't think the API user should rely on this behavior.
- I changed the first
if
condition inBUnarchiveManager::GetArchivableForToken()
totoken >= fObjectCount
.
comment:10 by , 14 years ago
Replying to bonefish:
Thanks! I applied the patch in hrev37538. I couldn't resist doing a few small modifications:
- In the BUnarchiver class definition I indented the
enum ownership_policy
type to the type column and inserted a blank line before the constructor declaration.- I reorganized the generic BUnarchiver::InstantiateObject() implementation for two reasons:
- While I preferred single-exit style function implementations (using cascaded checks or rechecks) myself several years ago (I don't recall whether I still used it when writing the layout code originally, but at least in the storage kit I did so consequently), I finally had to agree with others that the staggered-early-return style code is more readable, and to some degree even prevents programming mistakes (particularly when also using the RAII-style auto locker/deleter classes). So while not required by our coding style, I wholeheartedly recommend using it.
Sure, I will keep that in mind!
- Somewhat related to the first point actually, the code relied on the method's BArchivable specialization to set the object return variable to NULL when returning an error (
interim
is deleted). While the specialized implementation does that indeed, from an API design point of view I find it only consequent that a failing function should not be required to do unnecessary things like setting reference parameters to NULL values. I don't really mind that the implementations do, but I don't think the API user should rely on this behavior.
sure, that makes sense.
- I changed the first
if
condition inBUnarchiveManager::GetArchivableForToken()
totoken >= fObjectCount
.
Thanks for the review & help!
forgot to set some things... :P