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::var_attrs Class Reference

Flag class: describes the attributes of a symbol of any kind EXCEPT 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 var_attrs object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a var_attrs object. More...
 
int cmp (const var_attrs &other) const
 Comparison function for var_attrs, with respect to a stable overall ordering. More...
 
cs_hash_t hash () const
 Hash function for var_attrs. More...
 
std::string name () const
 Get the name of a var_attrs object. More...
 
var_attrsoperator &= (const var_attrs &other)
 AND-assign operator. More...
 
var_attrsoperator|= (const var_attrs &other)
 OR-assign operator. More...
 
var_attrs operator~ () const
 Complementation operator. More...
 

Static Public Member Functions

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

Static Public Attributes

static const var_attrs NONE
 Empty set: contains no flags. More...
 
static const var_attrs THREADLOCAL
 Singleton set containing the "thread local" flag: the variable has thread-local storage (e.g., __thread).
 
static const var_attrs WEAK
 Singleton set containing the "weak" flag: the variable has weak linkage (e.g., __attribute__((weak))).
 

Friends

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

Related Functions

(Note that these are not member functions.)

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

Detailed Description

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

Member Function Documentation

◆ as_integer()

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

Get an integer representation of this.

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

◆ as_repr()

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

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

Returns
The string representation.

◆ as_string()

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

Get a simple string representation of a var_attrs object.

Returns
The string representation.

◆ cmp()

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

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

Parameters
otherThe var_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 var_attrs cs::var_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 var_attrs x, var_attrs.from_integer(x.as_integer()) == x
Exceptions
cs::result::ERROR_INVALID_ARGUMENTif _inner is not a valid integer representation for a var_attrs instance.

◆ hash()

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

Hash function for var_attrs.

◆ name()

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

Get the name of a var_attrs object.

◆ operator &=()

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

AND-assign operator.

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

◆ operator|=()

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

OR-assign operator.

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

◆ operator~()

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

Complementation operator.

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

Friends And Related Function Documentation

◆ operator!=()

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

Inequality operator for var_attrs.

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

◆ operator&()

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

AND operator for var_attrs.

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

◆ operator<()

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

Less-than operator for var_attrs.

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

◆ operator<<()

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

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

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

◆ operator<=()

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

Less-than-or-equal operator for var_attrs.

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

◆ operator==()

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

Equality operator for var_attrs.

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

◆ operator>()

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

Greater-than operator for var_attrs.

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

◆ operator>=()

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

Greater-than-or-equal operator for var_attrs.

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

◆ operator|()

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

OR operator for var_attrs.

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

Member Data Documentation

◆ NONE

const var_attrs cs::var_attrs::NONE
static

Empty set: contains no flags.


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