FreePOOMA  2.4.1
Classes | Defines
ComponentAccess.h File Reference

ComponentAccess<Container, Comp> is a general functor class that users can specialize to tell POOMA how to access components inside an object used as an element in expressions. More...

This graph shows which files directly or indirectly include this file:

Classes

class  ComponentWrapper< Components >
 Wrapper class to encapsulate a component specification. More...
struct  ComponentAccess< T, Components >
 ComponentAccess is an interface class that is used to provide an API for accessing components of a composite type. More...

Defines

#define POOMA_COMPONENT_ACCESS(IN, TAG, TYPE, MEMBER)

Detailed Description

ComponentAccess<Container, Comp> is a general functor class that users can specialize to tell POOMA how to access components inside an object used as an element in expressions.

(For example, Vector, Tensor etc.)


Define Documentation

#define POOMA_COMPONENT_ACCESS (   IN,
  TAG,
  TYPE,
  MEMBER 
)
Value:
\
struct TAG                                                              \
{                                                                       \
  TAG() { }                                                             \
  TAG(const TAG &) { }                                                  \
};                                                                      \
                                                                        \
template<>                                                              \
struct ComponentAccess<IN, TAG>                                         \
{                                                                       \
  typedef TYPE Element_t;                                               \
  typedef TYPE &ElementRef_t;                                           \
                                                                        \
  static inline ElementRef_t indexRef(IN &in, const TAG &)              \
  {                                                                     \
    return in.MEMBER;                                                   \
  }                                                                     \
                                                                        \
  static inline Element_t index(const IN &in, const TAG &)              \
  {                                                                     \
    return in.MEMBER;                                                   \
  }                                                                     \
};