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

listener for an MN link that adds and deletes records. More...

#include <oof1.h>

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

Public Member Functions

 dbRelMaintainer (dbRelRefBase *relToRHS, OOF_RelMN *linkWeAlert)
 
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 ~dbRelMaintainer ()
 

Protected Attributes

oofBroadcastermListensTo
 
unsigned short mSuspendCount
 
oofBroadcastermSuspendedListensTo
 

Detailed Description

listener for an MN link that adds and deletes records.

Acts in response to OOF_AppendSelection, RemoveSelection, ClearSelection and is often used in GUI applications where the user can create M:N links between tables, eg: by drag and drop to indicate an association.

Definition at line 1456 of file oof1.h.

Constructor & Destructor Documentation

dbRelMaintainer::dbRelMaintainer ( dbRelRefBase relToRHS,
OOF_RelMN linkWeAlert 
)

Definition at line 1335 of file oofrel.cpp.

dbRelMaintainer::~dbRelMaintainer ( )
virtual

Definition at line 1342 of file oofrel.cpp.

Member Function Documentation

bool dbRelMaintainer::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 1348 of file oofrel.cpp.

References OOF_RelMN::appendSelection(), OOF_RelMN::clearSelection(), OOFmsg_AppendSelection, OOFmsg_ClearSelection, OOFmsg_RemoveSelection, oofSingleListener::receiveMsg(), and OOF_RelMN::removeSelection().

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

Member Data Documentation

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

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