reSIProcate/DialogUsageManager  9694
TargetCommand.hxx
Go to the documentation of this file.
00001 #if !defined(RESIP_TARGETCOMMAND_HXX)
00002 #define RESIP_TARGETCOMMAND_HXX
00003 
00004 #include <memory>
00005 #include "resip/dum/DumCommand.hxx"
00006 
00007 namespace resip
00008 {
00009 
00010 class DialogUsageManager;
00011 
00012 class TargetCommand : public DumCommand
00013 {
00014    public:
00015       class Target
00016       {
00017          public:
00018             Target(DialogUsageManager& dum) : mDum(dum) 
00019             {
00020             }
00021             virtual ~Target()=0;
00022             virtual void post(std::auto_ptr<Message>)=0;
00023 
00024          protected:
00025             DialogUsageManager& mDum;
00026       };
00027 
00028       TargetCommand(Target& target, std::auto_ptr<Message> message);
00029       TargetCommand(const TargetCommand&);
00030       void executeCommand();
00031 
00032 
00033       Message* clone() const;
00034       EncodeStream& encode(EncodeStream& strm) const;
00035       EncodeStream& encodeBrief(EncodeStream& strm) const;
00036       
00037    private:
00038       Target& mTarget;
00039       mutable std::auto_ptr<Message> mMessage;
00040 };
00041 
00042 }
00043 
00044 #endif