/* Marcus Daniels Feb. 16, 2000 Also, another new feature is used in the example below. In 2.0.1 and before, it was necessary to have put{Shallow,Deep}:object: calls coordinated by an updateArchiver: method. That is no longer necessary for either Archiver. Now put{Shallow,Deep}:object: can be considered immediate. In the HDF5 case, the object will be saved right then, and in the Lisp case the object will be saved to an in-memory serialized snapshot (which is finally written by the call to `sync'). */ #import // initSwarmBatch #import // CreateDrop @interface Agent: CreateDrop { BOOL activeFlag; } - (BOOL)getActiveFlag; @end @implementation Agent + createBegin: aZone { Agent *obj = [super createBegin: aZone]; obj->activeFlag = YES; return obj; } - (BOOL)getActiveFlag { return activeFlag; } @end int main (int argc, const char **argv) { initSwarmBatch (argc, argv); { id agent; if ((agent = [lispAppArchiver getObject: "agent"])) printf ("activeFlag: %s\n", [agent getActiveFlag] ? "yes" : "no"); else { agent = [Agent create: globalZone]; [lispAppArchiver putDeep: "agent" object: agent]; [lispAppArchiver sync]; } } return 0; } /* Local Variables: compile-command: "$SWARMHOME/bin/libtool-swarm --mode=link gcc -DAPPNAME=archiveBoolean -o archiveBoolean -Wall -Werror -g -Wno-import -I$SWARMHOME/include/swarm -L$SWARMHOME/lib/swarm archiveBoolean.m -lswarm -lobjc" End: */