1#ifndef __FIBER_CREATIVEARRAYBASE_HPP
2#define __FIBER_CREATIVEARRAYBASE_HPP
5#include <memcore/RefPtr.hpp>
6#include <memcore/Interface.hpp>
7#include <memcore/Persistencer.hpp>
8#include <memcore/Cacheable.hpp>
9#include <memcore/Cache.hpp>
10#include <memcore/Creator.hpp>
11#include <memcore/Chunk.hpp>
14#include "FiberType.hpp"
16#include "BinderBase.hpp"
18#include <memcore/Attributes.hpp>
38 void attributesHaveBeenSaved()
const
40 LastSavedAttributes.
touch();
43 bool attributesNeedSaving()
const
73 ,
public Ownable<CreativeArrayBase, CreativeArrayBaseContainerBase>
93 enum class CreationFailure
103 Error = CreationFailure::None;
115 void extremeUnction();
122 bool needsSaving()
const
124 return isYoungerThan(LastSaved);
135 LastSaved.
update( *
this );
136 attributesHaveBeenSaved();
147 return myFiberTypeIndex;
157 return getFiberTypeIndex().value_type_size();
165 template <
class ...T>
169 return ftb->isType<T...>();
174 void addMetaInfo(
const DynamicSize&theSize,
175 const RefPtr<FiberTypeBase>&theDataType);
177 void addMetaInfo(
int nDimensions,
178 const RefPtr<FiberTypeBase>&theDataType);
215 template <
class RefType>
216 Creature::ReasonForReleasal release_ptr_with_possible_saving(RefPtr<RefType>&
Data,
bool needsSaving)
const
219 return successfully_released;
222 VerboseSection(100,
' ');
236 if (
Data.strong_refs()>2)
238 Verbose(110) <<
" CreativeArrayBase was unable to release data object " << D;
239 return temporarily_unreleasable;
242 Verbose(110) <<
" CreativeArrayBase is releasing data object " << D;
245 Verbose(110) <<
" --> CreativeArrayBase has RELEASED data object " <<
Data;
248 return successfully_released;
256 return MemDataCreator->create();
264 return getChunk(MemDataCreator->create() );
271 return getMemBase( MemDataCreator );
276 return -(-MemDataCreator);
313 return SI->getRank();
331 if (!CAB)
return nullptr;
332 return getSize(*CAB);
337 if (!CAB)
return nullptr;
338 return makeSize(*CAB);
349 return S->getNumberOfElements();
362 return S->getNumberOfElements();
Base class for multidimensional arrays that employ deferred storage, i.e.
Definition CreativeArrayBase.hpp:75
auto value_type_size() const
How many bytes this object occupies in memory.
Definition CreativeArrayBase.hpp:155
void hasBeenSaved() const
Indicate that this dataset has been saved and does not need to be saved again.
Definition CreativeArrayBase.hpp:133
Ageable LastSaved
The age when the data contained here had been saved last. (), CreatorConstructionContext.
Definition CreativeArrayBase.hpp:89
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Domain-specific class of objects that can be owned.
Definition Ownable.hpp:81
Attributes with an age that allows to keep track when the attributes had been saved last.
Definition CreativeArrayBase.hpp:32
An interface telling size and dimensionality of a dataset, a refcounted version of DynamicSize.
Definition field/DynamicSize.hpp:500
Ageable & touch() noexcept
age_t update(age_t age) noexcept
static constexpr const Ageable & InfinitelyOld() noexcept
void addInterface(const RefPtr< InterfaceBase > &I) const
MemSizeConfig< sizeof(void *)>::memsize_t memsize_t
void setSizeInterface(const RefPtr< CreativeArrayBase > &CAB, const MultiIndex< N > &FragmentSize)
Set the size interface to a CreativeArrayBase.
Definition CreativeArrayBase.hpp:285
void setSizeInterface(CreativeArrayBase &CAB, const MultiIndex< N > &FragmentSize)
Set the size interface to a CreativeArrayBase.
Definition CreativeArrayBase.hpp:297
bool getDimensions(MultiIndex< N > &MI, const RefPtr< CreativeArrayBase > &CAB)
Get the dimensions of CreativeArrayBase, if the rank is already known.
Definition CreativeArrayBase.hpp:373
index_t getNumberOfElements(CreativeArrayBase &CAB)
Get the number of elements of a CreativeArrayBase if a SizeInterface is available.
Definition CreativeArrayBase.hpp:359
int getRank(const RefPtr< CreativeArrayBase > &CAB)
Get the rank of a CreativeArrayBase.
Definition CreativeArrayBase.hpp:306
RefPtr< SizeInterface > getSize(const RefPtr< CreativeArrayBase > &CAB)
Get the size interface of a CreativeArrayBase.
Definition CreativeArrayBase.hpp:329
index_t getNumberOfElements(const RefPtr< CreativeArrayBase > &CAB)
Get the number of elements of a CreativeArrayBase if a SizeInterface is available.
Definition CreativeArrayBase.hpp:346
point operator-(const point &P, const vector &v)
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
VAcceptInfoList_t operator+(VAcceptInfoList_t &&l, VAcceptInfoList_t &&r)
This class will be "injected" into the owning class, which means the Field class will be derived from...
Definition CreativeArrayBase.hpp:55
Definition FiberTypeIndex.hpp:12