Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
include
osl
effectContent.h
Go to the documentation of this file.
1
/* effectContent.h
2
*/
3
#ifndef OSL_EFFECTCONTENT_H
4
#define OSL_EFFECTCONTENT_H
5
6
#include "
osl/offset.h
"
7
8
namespace
osl
9
{
10
class
EffectContent
11
{
12
int
effect
;
13
EffectContent
(
int
value) :
effect
(value)
14
{
15
}
16
public
:
17
EffectContent
() :
effect
(0)
18
{
19
}
20
explicit
EffectContent
(
Offset
offset
)
21
:
effect
(offset.
intValue
() << 1)
22
{
23
}
24
static
const
EffectContent
DIRECT
() {
return
EffectContent
(1); }
28
static
const
EffectContent
DIRECT
(
Offset
offset
) {
29
return
EffectContent
((offset.
intValue
() << 1)+1);
30
}
34
bool
hasEffect
()
const
{
return
effect
; }
38
bool
hasUnblockableEffect
()
const
{
return
(
effect
& 1); }
44
const
Offset
offset
()
const
{
return
Offset::makeDirect
(
effect
>> 1); }
48
bool
hasBlockableEffect
()
const
{
49
return
(
effect
& (-
effect
) & ~1) != 0;
50
}
51
int
intValue
()
const
{
return
effect
; }
52
};
53
54
inline
bool
operator==
(
EffectContent
l,
EffectContent
r)
55
{
56
return
l.
intValue
() == r.
intValue
();
57
}
58
inline
bool
operator!=
(
EffectContent
l,
EffectContent
r)
59
{
60
return
! (l == r);
61
}
62
inline
bool
operator<
(
EffectContent
l,
EffectContent
r)
63
{
64
return
l.
intValue
() < r.
intValue
();
65
}
66
67
}
// namespace osl
68
69
#endif
/* OSL_EFFECTCONTENT_H */
70
// ;;; Local Variables:
71
// ;;; mode:c++
72
// ;;; c-basic-offset:2
73
// ;;; End:
Generated on Sun Jul 21 2013 13:37:24 by
1.8.4