ROSE 0.11.145.192
|
Constraints are used to select addresses from a memory map.
Users don't normally see this class since it's almost always created as a temporary. In fact, most of the public methods in this class are also present in the AddressMap class, and that's where they're documented.
The purpose of this class is to curry the arguments that would otherwise need to be passed to the various map I/O methods and which would significantly complicate the API since many of these arguments are optional.
Definition at line 76 of file AddressMap.h.
#include <Sawyer/AddressMap.h>
Public Types | |
typedef AddressMap::Address | Address |
typedef AddressMap::Value | Value |
typedef Sawyer::Container::Interval< Address > | AddressInterval |
Public Member Functions | |
AddressMapConstraints (AddressMap *map) | |
Construct a constraint that matches everything. | |
operator AddressMapConstraints< const AddressMap > () const | |
void | print (std::ostream &out) const |
Print constraints in a human readable form. | |
AddressMapConstraints | require (unsigned bits) const |
Require certain access permissions. | |
AddressMapConstraints | prohibit (unsigned bits) const |
Prohibit certain access permissions. | |
AddressMapConstraints | access (unsigned bits) const |
Require and prohibit certain access permissions. | |
AddressMapConstraints | substr (const std::string &s) const |
Require certain segment names. | |
AddressMapConstraints | any () const |
No constraints. | |
AddressMapConstraints | none () const |
Constraints that match nothing. | |
AddressMapConstraints | at (Address x) const |
Anchor at a certain address. | |
AddressMapConstraints | at (const Sawyer::Container::Interval< Address > &x) const |
Anchor at a certain interval. | |
AddressMapConstraints | limit (size_t x) const |
Limit matching length. | |
AddressMapConstraints | atOrAfter (Address least) const |
Limit addresses. | |
AddressMapConstraints | atOrBefore (Address greatest) const |
Limit addresses. | |
AddressMapConstraints | within (const Sawyer::Container::Interval< Address > &x) const |
Limit addresses. | |
AddressMapConstraints | within (Address lo, Address hi) const |
Limit addresses. | |
AddressMapConstraints | baseSize (Address base, Address size) const |
Limit addresses. | |
AddressMapConstraints | after (Address x) const |
Limit addresses. | |
AddressMapConstraints | before (Address x) const |
Limit addreses. | |
AddressMapConstraints | singleSegment () const |
Limit matching to single segment. | |
AddressMapConstraints | segmentPredicate (SegmentPredicate< Address, Value > *p) const |
Limit segments. | |
AddressMapConstraints | segmentPredicates (const Callbacks< SegmentPredicate< Address, Value > * > &predicates) const |
unsigned | required () const |
Accessibility bits that are required to be set. | |
unsigned | prohibited () const |
Accessibility bits that are required to be clear. | |
const std::string & | substr () const |
Section name substring. | |
bool | neverMatches () const |
Returns true if the constraint is not allowed to match anything. | |
bool | isAnchored () const |
Determines whether constraints are anchored to an address. | |
AddressInterval | anchored () const |
Returns the anchor points. | |
size_t | limit () const |
Size limit. | |
const Optional< Address > & | least () const |
Least possible address. | |
const Optional< Address > & | greatest () const |
Greatest possible address. | |
bool | isSingleSegment () const |
Returns true if the single-segment constraint is set. | |
const Callbacks< SegmentPredicate< Address, Value > * > | segmentPredicates () const |
Returns the segment predicates. | |
AddressMap * | map () const |
Returns a pointer to the memory map for this constraint object. | |
bool | hasNonAddressConstraints () const |
Determines whether non-address constraints are present. | |
AddressMapConstraints | addressConstraints () const |
Construct new constraints from existing address constraints. | |
boost::iterator_range< typename AddressMapTraits< AddressMap >::NodeIterator > | nodes (MatchFlags flags=0) const |
boost::iterator_range< typename AddressMapTraits< AddressMap >::SegmentIterator > | segments (MatchFlags flags=0) const |
Optional< typename AddressMap::Address > | next (MatchFlags flags=0) const |
Sawyer::Container::Interval< Address > | available (MatchFlags flags=0) const |
bool | exists (MatchFlags flags=0) const |
AddressMapTraits< AddressMap >::NodeIterator | findNode (MatchFlags flags=0) const |
template<typename Functor > | |
void | traverse (Functor &functor, MatchFlags flags=0) const |
void | traverse (typename AddressMap::Visitor &visitor, MatchFlags flags=0) const |
Sawyer::Container::Interval< Address > | read (typename AddressMap::Value *buf, MatchFlags flags=0) const |
Sawyer::Container::Interval< Address > | read (std::vector< typename AddressMap::Value > &buf, MatchFlags flags=0) const |
Sawyer::Container::Interval< Address > | write (const typename AddressMap::Value *buf, MatchFlags flags=0) const |
Sawyer::Container::Interval< Address > | write (const std::vector< typename AddressMap::Value > &buf, MatchFlags flags=0) |
void | prune (MatchFlags flags=0) const |
void | keep (MatchFlags flags=0) const |
void | changeAccess (unsigned requiredAccess, unsigned prohibitedAccess, MatchFlags flags=0) const |
typedef AddressMap::Address Sawyer::Container::AddressMapConstraints< AddressMap >::Address |
Definition at line 78 of file AddressMap.h.
typedef AddressMap::Value Sawyer::Container::AddressMapConstraints< AddressMap >::Value |
Definition at line 79 of file AddressMap.h.
typedef Sawyer::Container::Interval<Address> Sawyer::Container::AddressMapConstraints< AddressMap >::AddressInterval |
Definition at line 80 of file AddressMap.h.
|
inline |
Construct a constraint that matches everything.
Definition at line 97 of file AddressMap.h.
|
inline |
Definition at line 129 of file AddressMap.h.
|
inline |
Print constraints in a human readable form.
Definition at line 156 of file AddressMap.h.
References Sawyer::Container::BitVector::fromInteger(), Sawyer::Container::Interval< T >::greatest(), Sawyer::Container::Interval< T >::isEmpty(), Sawyer::Container::Interval< T >::least(), Sawyer::Container::AddressMapConstraints< AddressMap >::map(), and Sawyer::Container::BitVector::toHex().
|
inline |
Require certain access permissions.
See AddressMap::require.
Definition at line 239 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::map().
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::access(), Sawyer::Container::AddressMap< A, T >::require(), and Sawyer::Container::AddressMap< A, T >::require().
|
inline |
Prohibit certain access permissions.
See AddressMap::prohibit.
Definition at line 246 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::map().
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::access(), Sawyer::Container::AddressMap< A, T >::prohibit(), Sawyer::Container::AddressMap< A, T >::prohibit(), and Sawyer::Container::AddressMap< A, T >::write().
|
inline |
Require and prohibit certain access permissions.
See AddressMap::access.
Definition at line 253 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::prohibit(), and Sawyer::Container::AddressMapConstraints< AddressMap >::require().
Referenced by Sawyer::Container::AddressMap< A, T >::access(), and Sawyer::Container::AddressMap< A, T >::access().
|
inline |
Require certain segment names.
See AddressMap::substr.
Definition at line 258 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::map().
Referenced by Sawyer::Container::AddressMap< A, T >::substr(), and Sawyer::Container::AddressMap< A, T >::substr().
|
inline |
|
inline |
Constraints that match nothing.
See AddressMap::none.
Definition at line 271 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::map().
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::after(), Sawyer::Container::AddressMapConstraints< AddressMap >::baseSize(), Sawyer::Container::AddressMapConstraints< AddressMap >::before(), Sawyer::Container::AddressMap< A, T >::none(), Sawyer::Container::AddressMap< A, T >::none(), Sawyer::Container::AddressMapConstraints< AddressMap >::segmentPredicate(), Sawyer::Container::AddressMapConstraints< AddressMap >::within(), and Sawyer::Container::AddressMapConstraints< AddressMap >::within().
|
inline |
Anchor at a certain address.
See AddressMap::at.
Definition at line 278 of file AddressMap.h.
References Sawyer::Container::IntervalMap< I, T, Policy >::isEmpty(), Sawyer::Container::AddressMapConstraints< AddressMap >::map(), and Sawyer::Container::AddressMap< A, T >::none().
Referenced by Sawyer::Container::AddressMap< A, T >::at(), Sawyer::Container::AddressMap< A, T >::at(), Sawyer::Container::AddressMap< A, T >::at(), and Sawyer::Container::AddressMap< A, T >::at().
|
inline |
Anchor at a certain interval.
See AddressMap::at.
Definition at line 285 of file AddressMap.h.
References Sawyer::Container::AddressMap< A, T >::atOrAfter(), Sawyer::Container::Interval< T >::greatest(), Sawyer::Container::IntervalMap< I, T, Policy >::isEmpty(), Sawyer::Container::Interval< T >::least(), Sawyer::Container::AddressMapConstraints< AddressMap >::map(), and Sawyer::Container::AddressMap< A, T >::none().
|
inline |
Limit matching length.
See AddressMap::limit.
Definition at line 292 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::map(), and Sawyer::Container::AddressMap< A, T >::none().
Referenced by Sawyer::Container::AddressMap< A, T >::findNode(), Sawyer::Container::AddressMap< A, T >::findNode(), Sawyer::Container::AddressMap< A, T >::limit(), Sawyer::Container::AddressMap< A, T >::limit(), Sawyer::Container::AddressMap< A, T >::next(), Sawyer::Container::AddressMap< A, T >::read(), and Sawyer::Container::AddressMap< A, T >::write().
|
inline |
Limit addresses.
Definition at line 299 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::least(), Sawyer::Container::AddressMapConstraints< AddressMap >::map(), and Sawyer::Container::AddressMap< A, T >::none().
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::after(), Sawyer::Container::AddressMap< A, T >::atOrAfter(), Sawyer::Container::AddressMap< A, T >::atOrAfter(), Sawyer::Container::AddressMapConstraints< AddressMap >::baseSize(), and Sawyer::Container::AddressMapConstraints< AddressMap >::within().
|
inline |
Limit addresses.
Definition at line 312 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::greatest(), Sawyer::Container::AddressMapConstraints< AddressMap >::map(), and Sawyer::Container::AddressMap< A, T >::none().
Referenced by Sawyer::Container::AddressMap< A, T >::atOrBefore(), Sawyer::Container::AddressMap< A, T >::atOrBefore(), Sawyer::Container::AddressMapConstraints< AddressMap >::baseSize(), Sawyer::Container::AddressMapConstraints< AddressMap >::before(), and Sawyer::Container::AddressMapConstraints< AddressMap >::within().
|
inline |
Limit addresses.
See AddressMap::within.
Definition at line 325 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::atOrAfter(), Sawyer::Container::AddressMapConstraints< AddressMap >::atOrBefore(), Sawyer::Container::Interval< T >::greatest(), Sawyer::Container::Interval< T >::isEmpty(), Sawyer::Container::Interval< T >::least(), and Sawyer::Container::AddressMapConstraints< AddressMap >::none().
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::within(), Sawyer::Container::AddressMap< A, T >::within(), Sawyer::Container::AddressMap< A, T >::within(), Sawyer::Container::AddressMap< A, T >::within(), and Sawyer::Container::AddressMap< A, T >::within().
|
inline |
Limit addresses.
See AddressMap::within.
Definition at line 330 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::none(), and Sawyer::Container::AddressMapConstraints< AddressMap >::within().
|
inline |
Limit addresses.
See AddressMap::baseSize.
Definition at line 335 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::atOrAfter(), Sawyer::Container::AddressMapConstraints< AddressMap >::atOrBefore(), and Sawyer::Container::AddressMapConstraints< AddressMap >::none().
Referenced by Sawyer::Container::AddressMap< A, T >::baseSize(), and Sawyer::Container::AddressMap< A, T >::baseSize().
|
inline |
Limit addresses.
See AddressMap::after.
Definition at line 340 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::atOrAfter(), and Sawyer::Container::AddressMapConstraints< AddressMap >::none().
Referenced by Sawyer::Container::AddressMap< A, T >::after(), and Sawyer::Container::AddressMap< A, T >::after().
|
inline |
Limit addreses.
See AddressMap::before.
Definition at line 345 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::atOrBefore(), and Sawyer::Container::AddressMapConstraints< AddressMap >::none().
Referenced by Sawyer::Container::AddressMap< A, T >::before(), and Sawyer::Container::AddressMap< A, T >::before().
|
inline |
Limit matching to single segment.
See AddressMap::singleSegment.
Definition at line 350 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::map().
Referenced by Sawyer::Container::AddressMap< A, T >::singleSegment(), and Sawyer::Container::AddressMap< A, T >::singleSegment().
|
inline |
Limit segments.
See AddressMap::segmentPredicate.
Definition at line 357 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::map(), and Sawyer::Container::AddressMapConstraints< AddressMap >::none().
Referenced by Sawyer::Container::AddressMap< A, T >::segmentPredicate(), and Sawyer::Container::AddressMap< A, T >::segmentPredicate().
|
inline |
Definition at line 365 of file AddressMap.h.
|
inline |
Accessibility bits that are required to be set.
Definition at line 375 of file AddressMap.h.
|
inline |
Accessibility bits that are required to be clear.
Definition at line 380 of file AddressMap.h.
|
inline |
Section name substring.
Returns the string that must be present as a substring in a section name.
Definition at line 385 of file AddressMap.h.
|
inline |
Returns true if the constraint is not allowed to match anything.
This returns true if the none constraint is set, but it doesn't necessarily return true if a combination of other constraints results in something that cannot match.
Definition at line 392 of file AddressMap.h.
|
inline |
Determines whether constraints are anchored to an address.
Definition at line 397 of file AddressMap.h.
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::anchored().
|
inline |
Returns the anchor points.
Returns the anchor points as an interval, where the anchor(s) is an endpoint of the returned interval. For instance, if the at method was called, then anchored will return a singleton interval whose value was the at argument. The return value will be an empty interval if mutually exclusive anchors are set. This method should not be called without first calling isAnchored.
Definition at line 405 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::isAnchored().
|
inline |
Size limit.
Returns the size limit or the maximum possible size_t value if not limit is in effect.
Definition at line 411 of file AddressMap.h.
|
inline |
Least possible address.
Returns the least possible address or nothing. The least address is in effect for the atOrAfter constraint.
Definition at line 417 of file AddressMap.h.
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::atOrAfter().
|
inline |
Greatest possible address.
Returns the greatest possible address or nothing. The greatest address is in effect for the atOrBefore constraint.
Definition at line 423 of file AddressMap.h.
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::atOrBefore().
|
inline |
Returns true if the single-segment constraint is set.
Definition at line 428 of file AddressMap.h.
|
inline |
Returns the segment predicates.
Definition at line 433 of file AddressMap.h.
|
inline |
Returns a pointer to the memory map for this constraint object.
Definition at line 438 of file AddressMap.h.
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::at(), Sawyer::Container::AddressMapConstraints< AddressMap >::at(), Sawyer::Container::AddressMapConstraints< AddressMap >::atOrAfter(), Sawyer::Container::AddressMapConstraints< AddressMap >::atOrBefore(), Sawyer::Container::AddressMapConstraints< AddressMap >::limit(), Sawyer::Container::AddressMapConstraints< AddressMap >::none(), Sawyer::Container::AddressMapConstraints< AddressMap >::print(), Sawyer::Container::AddressMapConstraints< AddressMap >::prohibit(), Sawyer::Container::AddressMapConstraints< AddressMap >::require(), Sawyer::Container::AddressMapConstraints< AddressMap >::segmentPredicate(), Sawyer::Container::AddressMapConstraints< AddressMap >::singleSegment(), and Sawyer::Container::AddressMapConstraints< AddressMap >::substr().
|
inline |
Determines whether non-address constraints are present.
The presence of non-address constraints requires iteration over matching addresses to find applicable regions of the address space.
Definition at line 444 of file AddressMap.h.
|
inline |
Construct new constraints from existing address constraints.
Constructs a new constraints object from an existing but using only the address constraints of the existing object and none of its non-address constraints.
Definition at line 452 of file AddressMap.h.
Referenced by Sawyer::Container::AddressMap< A, T >::changeAccess(), Sawyer::Container::AddressMap< A, T >::keep(), and Sawyer::Container::AddressMap< A, T >::prune().
|
inline |
Definition at line 465 of file AddressMap.h.
|
inline |
Definition at line 470 of file AddressMap.h.
|
inline |
Definition at line 475 of file AddressMap.h.
|
inline |
Definition at line 480 of file AddressMap.h.
|
inline |
Definition at line 485 of file AddressMap.h.
|
inline |
Definition at line 490 of file AddressMap.h.
|
inline |
Definition at line 496 of file AddressMap.h.
|
inline |
Definition at line 500 of file AddressMap.h.
|
inline |
Definition at line 505 of file AddressMap.h.
|
inline |
Definition at line 510 of file AddressMap.h.
|
inline |
Definition at line 516 of file AddressMap.h.
|
inline |
Definition at line 521 of file AddressMap.h.
|
inline |
Definition at line 526 of file AddressMap.h.
|
inline |
Definition at line 531 of file AddressMap.h.
|
inline |
Definition at line 536 of file AddressMap.h.