Cross-Platform C++

ot
class MessageFactory  (abstract)

#include "ot/base/MessageFactory.h"

ot::ManagedObject ot::auxil::MessageFactoryImpl ot::auxil::FileMessageFactory Abstract 'interface' class used by OpenTop for locating error and information messages. Whenever the OpenTop classes need to produce an exception, error or information message, they make a call to System::GetSysMessage() which, in turn, calls System::GetMessageFactory() to locate an application-supplied MessageFactory object. An application can supply a MessageFactory by calling System::SetMessageFactory() during initialization.

If a MessageFactory object is returned, the getMessage() method is called to give the factory an opportunity to supply a custom message. If the factory is unable to supply the message text, then the system uses a default value instead.

This interface may be implemented differently by each individual application, however OpenTop comes with an example called FileMessageFactory that reads messages from text files. It is located in the auxil namespace.




Method Summary
 virtual bool getMessage(const String& org, const String& app, size_t messageID, String& ret)=0
         Called by OpenTop classes to obtain the text for a message.

Methods inherited from class ot::ManagedObject
addRef, getRefCount, onFinalRelease, operator=, release

Method Detail

getMessage

virtual bool getMessage(const String& org,
                        const String& app,
                        size_t messageID,
                        String& ret)=0
Called by OpenTop classes to obtain the text for a message.

Parameters:
org - the name of the organization that owns the code requesting the message
app - the name of the library or application
messageID - a number that identifies the requested message. This must be unique for the supplied org and app parameters
ret - returned message text
Returns:
true if the requested message text was returned; false otherwise


Cross-Platform C++

Found a bug or missing feature? Please email us at support@elcel.com

Copyright © 2000-2003 ElCel Technology   Trademark Acknowledgements