FiberVISH
0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
fiber
field
FunctionalCreator.hpp
1
#ifndef __FIBER_FIELD_FUNCTIONALCREATOR_HPP
2
#define __FIBER_FIELD_FUNCTIONALCREATOR_HPP "Created 08.06.2015 13:12:27 by werner"
3
4
#ifndef DONT_USE_PRAGMA_ONCE
5
#pragma once
6
#endif
7
8
#include "CreativeArrayBase.hpp"
9
#include <memcore/AlzheimerCreator.hpp>
10
11
#include <
future
>
12
#include <
functional
>
13
14
namespace
Fiber
15
{
16
19
class
FIELD_API
FunctionalCreatorBase
:
public
MemCore::AlzheimerCreator
<Fiber::MemBase, CreativeArrayBase>
20
{
21
protected
:
22
std::future< RefPtr<MemBase>
> AsynchroneouslyComputedData;
23
24
std::mutex
production_mutex;
25
26
RefPtr<MemBase>
produce()
override
;
27
28
public
:
29
using
Base_t
=
AlzheimerCreator<MemBase, CreativeArrayBase>
;
30
31
bool
DataProductionIsCheaperThanFunctor =
true
;
32
33
FunctionalCreatorBase
(
bool
DataReProductionIsCheaperThanFunctor
=
true
,
34
const
MemCore::WeakPtr<MemCore::Cache>
&
theCache
=
MemCore::Cache::MemCache
() )
35
:
AlzheimerCreator<MemBase, CreativeArrayBase>
(
nullptr
,
theCache
)
36
, DataProductionIsCheaperThanFunctor(
DataReProductionIsCheaperThanFunctor
)
37
{}
38
39
~FunctionalCreatorBase
();
40
41
virtual
RefPtr<MemBase>
compute()
const
= 0;
42
43
bool
isUnderCreation()
const override
;
44
45
bool
request(
const
result&R)
override
;
46
};
47
48
51
class
FIELD_API
FunctionalCreator
:
public
FunctionalCreatorBase
52
{
53
public
:
54
55
using
Functor = std::function< RefPtr<MemBase>() >;
56
57
using
Base_t
=
FunctionalCreatorBase
;
58
59
Functor myFunctor;
60
61
FunctionalCreator
(
const
Functor&
theFunctor
,
62
bool
DataReProductionIsCheaperThanFunctor
=
true
,
63
const
MemCore::WeakPtr<MemCore::Cache>
&
theCache
=
MemCore::Cache::MemCache
() );
64
65
~FunctionalCreator
();
66
67
RefPtr<MemBase>
compute()
const override
;
68
};
69
70
/*
71
template <class Functor>
72
RefPtr<FunctionalCreator<Functor>> newFunctionalCreator(const Functor&F)
73
{
74
return new FunctionalCreator<Functor>(F);
75
}
76
*/
77
78
template
<
class
Functor>
79
RefPtr<FunctionalCreator>
newFunctionalCreator(
const
Functor
&F)
80
{
81
return
new
FunctionalCreator
(F);
82
}
83
84
85
}
86
87
#endif
// __FIBER_FIELD_FUNCTIONALCREATOR_HPP
functional
future
std::future
std::mutex
Fiber::CreativeIterator
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition
CreativeIterator.hpp:34
Fiber::FunctionalCreatorBase
Definition
FunctionalCreator.hpp:20
Fiber::FunctionalCreator
Definition
FunctionalCreator.hpp:52
MemCore::AlzheimerCreator
MemCore::Cache::MemCache
static RefPtr< Cache, CacheBase > & MemCache()
MemCore::WeakPtr
Fiber
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition
FAQ.dox:2
MemCore::Functor
Generated on Sun Mar 1 2026 10:23:05 for FiberVISH by
1.9.8