diff options
author | swhite <schnetter@cct.lsu.edu> | 2004-12-09 17:27:00 +0000 |
---|---|---|
committer | swhite <schnetter@cct.lsu.edu> | 2004-12-09 17:27:00 +0000 |
commit | f52d136d9e20f1a016489ce864affd90da0792ae (patch) | |
tree | 31595b56e421857c8cb3365fe5eecf1dacf670cd /Carpet | |
parent | 875c68bef7bcb38b2355d757e833f84202116fdb (diff) |
CarpetLib/src/*gf.*,*data.* const public members, canonicalise
The g* classes had exposed public member variables which were never
meant to be altered from outside (I imagine altering most of them
would have resulted in very bad behaviour); I made most of these const.
This resulted in some complaints by the compiler about the canonical
constructor and assignment ops, so I provided private dummies.
This patch contains the following changes:
M ./Carpet/CarpetLib/src/gdata.cc +6
M ./Carpet/CarpetLib/src/gdata.hh -2 +2
M ./Carpet/CarpetLib/src/gf.hh +5
M ./Carpet/CarpetLib/src/ggf.hh -9 +15
darcs-hash:20041209172710-32473-46d2a93e11f21f305467b375fe15910d47b8e4de.gz
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/CarpetLib/src/gdata.cc | 6 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/gdata.hh | 4 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/gf.hh | 5 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/ggf.hh | 24 |
4 files changed, 28 insertions, 11 deletions
diff --git a/Carpet/CarpetLib/src/gdata.cc b/Carpet/CarpetLib/src/gdata.cc index 417c463ec..d9d981bb0 100644 --- a/Carpet/CarpetLib/src/gdata.cc +++ b/Carpet/CarpetLib/src/gdata.cc @@ -456,6 +456,12 @@ bool gdata<D> return this_processor_is( proc() ); } +template<int D> +gdata<D>& gdata<D> +::operator = ( const gdata & ) // canonical copy +{ + return *this; // does nothing +} template class comm_state<3>; template class gdata<3>; diff --git a/Carpet/CarpetLib/src/gdata.hh b/Carpet/CarpetLib/src/gdata.hh index 75868852b..9099dcc6a 100644 --- a/Carpet/CarpetLib/src/gdata.hh +++ b/Carpet/CarpetLib/src/gdata.hh @@ -62,7 +62,7 @@ class gdata { protected: // should be readonly // Fields - int varindex; // Cactus variable index, or -1 + const int varindex; // Cactus variable index, or -1 operator_type transport_operator; double wtime_isend, wtime_isendwait; @@ -229,7 +229,7 @@ protected: const ibbox& box, const CCTK_REAL time, const int order_space, const int order_time) = 0; - + gdata & operator =( const gdata & ); // canonical copy }; diff --git a/Carpet/CarpetLib/src/gf.hh b/Carpet/CarpetLib/src/gf.hh index 010fbf5e1..a3ea61e6e 100644 --- a/Carpet/CarpetLib/src/gf.hh +++ b/Carpet/CarpetLib/src/gf.hh @@ -80,6 +80,11 @@ public: // Output virtual ostream& output (ostream& os) const; +private: + gf (); // canonical default construtor + gf ( const gf & ); // canonical copy construtor + gf & operator =( const gf & ); // canonical copy + }; diff --git a/Carpet/CarpetLib/src/ggf.hh b/Carpet/CarpetLib/src/ggf.hh index 0d8051a9b..b7aaed420 100644 --- a/Carpet/CarpetLib/src/ggf.hh +++ b/Carpet/CarpetLib/src/ggf.hh @@ -51,23 +51,23 @@ class ggf { public: // should be readonly // Fields - int varindex; // Cactus variable index - operator_type transport_operator; + const int varindex; // Cactus variable index + const operator_type transport_operator; - th<D> &t; // time hierarchy - int tmin, tmax; // timelevels - int prolongation_order_time; // order of temporal prolongation operator + const th<D> &t; // time hierarchy + const int tmin, tmax; // timelevels + const int prolongation_order_time; // order of temporal prolongation operator - gh<D> &h; // grid hierarchy + const gh<D> &h; // grid hierarchy dh<D> &d; // data hierarchy protected: fdata storage; // storage public: - int vectorlength; // vector length - int vectorindex; // index of *this - ggf* vectorleader; // first vector element + const int vectorlength; // vector length + const int vectorindex; // index of *this + const ggf* vectorleader; // first vector element private: fdata oldstorage; @@ -211,6 +211,12 @@ public: // Output virtual ostream& output (ostream& os) const = 0; + +private: + ggf (); // canonical default construtor + ggf ( const ggf & ); // canonical copy construtor + ggf & operator =( const ggf & ); // canonical copy + }; |