ROSE
0.11.96.11
|
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 80 of file AddressMap.h.
#include <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. More... | |
AddressMapConstraints | prohibit (unsigned bits) const |
Prohibit certain access permissions. More... | |
AddressMapConstraints | access (unsigned bits) const |
Require and prohibit certain access permissions. More... | |
AddressMapConstraints | substr (const std::string &s) const |
Require certain segment names. More... | |
AddressMapConstraints | any () const |
No constraints. More... | |
AddressMapConstraints | none () const |
Constraints that match nothing. More... | |
AddressMapConstraints | at (Address x) const |
Anchor at a certain address. More... | |
AddressMapConstraints | at (const Sawyer::Container::Interval< Address > &x) const |
Anchor at a certain interval. More... | |
AddressMapConstraints | limit (size_t x) const |
Limit matching length. More... | |
AddressMapConstraints | atOrAfter (Address least) const |
Limit addresses. More... | |
AddressMapConstraints | atOrBefore (Address greatest) const |
Limit addresses. More... | |
AddressMapConstraints | within (const Sawyer::Container::Interval< Address > &x) const |
Limit addresses. More... | |
AddressMapConstraints | within (Address lo, Address hi) const |
Limit addresses. More... | |
AddressMapConstraints | baseSize (Address base, Address size) const |
Limit addresses. More... | |
AddressMapConstraints | after (Address x) const |
Limit addresses. More... | |
AddressMapConstraints | before (Address x) const |
Limit addreses. More... | |
AddressMapConstraints | singleSegment () const |
Limit matching to single segment. More... | |
AddressMapConstraints | segmentPredicate (SegmentPredicate< Address, Value > *p) const |
Limit segments. More... | |
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. More... | |
bool | neverMatches () const |
Returns true if the constraint is not allowed to match anything. More... | |
bool | isAnchored () const |
Determines whether constraints are anchored to an address. | |
AddressInterval | anchored () const |
Returns the anchor points. More... | |
size_t | limit () const |
Size limit. More... | |
const Optional< Address > & | least () const |
Least possible address. More... | |
const Optional< Address > & | greatest () const |
Greatest possible address. More... | |
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. More... | |
AddressMapConstraints | addressConstraints () const |
Construct new constraints from existing address constraints. More... | |
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 |
|
inline |
Require certain access permissions.
See AddressMap::require.
Definition at line 243 of file AddressMap.h.
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::access(), and Sawyer::Container::AddressMap< A, T >::require().
|
inline |
Prohibit certain access permissions.
See AddressMap::prohibit.
Definition at line 250 of file AddressMap.h.
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::access(), 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 257 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::prohibit(), and Sawyer::Container::AddressMapConstraints< AddressMap >::require().
Referenced by Sawyer::Container::AddressMap< A, T >::access().
|
inline |
Require certain segment names.
See AddressMap::substr.
Definition at line 262 of file AddressMap.h.
Referenced by Sawyer::Container::AddressMap< A, T >::substr().
|
inline |
|
inline |
Constraints that match nothing.
See AddressMap::none.
Definition at line 275 of file AddressMap.h.
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::after(), Sawyer::Container::AddressMapConstraints< AddressMap >::at(), Sawyer::Container::AddressMapConstraints< AddressMap >::atOrAfter(), Sawyer::Container::AddressMapConstraints< AddressMap >::atOrBefore(), Sawyer::Container::AddressMapConstraints< AddressMap >::baseSize(), Sawyer::Container::AddressMapConstraints< AddressMap >::before(), Sawyer::Container::AddressMapConstraints< AddressMap >::limit(), Sawyer::Container::AddressMap< A, T >::none(), Sawyer::Container::AddressMapConstraints< AddressMap >::segmentPredicate(), and Sawyer::Container::AddressMapConstraints< AddressMap >::within().
|
inline |
Anchor at a certain address.
See AddressMap::at.
Definition at line 282 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::none().
Referenced by Sawyer::Container::AddressMap< A, T >::at().
|
inline |
Anchor at a certain interval.
See AddressMap::at.
Definition at line 289 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::atOrAfter(), Sawyer::Container::AddressMapConstraints< AddressMap >::atOrBefore(), Sawyer::Container::Interval< T >::greatest(), Sawyer::Container::Interval< T >::least(), and Sawyer::Container::AddressMapConstraints< AddressMap >::none().
|
inline |
Limit matching length.
See AddressMap::limit.
Definition at line 296 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::none().
Referenced by Sawyer::Container::AddressMap< A, T >::findNode(), 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 303 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::least(), and Sawyer::Container::AddressMapConstraints< AddressMap >::none().
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::after(), Sawyer::Container::AddressMapConstraints< AddressMap >::at(), Sawyer::Container::AddressMap< A, T >::atOrAfter(), Sawyer::Container::AddressMapConstraints< AddressMap >::baseSize(), and Sawyer::Container::AddressMapConstraints< AddressMap >::within().
|
inline |
Limit addresses.
Definition at line 316 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::greatest(), and Sawyer::Container::AddressMapConstraints< AddressMap >::none().
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::at(), 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 329 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(), and Sawyer::Container::AddressMap< A, T >::within().
|
inline |
Limit addresses.
See AddressMap::within.
Definition at line 334 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 339 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().
|
inline |
Limit addresses.
See AddressMap::after.
Definition at line 344 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::atOrAfter(), and Sawyer::Container::AddressMapConstraints< AddressMap >::none().
Referenced by Sawyer::Container::AddressMap< A, T >::after().
|
inline |
Limit addreses.
See AddressMap::before.
Definition at line 349 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::atOrBefore(), and Sawyer::Container::AddressMapConstraints< AddressMap >::none().
Referenced by Sawyer::Container::AddressMap< A, T >::before().
|
inline |
Limit matching to single segment.
See AddressMap::singleSegment.
Definition at line 354 of file AddressMap.h.
Referenced by Sawyer::Container::AddressMap< A, T >::singleSegment().
|
inline |
Limit segments.
See AddressMap::segmentPredicate.
Definition at line 361 of file AddressMap.h.
References Sawyer::Container::AddressMapConstraints< AddressMap >::none().
Referenced by Sawyer::Container::AddressMap< A, T >::segmentPredicate().
|
inline |
Section name substring.
Returns the string that must be present as a substring in a section name.
Definition at line 389 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 396 of file AddressMap.h.
|
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 409 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 415 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 421 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 427 of file AddressMap.h.
Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::atOrBefore().
|
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 448 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 456 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().