reSIProcate/DialogUsageManager  9680
DumFeature.hxx
Go to the documentation of this file.
00001 #ifndef RESIP_DumFeature_HXX
00002 #define RESIP_DumFeature_HXX 
00003 
00004 #include <memory>
00005 #include "resip/dum/TargetCommand.hxx"
00006 
00007 namespace resip
00008 {
00009 
00010 class DialogUsageManager;
00011 class Message;
00012 
00013 class DumFeature
00014 {
00015    public:      
00016       DumFeature(DialogUsageManager& dum, TargetCommand::Target& target);
00017       virtual ~DumFeature();
00018       
00019       enum ProcessingResultMask
00020       {
00021          EventDoneBit = 1 << 0,
00022          EventTakenBit = 1 << 1,
00023          FeatureDoneBit = 1 << 2,
00024          ChainDoneBit = 1 << 3
00025       };                              
00026 
00027       //legal combinations
00028       enum ProcessingResult
00029       {
00030          EventTaken = EventTakenBit,
00031          FeatureDone = FeatureDoneBit,
00032          FeatureDoneAndEventDone = FeatureDoneBit | EventDoneBit,
00033          FeatureDoneAndEventTaken = FeatureDoneBit | EventTakenBit,
00034          ChainDoneAndEventDone = ChainDoneBit | EventDoneBit,
00035          ChainDoneAndEventTaken = ChainDoneBit | EventTakenBit
00036       };
00037       
00038       // !bwc! We absolutely, positively, MUST NOT throw here. This is because 
00039       // in DialogUsageManager::process(), we do not know if a DumFeature has 
00040       // taken ownership of msg until we get a return. If we throw, the 
00041       // ownership of msg is unknown. This is unacceptable.
00042       virtual ProcessingResult process(Message* msg) = 0;
00043       virtual void postCommand(std::auto_ptr<Message> message);
00044 
00045    protected:
00046       DialogUsageManager& mDum;
00047       TargetCommand::Target& mTarget;
00048 };
00049  
00050 }
00051 
00052 #endif