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

Utility class establishing copy dependency between fields. More...

#include <oof3.h>

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

Public Member Functions

 dbFieldCopier (oofBroadcaster *listensTo, unsigned short copyOnMessage, dbField *copyFrom, dbField *copyTo)
 
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 ~dbFieldCopier ()
 

Protected Attributes

dbFieldmCopyFrom
 
OOFmsgT mCopyOnMessage
 
dbFieldmCopyTo
 
oofBroadcastermListensTo
 
unsigned short mSuspendCount
 
oofBroadcastermSuspendedListensTo
 

Detailed Description

Utility class establishing copy dependency between fields.

Not used much at present. May be vulnerable to cloning of dbFields so the field you specified and think is being updated is not the one connected to a GUI.

Definition at line 619 of file oof3.h.

Constructor & Destructor Documentation

dbFieldCopier::dbFieldCopier ( oofBroadcaster listensTo,
unsigned short  copyOnMessage,
dbField copyFrom,
dbField copyTo 
)

Definition at line 2566 of file oof3.cpp.

dbFieldCopier::~dbFieldCopier ( )
virtual

Definition at line 2574 of file oof3.cpp.

References mCopyFrom, and mCopyTo.

Member Function Documentation

bool dbFieldCopier::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 2581 of file oof3.cpp.

References dbField::copyValueFrom(), mCopyFrom, mCopyOnMessage, mCopyTo, and oofSingleListener::receiveMsg().

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

Member Data Documentation

dbField* dbFieldCopier::mCopyFrom
protected

Definition at line 628 of file oof3.h.

Referenced by receiveMsg(), and ~dbFieldCopier().

OOFmsgT dbFieldCopier::mCopyOnMessage
protected

Definition at line 629 of file oof3.h.

Referenced by receiveMsg().

dbField * dbFieldCopier::mCopyTo
protected

Definition at line 628 of file oof3.h.

Referenced by receiveMsg(), and ~dbFieldCopier().

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

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