llmemberlistener.h

Go to the documentation of this file.
00001 
00058 #ifndef LL_LLMEMBERLISTENER_H
00059 #define LL_LLMEMBERLISTENER_H
00060 
00061 #include "llevent.h"
00062 
00063 template <class T>
00064 class LLMemberListener : public LLSimpleListener
00065 {
00066 public:
00067         LLMemberListener() : mPtr(NULL), mRegisteredName() { }
00068 
00069         void registerListener(T *pointer, const LLString& register_name)
00070         {
00071                 mPtr = pointer;
00072                 mRegisteredName = register_name;
00073                 pointer->registerEventListener(register_name, this);
00074         }
00075 
00076         // This is what you have to override to handle this event
00077         virtual bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) = 0;
00078 
00079 protected:
00080         T *mPtr; // The object that this listener manipulates
00081         LLString mRegisteredName;
00082 };
00083 
00084 
00085 #endif // LL_LLMEMBERLISTENER_H

Generated on Fri May 16 08:32:53 2008 for SecondLife by  doxygen 1.5.5