[PPL-devel] [GIT] ppl/ppl(floating_point): Commented and moved methods is() and as().
Fabio Bossi
bossi at cs.unipr.it
Wed Jul 28 09:49:01 CEST 2010
Module: ppl/ppl
Branch: floating_point
Commit: ba58fa9f47cfefd4464f8e366e34ae92beded2d3
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=ba58fa9f47cfefd4464f8e366e34ae92beded2d3
Author: Fabio Bossi <bossi at cs.unipr.it>
Date: Wed Jul 28 09:47:52 2010 +0200
Commented and moved methods is() and as().
Make check not working due to bad implementation of is().
---
src/Concrete_Expression.defs.hh | 23 ++++++++++++-----------
src/Concrete_Expression.inlines.hh | 23 +++++++++++++++++++++++
2 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/src/Concrete_Expression.defs.hh b/src/Concrete_Expression.defs.hh
index 3bafbbd..d52cad6 100644
--- a/src/Concrete_Expression.defs.hh
+++ b/src/Concrete_Expression.defs.hh
@@ -124,22 +124,23 @@ public:
//! Returns the kind of \* this.
Concrete_Expression_Kind kind() const;
+ //! Tests if \p *this has the same kind as <CODE>Derived<Target></CODE>.
template <template <typename T> class Derived>
- bool is() const {
- return Concrete_Expression<Target>::kind() == Derived<Target>::KIND;
- }
+ bool is() const;
+ /*! \brief
+ Returns a pointer to \p *this converted to type
+ <CODE>Derived<Target>*</CODE>.
+ */
template <template <typename T> class Derived>
- Derived<Target>* as() {
- PPL_ASSERT(is<Derived>());
- return static_cast<Derived<Target>*>(this);
- }
+ Derived<Target>* as();
+ /*! \brief
+ Returns a pointer to \p *this converted to type
+ <CODE>const Derived<Target>*</CODE>.
+ */
template <template <typename T> class Derived>
- const Derived<Target>* as() const {
- PPL_ASSERT(is<Derived>());
- return static_cast<const Derived<Target>*>(this);
- }
+ const Derived<Target>* as() const;
};
diff --git a/src/Concrete_Expression.inlines.hh b/src/Concrete_Expression.inlines.hh
index c812919..1d1d222 100644
--- a/src/Concrete_Expression.inlines.hh
+++ b/src/Concrete_Expression.inlines.hh
@@ -88,6 +88,29 @@ Concrete_Expression_Type::floating_point_format() const {
return impl.floating_point_format;
}
+template <typename Target>
+template <template <typename T> class Derived>
+inline bool
+Concrete_Expression_Common<Target>::is() const {
+ return Concrete_Expression<Target>::kind() == Derived<Target>::KIND;
+}
+
+template <typename Target>
+template <template <typename T> class Derived>
+inline Derived<Target>*
+Concrete_Expression_Common<Target>::as() {
+ PPL_ASSERT(is<Derived>());
+ return static_cast<Derived<Target>*>(this);
+}
+
+template <typename Target>
+template <template <typename T> class Derived>
+inline const Derived<Target>*
+Concrete_Expression_Common<Target>::as() const {
+ PPL_ASSERT(is<Derived>());
+ return static_cast<const Derived<Target>*>(this);
+}
+
} // namespace Parma_Polyhedra_Library
#endif // !defined(PPL_Concrete_Expression_inlines_hh)
More information about the PPL-devel
mailing list