https://github.com/t2ym/archive-object-oriented-persistent-storage
Archive of My Senior Thesis: "Object-Oriented Persistent Storage for C++" in 1998
https://github.com/t2ym/archive-object-oriented-persistent-storage
Last synced: 6 months ago
JSON representation
Archive of My Senior Thesis: "Object-Oriented Persistent Storage for C++" in 1998
- Host: GitHub
- URL: https://github.com/t2ym/archive-object-oriented-persistent-storage
- Owner: t2ym
- Created: 2016-10-21T05:25:07.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-21T05:51:10.000Z (over 9 years ago)
- Last Synced: 2025-06-22T01:46:20.761Z (about 1 year ago)
- Homepage: https://t2ym.github.io/archive-object-oriented-persistent-storage/
- Size: 301 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [Object-Oriented Persistent Storage for C++](https://t2ym.github.io/archive-object-oriented-persistent-storage/)
## Notes
- Archive of my senior thesis in 1998
- Platform: GNU C/C++ 2.7.2.1 on Linux 2.0.29 (32bit)
- Not working on current platforms
## Sample Code
```cpp
// Declarations
PersistentStorage *ps; // the persistent storage
PersistentPointer pp; // the persistent pointer
PersistentObject *obj; // the reference pointer
pp = ps->allocate(sizeof(PersistentObject)); // Allocate
// Grab and Instantiate
obj = new(pp.grab()) PersistentObject(parameters, ...);
obj->manipulate(parameters, ...); // Manipulate
pp.release(); // Release
obj = 0; // Invalidate the reference pointer
obj = pp.grabReadOnly(); // Read-only-Grab
obj->reference(parameters, ...); // Reference
pp.releaseReadOnly(); // Read-only-Release
obj = 0; // Invalidate the reference pointer
obj = pp.grab(); // Grab
obj->~PersistentObject(); // Destruct
ps->destroy(pp); // Destroy (also Release)
ps->synchronize(); // Synchronize
```