Skip to content

Commit 14758f0

Browse files
committed
encap: some templatization tweaks
1 parent 6283b97 commit 14758f0

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

include/pfasst/encap/encap_sweeper.hpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@ namespace pfasst
2323
class EncapSweeper
2424
: public ISweeper<time>
2525
{
26+
public:
27+
//! @{
28+
typedef Encapsulation<time> encap_type;
29+
typedef EncapFactory<time> factory_type;
30+
//! @}
31+
32+
private:
2633
//! @{
2734
vector<time> nodes;
2835
vector<bool> is_proper;
29-
shared_ptr<EncapFactory<time>> factory;
36+
shared_ptr<factory_type> factory;
3037
//! @}
3138

3239
public:
@@ -68,14 +75,14 @@ namespace pfasst
6875
//! @}
6976

7077
//! @{
71-
void set_nodes(vector<time> nodes)
78+
virtual void set_nodes(vector<time> nodes)
7279
{
7380
auto augmented = pfasst::augment_nodes(nodes);
7481
this->nodes = get<0>(augmented);
7582
this->is_proper = get<1>(augmented);
7683
}
7784

78-
const vector<time> get_nodes() const
85+
virtual const vector<time> get_nodes() const
7986
{
8087
return nodes;
8188
}
@@ -85,12 +92,12 @@ namespace pfasst
8592
return is_proper;
8693
}
8794

88-
void set_factory(shared_ptr<EncapFactory<time>> factory)
95+
virtual void set_factory(shared_ptr<factory_type> factory)
8996
{
90-
this->factory = shared_ptr<EncapFactory<time>>(factory);
97+
this->factory = factory;
9198
}
9299

93-
shared_ptr<EncapFactory<time>> get_factory() const
100+
virtual shared_ptr<factory_type> get_factory() const
94101
{
95102
return factory;
96103
}
@@ -103,7 +110,7 @@ namespace pfasst
103110
*
104111
* @note This method must be implemented in derived sweepers.
105112
*/
106-
virtual void set_state(shared_ptr<const Encapsulation<time>> u0, size_t m)
113+
virtual void set_state(shared_ptr<const encap_type> u0, size_t m)
107114
{
108115
UNUSED(u0); UNUSED(m);
109116
throw NotImplementedYet("sweeper");
@@ -193,7 +200,7 @@ namespace pfasst
193200
*
194201
* @note This method must be implemented in derived sweepers.
195202
*/
196-
virtual void integrate(time dt, vector<shared_ptr<Encapsulation<time>>> dst) const
203+
virtual void integrate(time dt, vector<shared_ptr<encap_type>> dst) const
197204
{
198205
UNUSED(dt); UNUSED(dst);
199206
throw NotImplementedYet("sweeper");

0 commit comments

Comments
 (0)