1 #ifndef ZGDatabasePeerSession_h
2 #define ZGDatabasePeerSession_h
45 virtual ConstMessageRef
SeniorUpdateLocalDatabase(uint32 whichDatabase, uint32 & dbChecksum,
const ConstMessageRef & seniorDoMsg);
46 virtual status_t
JuniorUpdateLocalDatabase(uint32 whichDatabase, uint32 & dbChecksum,
const ConstMessageRef & juniorDoMsg);
53 Queue<IDatabaseObjectRef> _databaseObjects;
This immutable class holds various read-only settings that will be used to define the peer's behavior...
const IDatabaseObject * GetDatabaseObject(uint32 whichDatabase) const
Convenience method: Returns a read-only pointer to the specified IDatabaseObject that we hold...
An interface for an object that represents the full contents of a ZG database.
virtual status_t SetLocalDatabaseFromMessage(uint32 whichDatabase, uint32 &dbChecksum, const ConstMessageRef &newDBStateMsg)
This method should be implemented to replace the current state of the specified local database with t...
virtual ConstMessageRef SeniorUpdateLocalDatabase(uint32 whichDatabase, uint32 &dbChecksum, const ConstMessageRef &seniorDoMsg)
This method will only be called on the senior peer.
virtual uint32 CalculateLocalDatabaseChecksum(uint32 whichDatabase) const
This method is used for sanity-checking.
virtual void ResetLocalDatabaseToDefault(uint32 whichDatabase, uint32 &dbChecksum)
Must be implemented to reset local state of the specified database to its well-known default state...
ZGDatabasePeerSession(const ZGPeerSettings &peerSettings)
Constructor.
This is a convenience class; it is the same as a ZGPeerSession except that it also knows how to creat...
virtual IDatabaseObjectRef CreateDatabaseObject(uint32 whichDatabase)=0
This will be called as part of the startup sequence.
The zg namespace contains the public API of the ZG library.
virtual status_t AttachedToServer()
Overridden to create and set up our IDatabaseObjects.
virtual status_t JuniorUpdateLocalDatabase(uint32 whichDatabase, uint32 &dbChecksum, const ConstMessageRef &juniorDoMsg)
This method will only be called on junior peers.
virtual MessageRef SaveLocalDatabaseToMessage(uint32 whichDatabase) const
This method should be implemented to save the state of the specified local database into a Message...
virtual String GetLocalDatabaseContentsAsString(uint32 whichDatabase) const
This method may be implemented to return a human-readable representation of the specified database's ...
This is the class that a user program would typically subclass from and add to a ReflectServer in ord...
IDatabaseObject * GetDatabaseObject(uint32 whichDatabase)
Convenience method: Returns a read/write pointer to the specified IDatabaseObject that we hold...