CodeSonar C++ API
[For improved navigation, enable JavaScript.]
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | Related Functions | List of all members
cs::func_attrs Class Reference

Flag class: describes the attributes of a symbol of kind symbol_kind::FUNCTION. More...

Public Member Functions

csint64 as_integer () const
 Get an integer representation of this. More...
 
std::string as_repr () const
 Get a representation of a func_attrs object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a func_attrs object. More...
 
int cmp (const func_attrs &other) const
 Comparison function for func_attrs, with respect to a stable overall ordering. More...
 
cs_hash_t hash () const
 Hash function for func_attrs. More...
 
std::string name () const
 Get the name of a func_attrs object. More...
 
func_attrsoperator &= (const func_attrs &other)
 AND-assign operator. More...
 
func_attrsoperator|= (const func_attrs &other)
 OR-assign operator. More...
 
func_attrs operator~ () const
 Complementation operator. More...
 

Static Public Member Functions

static func_attrs from_integer (csint64 _inner)
 Construct an instance from an integer representation. More...
 

Static Public Attributes

static const func_attrs ASSIGNMENT_OPERATOR
 Singleton set containing the "assignment operator" flag: the function is an operator= overload.
 
static const func_attrs 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.
 
static const func_attrs CONSTRUCTOR
 Singleton set containing the "constructor" flag: the function is a constructor.
 
static const func_attrs CS_GENERATED
 Singleton set containing the "CS-generated" flag: the function is synthesized by CodeSonar/CodeSurfer.
 
static const func_attrs 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. More...
 
static const func_attrs DECLARED_STATIC
 Singleton set containing the "declared-static" flag: this was declared with the keyword static.
 
static const func_attrs DESTRUCTOR
 Singleton set containing the "destructor" flag: the function is a destructor.
 
static const func_attrs FINALIZATION
 Singleton set containing the "finalization" flag: the function is declared with __attribute__((destructor)).
 
static const func_attrs INITIALIZATION
 Singleton set containing the "initialization" flag: the function is declared with __attribute__((constructor)) or is a C++/CLI "static constructor".
 
static const func_attrs INLINE_FUNCTION
 Singleton set containing the "inline function" flag: the function has inline linkage. More...
 
static const func_attrs LIBRARY
 Singleton set containing the "library" flag: __CSURF_MARKER_LIBRARY_FUNCTION__ was #define'd to 1 at the definition site of the function.
 
static const func_attrs MAIN
 Singleton set containing the "main" flag: this is a main or WinMain function.
 
static const func_attrs METHOD
 Singleton set containing the "method" flag: this is a method.
 
static const func_attrs MULTI_DEFINE
 Singleton set containing the "multi-define" flag: the linkage for this function permits multiple definitions. More...
 
static const func_attrs NONE
 Empty set: contains no flags. More...
 
static const func_attrs TEMPLATE
 Singleton set containing the "template" flag: the function is the result of a template instantiation.
 
static const func_attrs WEAK
 Singleton set containing the "weak" flag: the function has weak linkage (e.g., __attribute__((weak))).
 

Friends

func_attrs operator & (const func_attrs &a, const func_attrs &b)
 
func_attrs operator| (const func_attrs &a, const func_attrs &b)
 

Related Functions

(Note that these are not member functions.)

bool operator!= (const func_attrs &a, const func_attrs &b)
 Inequality operator for func_attrs. More...
 
func_attrs operator& (const func_attrs &a, const func_attrs &b)
 AND operator for func_attrs. More...
 
bool operator< (const func_attrs &a, const func_attrs &b)
 Less-than operator for func_attrs. More...
 
std::ostream & operator<< (std::ostream &out, const func_attrs &a)
 Print a representation of a func_attrs object to the specified stream. More...
 
bool operator<= (const func_attrs &a, const func_attrs &b)
 Less-than-or-equal operator for func_attrs. More...
 
bool operator== (const func_attrs &a, const func_attrs &b)
 Equality operator for func_attrs. More...
 
bool operator> (const func_attrs &a, const func_attrs &b)
 Greater-than operator for func_attrs. More...
 
bool operator>= (const func_attrs &a, const func_attrs &b)
 Greater-than-or-equal operator for func_attrs. More...
 
func_attrs operator| (const func_attrs &a, const func_attrs &b)
 OR operator for func_attrs. More...
 

Detailed Description

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.)

Member Function Documentation

◆ as_integer()

csint64 cs::func_attrs::as_integer ( ) const
inline

Get an integer representation of this.

Returns
An integer suitable for use with from_integer(). Invariant: For func_attrs x, func_attrs.from_integer(x.as_integer()) == x

◆ as_repr()

std::string cs::func_attrs::as_repr ( ) const
inline

Get a representation of a func_attrs object that includes information useful for debugging.

Returns
The string representation.

◆ as_string()

