diff options
author | Erik Schnetter <schnetter@aei.mpg.de> | 2005-01-01 18:22:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@aei.mpg.de> | 2005-01-01 18:22:00 +0000 |
commit | 2a38d7eb6a6db8b150a9f6fd5f1c844b8d0ef74a (patch) | |
tree | 1c5e763b0ffee9744ee708d6016bdbd36b8f8312 /Carpet/CarpetLib/src/th.cc | |
parent | 049cec8e042a508511fdb0f0948de63f84f9b8be (diff) |
global: Turn CarpetLib templates into classes
Turn most of the templates in CarpetLib, which used to have the form
template<int D> class XXX
into classes, i.e., into something like
class XXX
by setting D to the new global integer constant dim, which in turn is set to 3.
The templates gf and data, which used to be of the form
template<typename T, int D> class XXX
are now of the form
template<typename T> class XXX
The templates vect, bbox, and bboxset remain templates.
This change simplifies the code somewhat.
darcs-hash:20050101182234-891bb-c3063528841f0d078b12cc506309ea27d8ce730d.gz
Diffstat (limited to 'Carpet/CarpetLib/src/th.cc')
-rw-r--r-- | Carpet/CarpetLib/src/th.cc | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/Carpet/CarpetLib/src/th.cc b/Carpet/CarpetLib/src/th.cc index 1a85d78a3..b25361262 100644 --- a/Carpet/CarpetLib/src/th.cc +++ b/Carpet/CarpetLib/src/th.cc @@ -14,21 +14,18 @@ using namespace std; // Constructors -template<int D> -th<D>::th (gh<D>& h, const CCTK_REAL basedelta) +th::th (gh& h, const CCTK_REAL basedelta) : h(h), delta(basedelta) { h.add(this); } // Destructors -template<int D> -th<D>::~th () { +th::~th () { h.remove(this); } // Modifiers -template<int D> -void th<D>::recompose () { +void th::recompose () { times.resize(h.reflevels()); deltas.resize(h.reflevels()); for (int rl=0; rl<h.reflevels(); ++rl) { @@ -59,9 +56,8 @@ void th<D>::recompose () { // Output -template<int D> -void th<D>::output (ostream& os) const { - os << "th<" << D << ">:" +void th::output (ostream& os) const { + os << "th:" << "times={"; for (int rl=0; rl<h.reflevels(); ++rl) { for (int ml=0; ml<h.mglevels(rl,0); ++ml) { @@ -72,7 +68,3 @@ void th<D>::output (ostream& os) const { } os << "}"; } - - - -template class th<3>; |