1#ifndef __FIBER_OWNED_HPP
2#define __FIBER_OWNED_HPP
5#include <memcore/RefPtr.hpp>
6#include <memcore/Interface.hpp>
7#include <memcore/Verbose.hpp>
8#include <memcore/Ageable.hpp>
54 template <
class ItemType>
79template <
class Domain,
class ContainerBase = ChildrenProperties>
90 ,
public ContainerBase
117 return PT->myContainer;
139 myContainer->x_updateOwnershipAge(
theNewAge);
221 return ::MemCore::NullPtr();
242 Verbose(200) <<
" -- Checking " << this->Owners.
size() <<
" owners for " <<
typeid(*this);
248 Verbose(200) <<
" -- processing owner " << myContainer;
250 myContainer->recognizeOwnership(
Output);
251 if (!myContainer->processOwnership(
Output, Input ) )
264template <
class OwnedObjectType,
class ContainerBase = ChildrenProperties>
size_type size() const noexcept
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Definition Ownable.hpp:99
Base class for objects that may own domain-specific objects.
Definition Ownable.hpp:91
Domain-specific class of objects that can be owned.
Definition Ownable.hpp:81
Ownable & operator=(const Ownable &)
Assignment, does NOT copy any ownership information, the assigned Ownable will retain all its ownersh...
Definition Ownable.hpp:190
void insertOwner(const Container &theOwner)
Add some owner.
Definition Ownable.hpp:145
Ownable()
Default constructor, empty Ownership list.
Definition Ownable.hpp:177
void x_updateOwnershipAge(const MemCore::Ageable &theNewAge) override
Forward some age to all Owners.
Definition Ownable.hpp:133
void addOwner(const MemCore::WeakPtr< Container > &theOwner, const MemCore::Ageable &theNewAge)
Add some owner and broadcast a new age to all Ownerrs.
Definition Ownable.hpp:170
MemCore::WeakPtr< Container > getPrimaryOwner() const
Get the first valid owner.
Definition Ownable.hpp:213
Ownable(const Ownable &)
Copy constructor, does NOT copy any ownership information, the new Ownable will be unowned.
Definition Ownable.hpp:183
bool processOwnership(MemCore::Intercube &Output, const MemCore::Intercube &Input) const override
Process some ownership action.
Definition Ownable.hpp:240
std::unordered_set< MemCore::WeakPtr< Container > > Owners
The (internal) list of owners.
Definition Ownable.hpp:127
bool insertOwner(const MemCore::WeakPtr< Container > &theOwner)
Add some owner.
Definition Ownable.hpp:152
void addOwner(const Container &theOwner, const MemCore::Ageable &theNewAge)
Add some owner and broadcast a new age to all Ownerrs.
Definition Ownable.hpp:163
size_t getNumberOfValidOwners() const
Get the first valid owner.
Definition Ownable.hpp:225
Ownable(const Container &theOwner, const MemCore::Ageable &theNewAge)
Construct an Ownable with an initial owner.
Definition Ownable.hpp:207
Ownable(const MemCore::WeakPtr< Container > &theOwner, const MemCore::Ageable &theNewAge)
Construct an Ownable with an initial owner.
Definition Ownable.hpp:198
Base class for objects that are owned by others and owning others.
Definition Ownable.hpp:20
virtual void x_updateOwnershipAge(const MemCore::Ageable &)=0
Update all owners with the given age (Ageable::update() ).
virtual bool processOwnership(MemCore::Intercube &Output, const MemCore::Intercube &Input) const =0
Hierarchically broadcast some activity to all Owners.
bool processOwnership(MemCore::Intercube &OutputAndInput) const
Process ownership where the input information is shared with the output information in the same Inter...
Definition Ownable.hpp:45
static constexpr const Ageable & InfinitelyOld() noexcept
const auto & self() const
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
typename Ownable< OwnedObjectType, ContainerBase >::Container OwnerOf
Shortcut to find the owning type.
Definition Ownable.hpp:265
Definition Ownable.hpp:70