From 1e531c4370bb010670a813f1c3f0a53944efa331 Mon Sep 17 00:00:00 2001 From: Daniel Russel Date: Wed, 6 Feb 2008 18:13:32 +0000 Subject: [PATCH] class vs struct fixed --- .../demo/Kinetic_data_structures/makefile | 4 +- .../include/CGAL/Kinetic/IO/Qt_widget_2.h | 7 ++- .../include/CGAL/Kinetic/Listener.h | 7 +-- .../include/CGAL/Kinetic/Multi_listener.h | 2 +- .../include/CGAL/Tools/utility_macros.h | 51 ++++++++----------- 5 files changed, 31 insertions(+), 40 deletions(-) diff --git a/Kinetic_data_structures/demo/Kinetic_data_structures/makefile b/Kinetic_data_structures/demo/Kinetic_data_structures/makefile index f2da1e542b5..a376a807036 100644 --- a/Kinetic_data_structures/demo/Kinetic_data_structures/makefile +++ b/Kinetic_data_structures/demo/Kinetic_data_structures/makefile @@ -29,11 +29,11 @@ LIBPATH = \ LDFLAGS = \ $(LONG_NAME_PROBLEM_LDFLAGS) \ - $(CGAL_LDFLAGS) -lboost_thread-mt + $(CGAL_LDFLAGS) QT_LDFLAGS = \ $(LONG_NAME_PROBLEM_LDFLAGS) \ - $(CGAL_LDFLAGS) + $(CGAL_LDFLAGS) CXXFLAGS_3D= $(CXXFLAGS) diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/IO/Qt_widget_2.h b/Kinetic_data_structures/include/CGAL/Kinetic/IO/Qt_widget_2.h index ea609b7d84b..03cb06a7e1c 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/IO/Qt_widget_2.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/IO/Qt_widget_2.h @@ -89,10 +89,9 @@ public: //! construct things Qt_widget_2(int argc, char *argv[], typename Simulator::Handle sh, - double xmin=-10,double xmax=10, double ymin=-10, double ymax=10): - app_(new QApplication(argc, argv)), - base_(new Graphical_base(sh)), - window_l_(base_){ + double xmin=-10,double xmax=10, double ymin=-10, double ymax=10): app_(new QApplication(argc, argv)), + base_(new Graphical_base(sh)), + window_l_(base_){ app_->setMainWidget(new Qt_window(static_cast(std::floor(xmin)), static_cast(std::ceil(xmax)), diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/Listener.h b/Kinetic_data_structures/include/CGAL/Kinetic/Listener.h index c9afa4c7d2c..628cb8da74b 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/Listener.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/Listener.h @@ -110,7 +110,8 @@ public: */ virtual void new_notification(typename Interface::Notification_type nt)=0; - struct Handle: public boost::noncopyable { + class Handle: public boost::noncopyable { + public: Handle(): p_(NULL){} Handle(LB_this *p):p_(p){} LB_this &operator*(){return *p_;} @@ -249,7 +250,7 @@ private: \ #define CGAL_KINETIC_LISTEN1(Notifier, NOTIF, function)\ private: \ - struct Notifier##_listener: public Notifier::Listener { \ + class Notifier##_listener: public Notifier::Listener { \ CGAL_KINETIC_LISTENER_BASICS(Notifier##_listener, This); \ public: \ virtual void new_notification(typename Notifier::Listener::Notification_type t) { \ @@ -263,7 +264,7 @@ private: \ #define CGAL_KINETIC_LISTEN2(Notifier, NOTIF, function, NOTIF2, function2) \ private: \ - struct Notifier##_listener: public Notifier::Listener { \ + class Notifier##_listener: public Notifier::Listener { \ CGAL_KINETIC_LISTENER_BASICS(Notifier##_listener, This); \ public: \ virtual void new_notification(typename Notifier::Listener::Notification_type t) { \ diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/Multi_listener.h b/Kinetic_data_structures/include/CGAL/Kinetic/Multi_listener.h index 9386971909d..af5eb4ea2ad 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/Multi_listener.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/Multi_listener.h @@ -179,7 +179,7 @@ private: \ -#define CGAL_KINETIC_MULTILISTENER2(A,B) private: \ +#define CGAL_KINETIC_MULTILISTENER2(A,B) private: \ struct Listener_core{ \ typedef typename This::Handle Notifier_handle; \ typedef enum {A,B} Notification_type; \ diff --git a/Kinetic_data_structures/include/CGAL/Tools/utility_macros.h b/Kinetic_data_structures/include/CGAL/Tools/utility_macros.h index a3421141fec..6942018679c 100644 --- a/Kinetic_data_structures/include/CGAL/Tools/utility_macros.h +++ b/Kinetic_data_structures/include/CGAL/Tools/utility_macros.h @@ -22,31 +22,22 @@ #ifndef CGAL_UTILITY_MACROS_H #define CGAL_UTILITY_MACROS_H -//#include - -/*namespace { - class Semicolon_eater{}; - }*/ - -#define CGAL_EAT_SEMICOLON -//friend class Semicolon_eater - #define CGAL_SUBSCRIPT(type, expr) type& operator[](unsigned int i){ expr;} \ - const type& operator[](unsigned int i) const { expr;} CGAL_EAT_SEMICOLON + const type& operator[](unsigned int i) const { expr;} #define CGAL_COPY_CONSTRUCTOR(TC) TC(const TC &o){copy_from(o);}\ - TC& operator=(const TC &o) {copy_from(o); return *this;} CGAL_EAT_SEMICOLON + TC& operator=(const TC &o) {copy_from(o); return *this;} // -#define CGAL_GET(type, name, expr) const type & name() const{expr;} CGAL_EAT_SEMICOLON -#define CGAL_GETOBJECT(UC, lc, expr) const UC & lc##_object() const {expr;} CGAL_EAT_SEMICOLON -#define CGAL_GETNR(type, name, expr) type name() const{expr;} CGAL_EAT_SEMICOLON +#define CGAL_GET(type, name, expr) const type & name() const{expr;} +#define CGAL_GETOBJECT(UC, lc, expr) const UC & lc##_object() const {expr;} +#define CGAL_GETNR(type, name, expr) type name() const{expr;} //#define CGAL_GET(type, name, expr) typename boost::call_traits::param_type name() const {expr;} -#define CGAL_IS(name, expr) bool is_##name() const {expr;} CGAL_EAT_SEMICOLON -#define CGAL_SET_IS(name, expr) void set_is_##name(bool tf) {expr;} CGAL_EAT_SEMICOLON +#define CGAL_IS(name, expr) bool is_##name() const {expr;} +#define CGAL_SET_IS(name, expr) void set_is_##name(bool tf) {expr;} -#define CGAL_SET(type, name, expr) void set_##name(const type &k) {expr;} CGAL_EAT_SEMICOLON +#define CGAL_SET(type, name, expr) void set_##name(const type &k) {expr;} template struct Utility_macros_param_type { @@ -62,7 +53,7 @@ struct Utility_macros_param_type { #define CGAL_FIELDRW(type, name, var) \ Utility_macros_param_type::R name() const {return var;} \ - void set_##name( Utility_macros_param_type::P k) {var=k;} CGAL_EAT_SEMICOLON + void set_##name( Utility_macros_param_type::P k) {var=k;} #define CGAL_OUTPUT(type) \ @@ -85,29 +76,29 @@ struct Utility_macros_param_type { #define CGAL_ITERATOR(uc_name, lc_name, it_type, bexpr, eexpr) \ typedef it_type uc_name##_iterator; \ uc_name##_iterator lc_name##s_begin() {bexpr;} \ - uc_name##_iterator lc_name##s_end() {eexpr;} CGAL_EAT_SEMICOLON + uc_name##_iterator lc_name##s_end() {eexpr;} #define CGAL_CONST_ITERATOR(uc_name, lc_name, it_type, bexpr, eexpr) \ typedef it_type uc_name##_const_iterator; \ uc_name##_const_iterator lc_name##s_begin() const {bexpr;} \ - uc_name##_const_iterator lc_name##s_end() const {eexpr;} CGAL_EAT_SEMICOLON + uc_name##_const_iterator lc_name##s_end() const {eexpr;} #define CGAL_FIND(ucname, expr) \ ucname##_const_iterator find(ucname##_key k) const {expr;} \ - ucname##_iterator find(ucname##_key k) {expr;} CGAL_EAT_SEMICOLON + ucname##_iterator find(ucname##_key k) {expr;} #define CGAL_CONST_FIND(ucname, expr) \ - ucname##_const_iterator find(ucname##_key k) const {expr;} CGAL_EAT_SEMICOLON + ucname##_const_iterator find(ucname##_key k) const {expr;} #define CGAL_INSERT(ucname, expr) \ - ucname##_iterator insert(ucname##_key k, const ucname &m) {expr;} CGAL_EAT_SEMICOLON + ucname##_iterator insert(ucname##_key k, const ucname &m) {expr;} #define CGAL_INSERTNK(ucname, expr) \ - ucname##_iterator insert(const ucname &m) {expr;} CGAL_EAT_SEMICOLON + ucname##_iterator insert(const ucname &m) {expr;} #define CGAL_SIZE(lcname, expr) \ - size_t number_of_##lcname() const {expr;} CGAL_EAT_SEMICOLON + size_t number_of_##lcname() const {expr;} #define CGAL_SWAP(type) \ inline void swap(type &a, type &b) { \ @@ -150,7 +141,7 @@ template \ } \ bool operator<=(const This &o) const { \ return compare(o) != CGAL::LARGER; \ - } CGAL_EAT_SEMICOLON + } #define CGAL_COMPARISONS_COMPARE bool operator==(const This &o) const { \ return compare(o)==0; \ @@ -169,7 +160,7 @@ template \ } \ bool operator<=(const This &o) const { \ return compare(o) <= 0; \ - } CGAL_EAT_SEMICOLON + } #define CGAL_COMPARISONS1(field) bool operator==(const This &o) const { \ @@ -189,7 +180,7 @@ template \ } \ bool operator<=(const This &o) const { \ return (field<= o.field); \ - } CGAL_EAT_SEMICOLON + } @@ -214,7 +205,7 @@ template \ } \ bool operator<=(const This &o) const { \ return !operator>(o); \ - } CGAL_EAT_SEMICOLON + } #define CGAL_COMPARISONS3(a, b, c) \ bool operator==(const This &o) const { \ @@ -242,7 +233,7 @@ template \ } \ bool operator<=(const This &o) const { \ return !operator>(o); \ - } CGAL_EAT_SEMICOLON + } #define CGAL_REAL_EMBEDDABLE_BODY \ class Abs \