Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy::search::ManagedNeighborList< BuilderState, Rebuilder >::UpdateResult Struct Reference

Return type for update() carrying both the list and a rebuild indicator. More...

#include <ManagedNeighborList.hpp>

Public Member Functions

 operator const list_type & () const noexcept
 operator bool () const noexcept

Public Attributes

const list_typelist
bool rebuilt

Detailed Description

template<typename BuilderState, RebuilderType Rebuilder>
struct mundy::search::ManagedNeighborList< BuilderState, Rebuilder >::UpdateResult

Implicitly converts to const list_type& so existing call sites that bind the result to a reference compile unchanged (so long as the call site isn't templated). Contextual bool conversion is true when the list waw rebuilt during this call, false when the cached copy was returned as-is:

// Unchanged existing usage:
const auto& nl = managed.update(bulk, targets, sources);
// New: react only when the list changed:
if (managed.update(bulk, targets, sources)) { rehash_bins(); }
// Capture both at once:
auto result = managed.update(bulk, targets, sources);
use(result); // implicit list conversion
if (result) { ... } // bool branch

Member Function Documentation

◆ operator const list_type &()

template<typename BuilderState, RebuilderType Rebuilder>
mundy::search::ManagedNeighborList< BuilderState, Rebuilder >::UpdateResult::operator const list_type & ( ) const
inlinenoexcept

◆ operator bool()

template<typename BuilderState, RebuilderType Rebuilder>
mundy::search::ManagedNeighborList< BuilderState, Rebuilder >::UpdateResult::operator bool ( ) const
inlineexplicitnoexcept

Member Data Documentation

◆ list

template<typename BuilderState, RebuilderType Rebuilder>
const list_type& mundy::search::ManagedNeighborList< BuilderState, Rebuilder >::UpdateResult::list

◆ rebuilt

template<typename BuilderState, RebuilderType Rebuilder>
bool mundy::search::ManagedNeighborList< BuilderState, Rebuilder >::UpdateResult::rebuilt