class var_attrs¶
Flag class: describes the attributes of a symbol of any kind EXCEPT symbol_kind.FUNCTION.
(Attributes for symbols of kind symbol_kind.FUNCTION are described by objects of class func_attrs .)
var_attrs Members¶
| Constructors | none |
| Static Method | from_integer() |
| Methods | __and__(), __cmp__(), __eq__(), __ge__(), __gt__(), __hash__(), __invert__(), __le__(), __lt__(), __ne__(), __or__(), __repr__(), __str__(), as_integer(), name() |
| Attributes | NONE, THREADLOCAL, WEAK |
var_attrs Details¶
-
class
cs.var_attrs¶ Flag class: describes the attributes of a
symbolof any kind EXCEPTsymbol_kind.FUNCTION.-
static
from_integer(_inner)¶ Construct an instance from an integer representation.
Parameters: _inner (int) – The integer representation, as returned by var_attrs.as_integer().Return type: var_attrsRaises: result.ERROR_INVALID_ARGUMENTif_inneris not a valid integer representation for avar_attrsinstance.Invariant: For
var_attrsx, var_attrs.from_integer(x.as_integer()) == x>>> va = (var_attrs.WEAK | var_attrs.THREADLOCAL).as_integer() >>> va 3 >>> var_attrs.from_integer(va) <cs.var_attrs weak|threadlocal>
-
__and__(b)¶ AND operator for
var_attrs.Parameters: b ( var_attrs) – AND operand.Return type: var_attrsReturns: A var_attrsobject containing all flags that are in bothselfandb.>>> var_attrs.THREADLOCAL & var_attrs.WEAK <cs.var_attrs none>
-
__cmp__(other)¶ Comparison function for
var_attrs, with respect to a stable overall ordering.Parameters: other ( var_attrs) – Thevar_attrsobject to compare against.Return type: int Returns: An integer N such that: - N==0 if the two objects compare equal
- N<0 if
self< other - N>0 if
self> other
>>> var_attrs.WEAK.__cmp__(var_attrs.THREADLOCAL) -1
-
__eq__(b)¶ Equality operator for
var_attrs.Parameters: b ( var_attrs) – Thevar_attrsobject to compare against.Return type: bool Returns: Trueifselfandbcompare equal,Falseotherwise.>>> var_attrs.WEAK == var_attrs.NONE False
-
__ge__(b)¶ Greater-than-or-equal operator for
var_attrs.Parameters: b ( var_attrs) – Thevar_attrsobject to compare against.Return type: bool Returns: Trueifself>=b,Falseotherwise.>>> var_attrs.THREADLOCAL >= var_attrs.THREADLOCAL True
-
__gt__(b)¶ Greater-than operator for
var_attrs.Parameters: b ( var_attrs) – Thevar_attrsobject to compare against.Return type: bool Returns: Trueifself>b,Falseotherwise.>>> var_attrs.WEAK > var_attrs.NONE True
-
__invert__()¶ Complementation operator.
Return type: var_attrsReturns: A var_attrsobject containing the flags that are NOT contained inself.>>> ~var_attrs.WEAK <cs.var_attrs threadlocal>
-
__le__(b)¶ Less-than-or-equal operator for
var_attrs.Parameters: b ( var_attrs) – Thevar_attrsobject to compare against.Return type: bool Returns: Trueifself<=b,Falseotherwise.>>> var_attrs.THREADLOCAL <= var_attrs.WEAK False
-
__lt__(b)¶ Less-than operator for
var_attrs.Parameters: b ( var_attrs) – Thevar_attrsobject to compare against.Return type: bool Returns: Trueifself<b,Falseotherwise.>>> var_attrs.NONE < var_attrs.THREADLOCAL True
-
__ne__(b)¶ Inequality operator for
var_attrs.Parameters: b ( var_attrs) – Thevar_attrsobject to compare against.Return type: bool Returns: Falseifselfandbcompare equal,Trueotherwise.>>> var_attrs.WEAK != var_attrs.THREADLOCAL True
-
__or__(b)¶ OR operator for
var_attrs.Parameters: b ( var_attrs) – OR operand.Return type: var_attrsReturns: A var_attrsobject containing all flags that are in at least one ofself,b.>>> var_attrs.NONE | var_attrs.THREADLOCAL <cs.var_attrs threadlocal>
-
__repr__()¶ Get a representation of a
var_attrsobject that includes information useful for debugging.Return type: str Returns: The string representation. >>> repr(var_attrs.WEAK) '<cs.var_attrs weak>'
-
__str__()¶ Get a simple string representation of a
var_attrsobject.Return type: str Returns: The string representation. >>> str(var_attrs.NONE) 'none'
-
as_integer()¶ Get an integer representation of
self.Return type: int Returns: An integer suitable for use with var_attrs.from_integer().Invariant: For
var_attrsx, var_attrs.from_integer(x.as_integer()) == x>>> va = (var_attrs.WEAK | var_attrs.THREADLOCAL).as_integer() >>> va 3 >>> var_attrs.from_integer(va) <cs.var_attrs weak|threadlocal>
-
NONE¶ Empty set: contains no flags.
>>> var_attrs.NONE <cs.var_attrs none>
-
THREADLOCAL¶ Singleton set containing the “thread local” flag: the variable has thread-local storage (e.g.,
__thread).>>> var_attrs.THREADLOCAL <cs.var_attrs threadlocal>
-
WEAK¶ Singleton set containing the “weak” flag: the variable has weak linkage (e.g.,
__attribute__((weak))).>>> var_attrs.WEAK <cs.var_attrs weak>
-
static