std::string cs::func_attrs::as_string ( ) const
inline

Get a simple string representation of a func_attrs object.

Returns
The string representation.

◆ cmp()

int cs::func_attrs::cmp ( const func_attrs other) const
inline

Comparison function for func_attrs, with respect to a stable overall ordering.

Parameters
otherThe func_attrs object to compare against.
Returns
An integer N such that:
  • N==0 if the two objects compare equal
  • N<0 if this < other
  • N>0 if this > other

◆ from_integer()

static func_attrs cs::func_attrs::from_integer ( csint64  _inner)
inlinestatic

Construct an instance from an integer representation.

Parameters
[in]_innerThe integer representation, as returned by as_integer(). Invariant: For func_attrs x, func_attrs.from_integer(x.as_integer()) == x
Exceptions
cs::result::ERROR_INVALID_ARGUMENTif _inner is not a valid integer representation for a func_attrs instance.

◆ hash()

cs_hash_t cs::func_attrs::hash ( ) const
inline

Hash function for func_attrs.

◆ name()

std::string cs::func_attrs::name ( ) const
inline

Get the name of a func_attrs object.

◆ operator &=()

func_attrs& cs::func_attrs::operator&= ( const func_attrs other)
inline

AND-assign operator.

Returns
A func_attrs object containing the flags that are contained in both this and other.

◆ operator|=()

func_attrs& cs::func_attrs::operator|= ( const func_attrs other)
inline

OR-assign operator.

Returns
A func_attrs object containing the flags that are contained in this, other, or both.

◆ operator~()

func_attrs cs::func_attrs::operator~ ( ) const
inline

Complementation operator.

Returns
A func_attrs object containing the flags that are NOT contained in this.

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const func_attrs a,
const func_attrs b 
)
related

Inequality operator for func_attrs.

Parameters
[in]aThe func_attrs object to compare.
[in]bThe func_attrs object to compare against.
Returns
false if a and b are equal according to func_attrs::cmp(), true otherwise.

◆ operator&()

func_attrs operator & ( const func_attrs a,
const func_attrs b 
)
related

AND operator for func_attrs.

Parameters
[in]aAND operand.
[in]bAND operand.
Returns
A func_attrs object containing all flags that are in both a and b.

◆ operator<()

bool operator< ( const func_attrs a,
const func_attrs b 
)
related

Less-than operator for func_attrs.

Parameters
[in]aThe func_attrs object to compare.
[in]bThe func_attrs object to compare against.
Returns
true if a < b according to func_attrs::cmp() , false otherwise.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  out,
const func_attrs a 
)
related

Print a representation of a func_attrs object to the specified stream.

Parameters
[in]outThe stream to print to.
[in]aThe func_attrs object to print.
Returns
void

◆ operator<=()

bool operator<= ( const func_attrs a,
const func_attrs b 
)
related

Less-than-or-equal operator for func_attrs.

Parameters
[in]aThe func_attrs object to compare.
[in]bThe func_attrs object to compare against.
Returns
true if a <= b according to func_attrs::cmp() , false otherwise.

◆ operator==()

bool operator== ( const func_attrs a,
const func_attrs b 
)
related

Equality operator for func_attrs.

Parameters
[in]aThe func_attrs object to compare.
[in]bThe func_attrs object to compare against.
Returns
true if a and b are equal according to func_attrs::cmp(), false otherwise.

◆ operator>()

bool operator> ( const func_attrs a,
const func_attrs b 
)
related

Greater-than operator for func_attrs.

Parameters
[in]aThe func_attrs object to compare.
[in]bThe func_attrs object to compare against.
Returns
true if a > b according to func_attrs::cmp() , false otherwise.

◆ operator>=()

bool operator>= ( const func_attrs a,
const func_attrs b 
)
related

Greater-than-or-equal operator for func_attrs.

Parameters
[in]aThe func_attrs object to compare.
[in]bThe func_attrs object to compare against.
Returns
true if a >= b according to func_attrs::cmp() , false otherwise.

◆ operator|()

func_attrs operator| ( const func_attrs a,
const func_attrs b 
)
related

OR operator for func_attrs.

Parameters
[in]aOR operand.
[in]bOR operand.
Returns
A func_attrs object containing all flags that are in at least one of a, b.

Member Data Documentation

◆ CSONAR_LIBRARY_REFINE

const func_attrs cs::func_attrs::CSONAR_LIBRARY_REFINE
static

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.

◆ INLINE_FUNCTION

const func_attrs cs::func_attrs::INLINE_FUNCTION
static

Singleton set containing the "inline function" flag: the function has inline linkage.

◆ MULTI_DEFINE

const func_attrs cs::func_attrs::MULTI_DEFINE
static

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.

◆ NONE

const func_attrs cs::func_attrs::NONE
static

Empty set: contains no flags.


The documentation for this class was generated from the following file: