Skip to content

Commit

Permalink
Added documentation for new macro
Browse files Browse the repository at this point in the history
  • Loading branch information
theZiz committed Oct 24, 2018
1 parent 7f594d5 commit 3d8a7e5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
18 changes: 17 additions & 1 deletion documentation/pages/user/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ In LLAMA this macro is extended for these combinations of :cpp:`OP` and
= Assigment
+= Addition
-= Subtraction
\*= Multiplication
\*= Multiplication
/= Division
%= Modulo
==== ==============
Expand All @@ -329,6 +329,22 @@ These three macros are extended for the same combinations of OP and FUNCTOR as
for :ref:`__LLAMA_DEFINE_FOREACH_FUNCTOR <label-define-foreach-functor>` with
:cpp:`REF` being :cpp:`&` and :cpp:`&&` for each combination.

.. doxygendefine:: __LLAMA_VIRTUALDATUM_NOT_IN_PLACE_OPERATOR_WITH_REF
:project: LLAMA

In LLAMA this macro is extended for these combinations of :cpp:`OP` and
:cpp:`INP_OP`:

==== ========
OP INP_OP
==== ========
\+ +=
\- -=
\* \*=
/ /=
% %=
==== ========

.. _label-define-foreach-bool-functor:

.. doxygendefine:: __LLAMA_DEFINE_FOREACH_BOOL_FUNCTOR
Expand Down
17 changes: 8 additions & 9 deletions include/llama/View.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,15 +422,14 @@ __LLAMA_DEFINE_FOREACH_FUNCTOR( %= , Modulo )
__LLAMA_VIRTUALDATUM_TYPE_OPERATOR( OP, FUNCTOR, & ) \
__LLAMA_VIRTUALDATUM_TYPE_OPERATOR( OP, FUNCTOR, && )

//~ /** Macro that defines an operator overloading inside of \ref llama::VirtualDatum for
//~ * itself and some other type.
//~ * \param OP operator, e.g. operator +=
//~ * \param FUNCTOR used for calling the internal needed functor to operate on
//~ * the virtual datums, e.g. if FUNCTOR is "Addition", the
//~ * AdditionTypeFunctor will be used internally.
//~ * \param REF may be & or && to determine whether it is an overloading for
//~ * lvalue or rvalue references
//~ * */
/** Macro that defines a non inplace operator overloading inside of
* \ref llama::VirtualDatum for itself and some other type based on the already
* exising inplace operation overload.
* \param OP operator, e.g. operator +
* \param INP_OP corresponding inplace operator, e.g. operator +=
* \param REF may be & or && to determine whether it is an overloading for
* lvalue or rvalue references
* */
#define __LLAMA_VIRTUALDATUM_NOT_IN_PLACE_OPERATOR_WITH_REF( OP, INP_OP, REF ) \
template< typename T_OtherType > \
LLAMA_FN_HOST_ACC_INLINE \
Expand Down

0 comments on commit 3d8a7e5

Please sign in to comment.