class func_attrs¶
Flag class: describes the attributes of a symbol of kind symbol_kind.FUNCTION.
(Attributes for symbols of all other kinds are described by objects of class var_attrs .)
func_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 | ASSIGNMENT_OPERATOR, COMPILER_GENERATED, CONSTRUCTOR, CSONAR_LIBRARY_REFINE, CS_GENERATED, DECLARED_STATIC, DESTRUCTOR, FINALIZATION, INITIALIZATION, INLINE_FUNCTION, LIBRARY, MAIN, METHOD, MULTI_DEFINE, NONE, TEMPLATE, WEAK |
func_attrs Details¶
-
class
cs.func_attrs¶ Flag class: describes the attributes of a
symbolof kindsymbol_kind.FUNCTION.-
static
from_integer(_inner)¶ Construct an instance from an integer representation.
Parameters: _inner (int) – The integer representation, as returned by func_attrs.as_integer().Return type: func_attrsRaises: result.ERROR_INVALID_ARGUMENTif_inneris not a valid integer representation for afunc_attrsinstance.Invariant: For
func_attrsx, func_attrs.from_integer(x.as_integer()) == x>>> fa = (func_attrs.WEAK|func_attrs.MAIN).as_integer() >>> fa 8193 >>> func_attrs.from_integer(fa) <cs.func_attrs weak|main>
-
__and__(b)¶ AND operator for
func_attrs.Parameters: b ( func_attrs) – AND operand.Return type: func_attrsReturns: A func_attrsobject containing all flags that are in bothselfandb.>>> func_attrs.WEAK & func_attrs.COMPILER_GENERATED <cs.func_attrs none>
-
__cmp__(other)¶ Comparison function for
func_attrs, with respect to a stable overall ordering.Parameters: other ( func_attrs) – Thefunc_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
>>> func_attrs.MAIN.__cmp__(func_attrs.LIBRARY) 1
-
__eq__(b)¶ Equality operator for
func_attrs.Parameters: b ( func_attrs) – Thefunc_attrsobject to compare against.Return type: bool Returns: Trueifselfandbcompare equal,Falseotherwise.>>> func_attrs.MULTI_DEFINE == func_attrs.INITIALIZATION False
-
__ge__(b)¶ Greater-than-or-equal operator for
func_attrs.Parameters: b ( func_attrs) – Thefunc_attrsobject to compare against.Return type: bool Returns: Trueifself>=b,Falseotherwise.>>> func_attrs.NONE >= func_attrs.CSONAR_LIBRARY_REFINE False
-
__gt__(b)¶ Greater-than operator for
func_attrs.Parameters: b ( func_attrs) – Thefunc_attrsobject to compare against.Return type: bool Returns: Trueifself>b,Falseotherwise.>>> func_attrs.FINALIZATION > func_attrs.ASSIGNMENT_OPERATOR False
-
__hash__()¶ Hash function for
func_attrs.Return type: int >>> hash(func_attrs.CS_GENERATED) 64
-
__invert__()¶ Complementation operator.
Return type: func_attrsReturns: A func_attrsobject containing the flags that are NOT contained inself.>>> ~func_attrs.CSONAR_LIBRARY_REFINE <cs.func_attrs weak|inline|initialization|finalization|library|compiler-generated|cs-generated|constructor|destructor|assignment-operator|template|multi-define|main|method|declared-static>
-
__le__(b)¶ Less-than-or-equal operator for
func_attrs.Parameters: b ( func_attrs) – Thefunc_attrsobject to compare against.Return type: bool Returns: Trueifself<=b,Falseotherwise.>>> func_attrs.INITIALIZATION <= func_attrs.ASSIGNMENT_OPERATOR True
-
__lt__(b)¶ Less-than operator for
func_attrs.Parameters: b ( func_attrs) – Thefunc_attrsobject to compare against.Return type: bool Returns: Trueifself<b,Falseotherwise.>>> func_attrs.INLINE_FUNCTION < func_attrs.COMPILER_GENERATED True
-
__ne__(b)¶ Inequality operator for
func_attrs.Parameters: b ( func_attrs) – Thefunc_attrsobject to compare against.Return type: bool Returns: Falseifselfandbcompare equal,Trueotherwise.>>> func_attrs.TEMPLATE != func_attrs.DESTRUCTOR True
-
__or__(b)¶ OR operator for
func_attrs.Parameters: b ( func_attrs) – OR operand.Return type: func_attrsReturns: A func_attrsobject containing all flags that are in at least one ofself,b.>>> func_attrs.LIBRARY | func_attrs.CONSTRUCTOR <cs.func_attrs library|constructor>
-
__repr__()¶ Get a representation of a
func_attrsobject that includes information useful for debugging.Return type: str Returns: The string representation. >>> repr(func_attrs.INLINE_FUNCTION) '<cs.func_attrs inline>'
-
__str__()¶ Get a simple string representation of a
func_attrsobject.Return type: str Returns: The string representation. >>> str(func_attrs.CS_GENERATED) 'cs-generated'
-
as_integer()¶ Get an integer representation of
self.Return type: int Returns: An integer suitable for use with func_attrs.from_integer().Invariant: For
func_attrsx, func_attrs.from_integer(x.as_integer()) == x>>> fa = (func_attrs.WEAK|func_attrs.MAIN).as_integer() >>> fa 8193 >>> func_attrs.from_integer(fa) <cs.func_attrs weak|main>
-
name()¶ Get the name of a
func_attrsobject.Return type: str >>> func_attrs.ASSIGNMENT_OPERATOR.name() 'assignment-operator'
-
ASSIGNMENT_OPERATOR¶ Singleton set containing the “assignment operator” flag: the function is an operator= overload.
>>> func_attrs.ASSIGNMENT_OPERATOR <cs.func_attrs assignment-operator>
-
COMPILER_GENERATED¶ Singleton set containing the “compiler-generated” flag: the function is synthesized by the compiler; its definition does not appear in the source code.
>>> func_attrs.COMPILER_GENERATED <cs.func_attrs compiler-generated>
-
CONSTRUCTOR¶ Singleton set containing the “constructor” flag: the function is a constructor.
>>> func_attrs.CONSTRUCTOR <cs.func_attrs constructor>
-
CSONAR_LIBRARY_REFINE¶ Singleton set containing the “CodeSonar library refine” flag: CodeSonar is encouraged to “step into” this function if it is summarized along a path.
Normally, CodeSonar does not step into library models summarized in the middle of a path. This flag is not meaningful for non-library-model functions, or for any function in a CodeSurfer project.
>>> func_attrs.CSONAR_LIBRARY_REFINE <cs.func_attrs csonar-library-refine>
-
CS_GENERATED¶ Singleton set containing the “CS-generated” flag: the function is synthesized by CodeSonar/CodeSurfer.
>>> func_attrs.CS_GENERATED <cs.func_attrs cs-generated>
-
DECLARED_STATIC¶ Singleton set containing the “declared-static” flag: this was declared with the keyword static.
>>> func_attrs.DECLARED_STATIC <cs.func_attrs declared-static>
-
DESTRUCTOR¶ Singleton set containing the “destructor” flag: the function is a destructor.
>>> func_attrs.DESTRUCTOR <cs.func_attrs destructor>
-
FINALIZATION¶ Singleton set containing the “finalization” flag: the function is declared with
__attribute__((destructor)).>>> func_attrs.FINALIZATION <cs.func_attrs finalization>
-
INITIALIZATION¶ Singleton set containing the “initialization” flag: the function is declared with
__attribute__((constructor))or is a C++/CLI “static constructor”.>>> func_attrs.INITIALIZATION <cs.func_attrs initialization>
-
INLINE_FUNCTION¶ Singleton set containing the “inline function” flag: the function has inline linkage.
>>> func_attrs.INLINE_FUNCTION <cs.func_attrs inline>
-
LIBRARY¶ Singleton set containing the “library” flag:
__CSURF_MARKER_LIBRARY_FUNCTION__was #define’d to 1 at the definition site of the function.>>> func_attrs.LIBRARY <cs.func_attrs library>
-
MAIN¶ Singleton set containing the “main” flag: this is a main or WinMain function.
>>> func_attrs.MAIN <cs.func_attrs main>
-
METHOD¶ Singleton set containing the “method” flag: this is a method.
>>> func_attrs.METHOD <cs.func_attrs method>
-
MULTI_DEFINE¶ Singleton set containing the “multi-define” flag: the linkage for this function permits multiple definitions.
Functions with non-static weak or inline linkage, for example, would have this flag.
>>> func_attrs.MULTI_DEFINE <cs.func_attrs multi-define>
-
NONE¶ Empty set: contains no flags.
>>> func_attrs.NONE <cs.func_attrs none>
-
TEMPLATE¶ Singleton set containing the “template” flag: the function is the result of a template instantiation.
>>> func_attrs.TEMPLATE <cs.func_attrs template>
-
WEAK¶ Singleton set containing the “weak” flag: the function has weak linkage (e.g.,
__attribute__((weak))).>>> func_attrs.WEAK <cs.func_attrs weak>
-
static