Home | History | Annotate | Download | only in ruby
      1 /* ------------------------------------------------------------
      2  * Overloaded operator support
      3  * ------------------------------------------------------------ */
      4 
      5 #ifdef __cplusplus
      6 
      7 %rename(__add__)      *::operator+;
      8 %rename(__pos__)      *::operator+();
      9 %rename(__pos__)      *::operator+() const;
     10 %rename(__sub__)      *::operator-;
     11 %rename(__neg__)      *::operator-();
     12 %rename(__neg__)      *::operator-() const;
     13 %rename(__mul__)      *::operator*;
     14 %rename(__div__)      *::operator/;
     15 %rename(__mod__)      *::operator%;
     16 %rename(__lshift__)   *::operator<<;
     17 %rename(__rshift__)   *::operator>>;
     18 %rename(__and__)      *::operator&;
     19 %rename(__or__)       *::operator|;
     20 %rename(__xor__)      *::operator^;
     21 %rename(__invert__)   *::operator~;
     22 %rename(__lt__)       *::operator<;
     23 %rename(__le__)       *::operator<=;
     24 %rename(__gt__)       *::operator>;
     25 %rename(__ge__)       *::operator>=;
     26 %rename(__eq__)       *::operator==;
     27 
     28 /* Special cases */
     29 %rename(__call__)     *::operator();
     30 
     31 /* Ignored inplace operators */
     32 %ignoreoperator(NOTEQUAL)   operator!=;
     33 %ignoreoperator(PLUSEQ)     operator+=;
     34 %ignoreoperator(MINUSEQ)    operator-=;
     35 %ignoreoperator(MULEQ)      operator*=;
     36 %ignoreoperator(DIVEQ)      operator/=;
     37 %ignoreoperator(MODEQ)      operator%=;
     38 %ignoreoperator(LSHIFTEQ)   operator<<=;
     39 %ignoreoperator(RSHIFTEQ)   operator>>=;
     40 %ignoreoperator(ANDEQ)      operator&=;
     41 %ignoreoperator(OREQ)       operator|=;
     42 %ignoreoperator(XOREQ)      operator^=;
     43 
     44 /* Ignored operators */
     45 %ignoreoperator(LNOT)       operator!;
     46 %ignoreoperator(LAND)       operator&&;
     47 %ignoreoperator(LOR)        operator||;
     48 %ignoreoperator(EQ)         operator=;
     49 %ignoreoperator(PLUSPLUS)   operator++;
     50 %ignoreoperator(MINUSMINUS) operator--;
     51 %ignoreoperator(ARROWSTAR)  operator->*;
     52 %ignoreoperator(INDEX)      operator[];
     53 
     54 
     55 #endif /* __cplusplus */
     56