|
mimic++ v9.2.1
|
A watcher type, which reports it's move-constructor and -assignment calls. More...
#include <ObjectWatcher.hpp>
Public Member Functions | |
| ~RelocationWatcher ()=default | |
| Defaulted destructor. | |
| RelocationWatcher ()=default | |
| Defaulted default constructor. | |
| template<typename Base> | |
| RelocationWatcher (const for_base_tag< Base >) | |
| RelocationWatcher (const RelocationWatcher &other) | |
| Copy-constructor. | |
| RelocationWatcher & | operator= (const RelocationWatcher &other) |
| Copy-assignment-operator. | |
| RelocationWatcher (RelocationWatcher &&other) noexcept(false) | |
| Move-constructor, which reports a relocation. | |
| RelocationWatcher & | operator= (RelocationWatcher &&other) noexcept(false) |
| Move-assignment-operator, which reports a relocation. | |
| auto | expect_relocate () |
| Begins a relocation-expectation construction. | |
A watcher type, which reports it's move-constructor and -assignment calls.
This watcher is designed to track, whether a move has been performed. During a move, it reports the relocation to the framework, which can be tracked by a previously created relocation-expectation.
This watcher can be freely moved around, but any relocation events must match with a previously created relocation-expectation.
This watcher is copyable, but with very special behaviour.
As this watcher is generally designed to be part of a bigger object, it would be very limiting not supporting copy-operations at all. The question is, how should a copy look like?
In general a copy should be a logical duplicate of its source and the general expectation is: if B is a copy of A, then A == B should yield true.
B is not a copy of A, then A == B has to yield false!This won't be the case for RelocationWatchers, as active relocation-expectations won't be copied over to the target. In general, if a RelocationWatcher is used, we want to be very precise with our move, thus an implicit expectation copy would be against the purpose of this helper. Due to this, each RelocationWatcher will be created as a fresh instance, when copy-construction is used. The same logic also applies to copy-assignment.