Crashpad
Classes | Public Member Functions | Static Public Attributes | List of all members
crashpad::TSimpleAddressRangeBag< NumEntries > Class Template Reference

A bag implementation using a fixed amount of storage, so that it does not perform any dynamic allocations for its operations. More...

#include "client/simple_address_range_bag.h"

Classes

struct  Entry
 A single entry in the bag. More...
 
class  Iterator
 An iterator to traverse all of the active entries in a TSimpleAddressRangeBag. More...
 

Public Member Functions

 TSimpleAddressRangeBag (const TSimpleAddressRangeBag &other)
 
TSimpleAddressRangeBagoperator= (const TSimpleAddressRangeBag &other)
 
size_t GetCount () const
 Returns the number of active entries. The upper limit for this is NumEntries.
 
bool Insert (CheckedRange< uint64_t > range)
 Inserts the given range into the bag. Duplicates and overlapping ranges are supported and allowed, but not coalesced. More...
 
bool Insert (void *base, size_t size)
 Inserts the given range into the bag. Duplicates and overlapping ranges are supported and allowed, but not coalesced. More...
 
bool Remove (CheckedRange< uint64_t > range)
 Removes the given range from the bag. More...
 
bool Remove (void *base, size_t size)
 Removes the given range from the bag. More...
 

Static Public Attributes

static const size_t num_entries = NumEntries
 Constant and publicly accessible version of the template parameter.
 

Detailed Description

template<size_t NumEntries = 64>
class crashpad::TSimpleAddressRangeBag< NumEntries >

A bag implementation using a fixed amount of storage, so that it does not perform any dynamic allocations for its operations.

The actual bag storage (TSimpleAddressRangeBag::Entry) is POD, so that it can be transmitted over various IPC mechanisms.

Member Function Documentation

◆ Insert() [1/2]

template<size_t NumEntries = 64>
bool crashpad::TSimpleAddressRangeBag< NumEntries >::Insert ( CheckedRange< uint64_t >  range)
inline

Inserts the given range into the bag. Duplicates and overlapping ranges are supported and allowed, but not coalesced.

Parameters
[in]rangeThe range to be inserted. The range must have either a non-zero base address or size.
Returns
true if there was space to insert the range into the bag, otherwise false with an error logged.

◆ Insert() [2/2]

template<size_t NumEntries = 64>
bool crashpad::TSimpleAddressRangeBag< NumEntries >::Insert ( void *  base,
size_t  size 
)
inline

Inserts the given range into the bag. Duplicates and overlapping ranges are supported and allowed, but not coalesced.

Parameters
[in]baseThe base of the range to be inserted. May not be null.
[in]sizeThe size of the range to be inserted. May not be zero.
Returns
true if there was space to insert the range into the bag, otherwise false with an error logged.

◆ Remove() [1/2]

template<size_t NumEntries = 64>
bool crashpad::TSimpleAddressRangeBag< NumEntries >::Remove ( CheckedRange< uint64_t >  range)
inline

Removes the given range from the bag.

Parameters
[in]rangeThe range to be removed. The range must have either a non-zero base address or size.
Returns
true if the range was found and removed, otherwise false with an error logged.

◆ Remove() [2/2]

template<size_t NumEntries = 64>
bool crashpad::TSimpleAddressRangeBag< NumEntries >::Remove ( void *  base,
size_t  size 
)
inline

Removes the given range from the bag.

Parameters
[in]baseThe base of the range to be removed. May not be null.
[in]sizeThe size of the range to be removed. May not be zero.
Returns
true if the range was found and removed, otherwise false with an error logged.

The documentation for this class was generated from the following file: