Public Member Functions | Private Attributes | List of all members
beluga::policies::detail::every_n_policy Struct Reference

Implementation detail for the every_n_policy. More...

#include <every_n.hpp>

Public Member Functions

constexpr every_n_policy (std::size_t count)
 Constructor. More...
 
constexpr bool operator() ()
 Call operator overload. More...
 

Private Attributes

std::size_t count_ {0}
 The count specifying when the action should be triggered. More...
 
std::size_t current_ {0}
 The current count of calls. More...
 

Detailed Description

Implementation detail for the every_n_policy.

This policy triggers an action every N calls, where N is a specified count.

Definition at line 33 of file every_n.hpp.

Constructor & Destructor Documentation

◆ every_n_policy()

constexpr beluga::policies::detail::every_n_policy::every_n_policy ( std::size_t  count)
inlineexplicitconstexpr

Constructor.

Parameters
countThe count specifying when the action should be triggered (every N calls).

Definition at line 39 of file every_n.hpp.

Member Function Documentation

◆ operator()()

constexpr bool beluga::policies::detail::every_n_policy::operator() ( )
inlineconstexpr

Call operator overload.

Returns
True if the action should be triggered, false otherwise.

Increments the internal counter and returns true if the current count is a multiple of N.

Definition at line 47 of file every_n.hpp.

Member Data Documentation

◆ count_

std::size_t beluga::policies::detail::every_n_policy::count_ {0}
private

The count specifying when the action should be triggered.

Definition at line 53 of file every_n.hpp.

◆ current_

std::size_t beluga::policies::detail::every_n_policy::current_ {0}
private

The current count of calls.

Definition at line 54 of file every_n.hpp.


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


beluga
Author(s):
autogenerated on Tue Jul 16 2024 02:59:54