FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
BinderBase.hpp
1#ifndef __FIBER_FIELD_BINDERBASE_HPP
2#define __FIBER_FIELD_BINDERBASE_HPP
3
4#include <string>
5#include "MemBase.hpp"
6
7namespace Fiber
8{
9
10
17{
18protected:
19
20 std::string url;
21
22public:
23
24 BinderBase(const std::string&url);
25
26 virtual ~BinderBase();
27
28 const std::string&getUrl() const
29 {
30 return url;
31 }
32};
33
34template <class T>
35struct RelativeToBinder : std::map< MemCore::WeakPtr<Fiber::BinderBase>, T>
36{
37 T default_value;
38
40 {}
41
42 RelativeToBinder(const T&DefaultValue)
43 : default_value( DefaultValue )
44 {}
45
46 const T&operator()(const MemCore::WeakPtr<BinderBase>&BBptr) const
47 {
48 const auto&it = this->find( BBptr );
49 if (it == this->end())
50 return default_value;
51
52 return it->second;
53 }
54
55 T&operator()(const MemCore::WeakPtr<BinderBase>&BBptr)
56 {
57 const auto&it = this->find( BBptr );
58 if (it == this->end())
59 return default_value;
60
61 return it->second;
62 }
63};
64
66
67template <class T>
69
70} // namespace Fiber
71
72
73#endif // __FIBER_FIELD_BINDERBASE_HPP
basic_string< char > string
Base class to allow binding a Fiber Bundle data structure to some storage device, similar to swapping...
Definition BinderBase.hpp:17
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
Definition BinderBase.hpp:36