include/basix/object_format.hpp File Reference

#include <basix/string.hpp>
#include <basix/generic.hpp>

Go to the source code of this file.

Classes

Namespaces

Defines


Define Documentation

#define DEFINE_OBJECT_FORMAT ( Obj,
Cat   ) 
Value:
STMPL struct format<Obj >: public object_format<Obj,Cat> {      \
  typedef object_format<Obj,Cat> FT;                            \
  inline format (): FT (no_format ()) {}                        \
  inline format (const no_format& nfm): FT (nfm) {}             \
  inline format (const Cat& tp): FT (tp) {}                     \
  inline format (const FT& x): FT (x) {}                        \
  inline format (const format<Obj >& fm): FT (fm.rfm()) {}      \
  inline format<Obj > tfm () const { return *this; }            \
  inline Obj sample () const {                                  \
    return Obj (get_sample (this->tp), this->tp); }             \
};                                                              \
                                                                \
inline format<Obj>                                              \
copy (const format<Obj> &x) { return format<Obj> (x); }         \
inline bool                                                     \
operator == (const format<Obj>& x, const format<Obj>& y) {      \
  return x.tp == y.tp; }                                        \
inline bool                                                     \
operator != (const format<Obj>& x, const format<Obj>& y) {      \
  return x.tp != y.tp; }                                        \
inline bool                                                     \
exact_eq (const format<Obj>& x, const format<Obj>& y) {         \
  return exact_eq (x.tp, y.tp); }                               \
inline bool                                                     \
exact_neq (const format<Obj>& x, const format<Obj>& y) {        \
  return exact_neq (x.tp, y.tp); }                              \
inline bool                                                     \
hard_eq (const format<Obj>& x, const format<Obj>& y) {          \
  return hard_eq (x.tp, y.tp); }                                \
inline bool                                                     \
hard_neq (const format<Obj>& x, const format<Obj>& y) {         \
  return hard_neq (x.tp, y.tp); }                               \
inline nat                                                      \
hash (const format<Obj>& x) {                                   \
  return hash (x.tp); }                                         \
inline nat                                                      \
exact_hash (const format<Obj>& x) {                             \
  return exact_hash (x.tp); }                                   \
inline nat                                                      \
hard_hash (const format<Obj>& x) {                              \
  return hard_hash (x.tp); }                                    \
inline syntactic                                                \
flatten (const format<Obj>& x) {                                \
  string name= cpp_demangle (typeid (format<Obj>).name ());     \
  return apply (flatten (lit (name)), flatten (x.tp)); }        \
inline format<Obj>                                              \
get_format (const Obj& x) {                                     \
  return format<Obj> (x->tp); }

Definition at line 36 of file object_format.hpp.

#define TMPL   template<typename C>

Definition at line 19 of file object_format.hpp.


Generated on 6 Dec 2012 for basix by  doxygen 1.6.1