# `sample_resize_policy` Interface

A sample resize policy.

This class serves to show the interface a resize policy needs to support.

1. `sample_resize_policy.hpp`
2. Public Methods:
   1. Constructors, destructor, and related.
3. Protected Methods:
   1. Insert search notifications.
   2. Find search notifications.
   3. Erase search notifications.
   4. Content change notifications.
   5. Size change notifications.
   6. Queries.

## Constructors, destructor, and related.

Method | Description

      sample_resize_policy
      ()

Default constructor.

Must be default constructible.

      sample_range_hashing
      (const sample_resize_policy &r_other)

Copy constructor.

Must be copy constructible.

    inline void
      swap
      (sample_resize_policy &r_other)

Swaps content.

Must be swappable (if there is such a word).

## Insert search notifications.

Notifications called during an insert operation.

Method | Description

    inline void
      notify_insert_search_start
      ()

Notifies a search started.

    inline void
      notify_insert_search_collision
      ()

Notifies a search encountered a collision.

    inline void
      notify_insert_search_end
      ()

Notifies a search ended.

## Find search notifications.

Notifications called during a find operation.

Method | Description

    inline void
      notify_find_search_start
      ()

Notifies a search started.

    inline void
      notify_find_search_collision
      ()

Notifies a search encountered a collision.

    inline void
      notify_find_search_end
      ()

Notifies a search ended.

## Erase search notifications.

Notifications called during an insert operation.

Method | Description

    inline void
      notify_erase_search_start
      ()

Notifies a search started.

    inline void
      notify_erase_search_collision
      ()

Notifies a search encountered a collision.

    inline void
      notify_erase_search_end
      ()

Notifies a search ended.

## Content change notifications.

Notifications called when the content of the table changes in a way that can affect the resize policy.

Method | Description

    inline void
      notify_inserted
      (size_type num_e)

Notifies an element was inserted.

    inline void
      notify_erased
      (size_type num_e)

Notifies an element was erased.

    void
      notify_cleared
      ()

Notifies the table was cleared.

## Size change notifications.

Notifications called when the table changes size.

Method | Description

    void
      notify_resized
      (size_type new_size)

Notifies the table was resized to `new_size`.

## Queries.

Called to query whether/how to resize.

Method | Description

    size_type
      get_init_size
      () const

Queries initial size.

    inline bool
      is_resize_needed
      () const

Queries whether a resize is needed.

    size_type
      get_new_size
      (size_type size, size_type num_used_e) const

Queries what the new `size` should be.