[Debian-astro-commits] [gyoto] 114/221: Rename GYOTO_PROPERTY to GYOTO_OBJECT, change GYOTO_PROPERTY_FINALIZE to accept a Property* rather than a Property
Thibaut Jean-Claude Paumard
thibaut at moszumanska.debian.org
Fri May 22 20:52:38 UTC 2015
This is an automated email from the git hooks/post-receive script.
thibaut pushed a commit to branch master
in repository gyoto.
commit a6130803e3155ea5e6f28db86a0b14d84f96063c
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date: Thu Nov 27 09:19:37 2014 +0100
Rename GYOTO_PROPERTY to GYOTO_OBJECT, change GYOTO_PROPERTY_FINALIZE to accept a Property* rather than a Property
---
include/GyotoKerrBL.h | 2 +-
include/GyotoKerrKS.h | 2 +-
include/GyotoMetric.h | 2 +-
include/GyotoMinkowski.h | 2 +-
include/GyotoNumericalMetricLorene.h | 2 +-
include/GyotoObject.h | 11 +++--------
include/GyotoRotStar3_1.h | 2 +-
lib/Astrobj.C | 2 +-
lib/KerrBL.C | 2 +-
lib/KerrKS.C | 2 +-
lib/Metric.C | 2 +-
lib/Minkowski.C | 2 +-
lib/NumericalMetricLorene.C | 2 +-
lib/Object.C | 13 ++++---------
lib/RotStar3_1.C | 2 +-
15 files changed, 20 insertions(+), 30 deletions(-)
diff --git a/include/GyotoKerrBL.h b/include/GyotoKerrBL.h
index 053495a..3db0924 100644
--- a/include/GyotoKerrBL.h
+++ b/include/GyotoKerrBL.h
@@ -69,7 +69,7 @@ class Gyoto::Metric::KerrBL : public Metric::Generic {
// Constructors - Destructor
// -------------------------
public:
- GYOTO_PROPERTY;
+ GYOTO_OBJECT;
KerrBL(); ///< Default constructor
virtual KerrBL * clone () const ;
diff --git a/include/GyotoKerrKS.h b/include/GyotoKerrKS.h
index 5f648ad..d260f9b 100644
--- a/include/GyotoKerrKS.h
+++ b/include/GyotoKerrKS.h
@@ -71,7 +71,7 @@ class Gyoto::Metric::KerrKS
// Constructors - Destructor
// -------------------------
public:
- GYOTO_PROPERTY;
+ GYOTO_OBJECT;
KerrKS(); ///< Default constructor
virtual KerrKS* clone () const; ///< Copy constructor
diff --git a/include/GyotoMetric.h b/include/GyotoMetric.h
index 236b669..0e6487f 100644
--- a/include/GyotoMetric.h
+++ b/include/GyotoMetric.h
@@ -193,7 +193,7 @@ class Gyoto::Metric::Generic
public:
- GYOTO_PROPERTY;
+ GYOTO_OBJECT;
const std::string kind() const; ///< Get kind_
int getRefCount();
diff --git a/include/GyotoMinkowski.h b/include/GyotoMinkowski.h
index e9d8832..19743d3 100644
--- a/include/GyotoMinkowski.h
+++ b/include/GyotoMinkowski.h
@@ -56,7 +56,7 @@ class Gyoto::Metric::Minkowski
void spherical(bool);
bool spherical() const;
// This is the bare minimum of what a Metric class must implement:
- GYOTO_PROPERTY;
+ GYOTO_OBJECT;
Minkowski();
virtual Minkowski* clone() const ;
diff --git a/include/GyotoNumericalMetricLorene.h b/include/GyotoNumericalMetricLorene.h
index fc5fcc4..f8c4e91 100644
--- a/include/GyotoNumericalMetricLorene.h
+++ b/include/GyotoNumericalMetricLorene.h
@@ -77,7 +77,7 @@ class Gyoto::Metric::NumericalMetricLorene
void free(); ///< deallocate memory
public:
- GYOTO_PROPERTY;
+ GYOTO_OBJECT;
NumericalMetricLorene(); ///< Constructor
NumericalMetricLorene(const NumericalMetricLorene&); ///< Copy constructor
virtual NumericalMetricLorene* clone() const ;
diff --git a/include/GyotoObject.h b/include/GyotoObject.h
index 7d7ab15..7034e8d 100644
--- a/include/GyotoObject.h
+++ b/include/GyotoObject.h
@@ -111,17 +111,13 @@ namespace Gyoto {
name##_ancestors)
/// Define class::properties and class::getProperties()
-#define GYOTO_PROPERTY_FINALIZE(class, property) \
- Property const * const class::properties = &property; \
+#define GYOTO_PROPERTY_FINALIZE(class, ancestor) \
+ Property const * const class::properties = ancestor; \
Property const * class::getProperties() const { \
return class::properties; \
}
/// Declare class::properties and class::getProperties()
-#define GYOTO_PROPERTY \
- static Property const * const properties; \
- virtual Property const * getProperties() const
-
#define GYOTO_OBJECT \
static Property const * const properties; \
virtual Property const * getProperties() const
@@ -135,7 +131,7 @@ class Gyoto::Object
protected:
std::string kind_;
public:
- static Property const * const properties;
+ GYOTO_OBJECT;
Object (std::string const &kind) ;
Object () ;
Object (Object const &orig) ;
@@ -153,7 +149,6 @@ class Gyoto::Object
void get(Property const &p, std::vector<double> &val) const;
//void get(std::string const pname, double &val);
Property const * property(std::string const pname) const;
- virtual Property const * getProperties() const;
#ifdef GYOTO_USE_XERCES
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const ;
diff --git a/include/GyotoRotStar3_1.h b/include/GyotoRotStar3_1.h
index a5342c2..613374a 100644
--- a/include/GyotoRotStar3_1.h
+++ b/include/GyotoRotStar3_1.h
@@ -60,7 +60,7 @@ class Gyoto::Metric::RotStar3_1 : public Gyoto::Metric::Generic {
int integ_kind_;///< 1 if RotStar3_1::myrk4(), 0 if Metric::myrk4()
public:
- GYOTO_PROPERTY;
+ GYOTO_OBJECT;
RotStar3_1(); ///< Constructor
RotStar3_1(const RotStar3_1& ) ; ///< Copy constructor
virtual ~RotStar3_1() ; ///< Destructor
diff --git a/lib/Astrobj.C b/lib/Astrobj.C
index 2cdeb22..573edc3 100644
--- a/lib/Astrobj.C
+++ b/lib/Astrobj.C
@@ -48,7 +48,7 @@ GYOTO_PROPERTY_BOOL(Generic, RadiativeQ, NoRadiativeQ,
GYOTO_PROPERTY_BOOL(Generic, Redshift, NoRedshift,
redshift, &RadiativeQ);
GYOTO_PROPERTY_DOUBLE_UNIT(Generic, RMax, rMax, &Redshift);
-GYOTO_PROPERTY_FINALIZE(Astrobj::Generic, RMax);
+GYOTO_PROPERTY_FINALIZE(Astrobj::Generic, &RMax);
Generic::Generic(string kin) :
diff --git a/lib/KerrBL.C b/lib/KerrBL.C
index 57dcd6c..fb75163 100644
--- a/lib/KerrBL.C
+++ b/lib/KerrBL.C
@@ -41,7 +41,7 @@ GYOTO_PROPERTY_BOOL(KerrBL, GenericIntegrator, SpecificIntegrator,
genericIntegrator, &HorizonSecurity);
GYOTO_PROPERTY_DOUBLE(KerrBL, DiffTol, difftol, &GenericIntegrator);
GYOTO_PROPERTY_DOUBLE(KerrBL, Spin, spin, &DiffTol);
-GYOTO_PROPERTY_FINALIZE(KerrBL, Spin);
+GYOTO_PROPERTY_FINALIZE(KerrBL, &Spin);
/*
NB: points delicats de KerrBL:
diff --git a/lib/KerrKS.C b/lib/KerrKS.C
index c1a2e7d..5970a26 100644
--- a/lib/KerrKS.C
+++ b/lib/KerrKS.C
@@ -40,7 +40,7 @@ GYOTO_PROPERTY_DOUBLE(KerrKS, HorizonSecurity, horizonSecurity,
GYOTO_PROPERTY_BOOL(KerrKS, GenericIntegrator, SpecificIntegrator,
genericIntegrator, &HorizonSecurity);
GYOTO_PROPERTY_DOUBLE(KerrKS, Spin, spin, &GenericIntegrator);
-GYOTO_PROPERTY_FINALIZE(KerrKS, Spin);
+GYOTO_PROPERTY_FINALIZE(KerrKS, &Spin);
/*
NOTA BENE: to improve KerrKS
diff --git a/lib/Metric.C b/lib/Metric.C
index 474c7b8..bb21558 100644
--- a/lib/Metric.C
+++ b/lib/Metric.C
@@ -43,7 +43,7 @@ GYOTO_PROPERTY_DOUBLE(Metric::Generic, DeltaMax, deltaMax, &DeltaMaxOverR);
GYOTO_PROPERTY_DOUBLE(Metric::Generic, DeltaMin, deltaMin, &DeltaMax);
GYOTO_PROPERTY_DOUBLE_UNIT(Metric::Generic, Mass, mass, &DeltaMin);
-GYOTO_PROPERTY_FINALIZE(Metric::Generic, Mass);
+GYOTO_PROPERTY_FINALIZE(Metric::Generic, &Mass);
///
diff --git a/lib/Minkowski.C b/lib/Minkowski.C
index 68328cf..f9e87d3 100644
--- a/lib/Minkowski.C
+++ b/lib/Minkowski.C
@@ -32,7 +32,7 @@ GYOTO_PROPERTY_BOOL(Minkowski, Spherical, Cartesian,
spherical, Generic::properties);
// We still need to connect this (single) property to
// Minkowski::properties and define getProperties():
-GYOTO_PROPERTY_FINALIZE(Minkowski, Spherical);
+GYOTO_PROPERTY_FINALIZE(Minkowski, &Spherical);
// This is the minimal constructor: it just sets the coordinate kind and
// the metric kind name.
diff --git a/lib/NumericalMetricLorene.C b/lib/NumericalMetricLorene.C
index 50daaf6..071e61b 100644
--- a/lib/NumericalMetricLorene.C
+++ b/lib/NumericalMetricLorene.C
@@ -46,7 +46,7 @@ GYOTO_PROPERTY_BOOL(NumericalMetricLorene,
GYOTO_PROPERTY_BOOL(NumericalMetricLorene,
MapEt, MapAf,
mapEt, &SpecifyMarginalOrbits);
-GYOTO_PROPERTY_FINALIZE(NumericalMetricLorene, MapEt);
+GYOTO_PROPERTY_FINALIZE(NumericalMetricLorene, &MapEt);
NumericalMetricLorene::NumericalMetricLorene() :
WIP("Metric::NumericalMetricLorene"),
diff --git a/lib/Object.C b/lib/Object.C
index b9f9b76..b878dad 100644
--- a/lib/Object.C
+++ b/lib/Object.C
@@ -7,7 +7,7 @@
using namespace std ;
using namespace Gyoto ;
-Property const * const Object::properties = NULL;
+GYOTO_PROPERTY_FINALIZE(Object, NULL);
Gyoto::Object::Object(std::string const &name):kind_(name) {}
Gyoto::Object::Object():kind_("") {}
@@ -131,11 +131,6 @@ Property const * Object::property(std::string const pname) const {
return getProperties() -> find(pname);
}
-Property const * Object::getProperties() const {
- return properties;
-}
-
-
#ifdef GYOTO_USE_XERCES
void Object::fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const {
string name=p.name;
@@ -191,8 +186,8 @@ void Object::setParameters(Gyoto::FactoryMessenger *fmp) {
string name="", content="", unit="";
if (fmp)
while (fmp->getNextParameter(&name, &content, &unit)) {
- cerr << "Setting '" << name << "' to '" << content
- << "' (unit='"<<unit<<"')" << endl;
+ GYOTO_DEBUG << "Setting '" << name << "' to '" << content
+ << "' (unit='"<<unit<<"')" << endl;
Property const * prop = property(name);
if (!prop) {;
// The specific setParameter() implementation may well know
@@ -204,7 +199,7 @@ void Object::setParameters(Gyoto::FactoryMessenger *fmp) {
setParameter(*prop, name, content, unit);
}
}
- cerr << "Done processing parameters" << endl;
+ GYOTO_DEBUG << "Done processing parameters" << endl;
}
#endif
diff --git a/lib/RotStar3_1.C b/lib/RotStar3_1.C
index 9b338e1..725f68a 100644
--- a/lib/RotStar3_1.C
+++ b/lib/RotStar3_1.C
@@ -46,7 +46,7 @@ using namespace Gyoto::Metric;
GYOTO_PROPERTY_FILENAME(RotStar3_1, File, file, Generic::properties);
GYOTO_PROPERTY_BOOL(RotStar3_1, GenericIntegrator, SpecificIntegrator,
genericIntegrator, &File);
-GYOTO_PROPERTY_FINALIZE(RotStar3_1, GenericIntegrator);
+GYOTO_PROPERTY_FINALIZE(RotStar3_1, &GenericIntegrator);
RotStar3_1::RotStar3_1() :
Generic(GYOTO_COORDKIND_SPHERICAL, "RotStar3_1"),
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/gyoto.git
More information about the Debian-astro-commits
mailing list