ProtectorChain.h 1006 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef CPPUNIT_PROTECTORCHAIN_H
  2. #define CPPUNIT_PROTECTORCHAIN_H
  3. #include <cppunit/Protector.h>
  4. #include <cppunit/portability/CppUnitDeque.h>
  5. #if CPPUNIT_NEED_DLL_DECL
  6. #pragma warning( push )
  7. #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
  8. #endif
  9. CPPUNIT_NS_BEGIN
  10. /*! \brief Protector chain (Implementation).
  11. * Implementation detail.
  12. * \internal Protector that protect a Functor using a chain of nested Protector.
  13. */
  14. class CPPUNIT_API ProtectorChain : public Protector
  15. {
  16. public:
  17. ~ProtectorChain();
  18. void push( Protector *protector );
  19. void pop();
  20. int count() const;
  21. bool protect( const Functor &functor,
  22. const ProtectorContext &context );
  23. private:
  24. class ProtectFunctor;
  25. private:
  26. typedef CppUnitDeque<Protector *> Protectors;
  27. Protectors m_protectors;
  28. typedef CppUnitDeque<Functor *> Functors;
  29. };
  30. CPPUNIT_NS_END
  31. #if CPPUNIT_NEED_DLL_DECL
  32. #pragma warning( pop )
  33. #endif
  34. #endif // CPPUNIT_PROTECTORCHAIN_H