source:
src/lib/util/state/proxy.cc@
f27baf
| Last change on this file since f27baf was 5d30c1, checked in by , 13 years ago | |
|---|---|
|
|
| File size: 1005 bytes | |
| Rev | Line | |
|---|---|---|
| [5d30c1] | 1 | |
| 2 | #ifdef __GNUG__ | |
| 3 | #pragma implementation | |
| 4 | #endif | |
| 5 | ||
| 6 | #include <util/state/state_bin.h> | |
| 7 | #include <util/state/proxy.h> | |
| 8 | #include <util/keyval/keyval.h> | |
| 9 | ||
| 10 | using namespace sc; | |
| 11 | ||
| 12 | static ClassDesc SavableStateProxy_cd( | |
| 13 | typeid(SavableStateProxy), | |
| 14 | "SavableStateProxy",1,"public DescribedClassProxy", | |
| 15 | 0,create<SavableStateProxy>); | |
| 16 | ||
| 17 | SavableStateProxy::SavableStateProxy(const Ref<KeyVal> &keyval) | |
| 18 | { | |
| 19 | Ref<StateIn> statein; statein << keyval->describedclassvalue("statein"); | |
| 20 | if (statein.nonnull()) { | |
| 21 | char *objectname = keyval->pcharvalue("object"); | |
| 22 | StateIn &si = *(statein.pointer()); | |
| 23 | if (keyval->exists("override")) { | |
| 24 | si.set_override(new PrefixKeyVal(keyval,"override")); | |
| 25 | } | |
| 26 | if (objectname) { | |
| 27 | object_ = SavableState::dir_restore_state(si, objectname); | |
| 28 | delete[] objectname; | |
| 29 | } | |
| 30 | else { | |
| 31 | object_= SavableState::restore_state(si); | |
| 32 | } | |
| 33 | } | |
| 34 | } | |
| 35 | ||
| 36 | Ref<DescribedClass> | |
| 37 | SavableStateProxy::object() | |
| 38 | { | |
| 39 | return object_.pointer(); | |
| 40 | } | |
| 41 |
Note:
See TracBrowser
for help on using the repository browser.
