00001 #ifndef CPPUNIT_PROTECTORCHAIN_H
00002 #define CPPUNIT_PROTECTORCHAIN_H
00003
00004 #include <cppunit/Protector.h>
00005 #include <deque>
00006
00007 #if CPPUNIT_NEED_DLL_DECL
00008 #pragma warning( push )
00009 #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
00010 #endif
00011
00012
00013 CPPUNIT_NS_BEGIN
00014
00019 class CPPUNIT_API ProtectorChain : public Protector
00020 {
00021 public:
00022 ProtectorChain();
00023
00024 ~ProtectorChain();
00025
00026 void push( Protector *protector );
00027
00028 void pop();
00029
00030 int count() const;
00031
00032 bool protect( const Functor &functor,
00033 const ProtectorContext &context );
00034
00035 private:
00036 class ProtectFunctor;
00037
00038 private:
00039 typedef std::deque<Protector *> Protectors;
00040 Protectors m_protectors;
00041
00042 typedef std::deque<Functor *> Functors;
00043 };
00044
00045
00046 CPPUNIT_NS_END
00047
00048 #if CPPUNIT_NEED_DLL_DECL
00049 #pragma warning( pop )
00050 #endif
00051
00052 #endif // CPPUNIT_PROTECTORCHAIN_H
00053