OOFILE  1.9
Public Member Functions | Protected Attributes | List of all members
OOF_recordCacheCopier Class Reference

Used by OOF_simpleRecordBackend::saveRecord to save single cache item. More...

#include <oofrecs.h>

Inheritance diagram for OOF_recordCacheCopier:
Inheritance graph
[legend]
Collaboration diagram for OOF_recordCacheCopier:
Collaboration graph
[legend]

Public Member Functions

 OOF_recordCacheCopier (oofBroadcaster *listensTo, OOF_recordCache *adoptsCache, OOF_simpleRecordBackend *inBackend, OOF_recordBufferedContext *)
 
virtual bool receiveMsg (OOFmsgT msg, unsigned long senderDefined)
 The default receiveMsg behaviour is to delete yourself when the broadcaster closes. More...
 
void resumeListening ()
 
virtual void subscribeTo (oofBroadcaster *)
 
void suspendListening ()
 
virtual void unsubscribe (oofBroadcaster *from=0)
 
virtual ~OOF_recordCacheCopier ()
 

Protected Attributes

OOF_simpleRecordBackendmBackend
 
OOF_recordCachemCache
 
oofBroadcastermListensTo
 
OOF_recordBufferedContextmSavedContext
 
unsigned short mSuspendCount
 
oofBroadcastermSuspendedListensTo
 

Detailed Description

Used by OOF_simpleRecordBackend::saveRecord to save single cache item.

Provides delay - responds to OOFmsg_SaveRecord after all the other listeners such as dbRelRefBase::receiveMsg.

Self-deleting in OOF_recordCacheCopier::receiveMsg.

Definition at line 677 of file oofrecs.h.

Constructor & Destructor Documentation

OOF_recordCacheCopier::OOF_recordCacheCopier ( oofBroadcaster listensTo,
OOF_recordCache adoptsCache,
OOF_simpleRecordBackend inBackend,
OOF_recordBufferedContext savedContext 
)

Definition at line 1430 of file oofrec1.cpp.

OOF_recordCacheCopier::~OOF_recordCacheCopier ( )
virtual

Definition at line 1439 of file oofrec1.cpp.

References mCache.

Member Function Documentation

bool OOF_recordCacheCopier::receiveMsg ( OOFmsgT  msg,
unsigned long  senderDefined 
)
virtual

The default receiveMsg behaviour is to delete yourself when the broadcaster closes.

In many user subclasses oofSingleListener is a mixin and you have a class owned elsewhere, not self-deleting.

\warning If a subclass is not self-deleting it MUST override receiveMsg 
handling of the msg OOFmsg_BroadcasterClosing to prevent runtime error.

However it is still important to set mListensTo=0 otherwise when you finally get around to deleting your oofSingleListener, it will try to update a deleted oofBroadcaster and cause a crash.

Reimplemented from oofSingleListener.

Definition at line 1450 of file oofrec1.cpp.

References OOFmsg_BroadcasterClosing, and OOFmsg_SaveRecord.

void oofSingleListener::resumeListening ( )
inherited
void oofSingleListener::subscribeTo ( oofBroadcaster broad)
virtualinherited
void oofSingleListener::suspendListening ( )
inherited
void oofSingleListener::unsubscribe ( oofBroadcaster from = 0)
virtualinherited

Member Data Documentation

OOF_simpleRecordBackend* OOF_recordCacheCopier::mBackend
protected

Definition at line 687 of file oofrecs.h.

OOF_recordCache* OOF_recordCacheCopier::mCache
protected

Definition at line 686 of file oofrecs.h.

Referenced by ~OOF_recordCacheCopier().

oofBroadcaster* oofSingleListener::mListensTo
protectedinherited
OOF_recordBufferedContext* OOF_recordCacheCopier::mSavedContext
protected

Definition at line 688 of file oofrecs.h.

unsigned short oofSingleListener::mSuspendCount
protectedinherited
oofBroadcaster* oofSingleListener::mSuspendedListensTo
protectedinherited

The documentation for this class was generated from the following files: