123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- #ifndef BOOST_CONTRACT_VIRTUAL_HPP_
- #define BOOST_CONTRACT_VIRTUAL_HPP_
- #include <boost/contract/core/config.hpp>
- #ifndef BOOST_CONTRACT_NO_CONDITIONS
- #include <boost/contract/detail/decl.hpp>
- #endif
- #ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
- #include <boost/any.hpp>
- #endif
- #ifndef BOOST_CONTRACT_NO_OLDS
- #include <boost/shared_ptr.hpp>
- #include <queue>
- #endif
- namespace boost { namespace contract {
-
- #ifndef BOOST_CONTRACT_NO_CONDITIONS
- namespace detail {
- BOOST_CONTRACT_DETAIL_DECL_DETAIL_COND_SUBCONTRACTING_Z(1,
- 0, OO, RR, FF, CC, AArgs);
- }
- #endif
- class virtual_ {
- private:
-
- virtual_(virtual_&);
- virtual_& operator=(virtual_&);
- #ifndef BOOST_CONTRACT_NO_CONDITIONS
- enum action_enum {
-
- no_action,
- #ifndef BOOST_CONTRACT_NO_ENTRY_INVARIANTS
- check_entry_inv,
- #endif
- #ifndef BOOST_CONTRACT_NO_PRECONDITIONS
- check_pre,
- #endif
- #ifndef BOOST_CONTRACT_NO_EXIT_INVARIANTS
- check_exit_inv,
- #endif
- #ifndef BOOST_CONTRACT_NO_OLDS
-
- push_old_init_copy,
-
-
- call_old_ftor,
- push_old_ftor_copy,
- pop_old_ftor_copy,
- #endif
- #ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
- check_post,
- #endif
- #ifndef BOOST_CONTRACT_NO_EXCEPTS
- check_except,
- #endif
- };
- #endif
- #ifndef BOOST_CONTRACT_NO_OLDS
-
- inline static bool pop_old_init_copy(action_enum a) {
- return
- #ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
- a == check_post
- #endif
- #if !defined(BOOST_CONTRACT_NO_POSTCONDITIONS) && \
- !defined(BOOST_CONTRACT_NO_EXCEPTS)
- ||
- #endif
- #ifndef BOOST_CONTRACT_NO_EXCEPTS
- a == check_except
- #endif
- ;
- }
- #endif
- #ifndef BOOST_CONTRACT_NO_CONDITIONS
- explicit virtual_(action_enum a) :
- action_(a)
- , failed_(false)
- #ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
- , result_type_name_()
- , result_optional_()
- #endif
- {}
- #endif
- #ifndef BOOST_CONTRACT_NO_CONDITIONS
- action_enum action_;
- bool failed_;
- #endif
- #ifndef BOOST_CONTRACT_NO_OLDS
- std::queue<boost::shared_ptr<void> > old_init_copies_;
- std::queue<boost::shared_ptr<void> > old_ftor_copies_;
- #endif
- #ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
- boost::any result_ptr_;
- char const* result_type_name_;
- bool result_optional_;
- #endif
-
- #ifndef BOOST_CONTRACT_NO_OLDS
- friend bool copy_old(virtual_*);
- friend class old_pointer;
- #endif
- #ifndef BOOST_CONTRACT_NO_CONDITIONS
- BOOST_CONTRACT_DETAIL_DECL_DETAIL_COND_SUBCONTRACTING_Z(1,
- 1, OO, RR, FF, CC, AArgs);
- #endif
- };
- } }
- #endif
|