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

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

Static Public Member Functions

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

Static Public Attributes

static const xr_query_flags NONE
 Empty set: contains no flags. More...
 
static const xr_query_flags POPULATE_COUNTERS
 Singleton set containing the "populate counters" flag: compute and store tuple counts for later retrieval by xr_query_iterator get_*() functions. More...
 
static const xr_query_flags UNIQUIFY
 Singleton set containing the "uniquify" flag: specifies whether and how the query will perform 'uniquification' on its result set. More...
 

Friends

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

Related Functions

(Note that these are not member functions.)

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

Detailed Description

Flag class: additional properties for an xr_query.

Member Function Documentation

◆ as_integer()

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

Get an integer representation of this.

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

◆ as_repr()

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

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

Returns
The string representation.

◆ as_string()

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

Get a simple string representation of a xr_query_flags object.

Returns
The string representation.

◆ cmp()

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

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

Parameters
otherThe xr_query_flags 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 xr_query_flags cs::xr_query_flags::from_integer ( csint64  _inner)
inlinestatic

Construct an instance from an integer representation.

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

◆ hash()

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

Hash function for xr_query_flags.

◆ name()

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

Get the name of a xr_query_flags object.

◆ operator &=()

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

AND-assign operator.

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

◆ operator|=()

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

OR-assign operator.

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

◆ operator~()

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

Complementation operator.

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

Friends And Related Function Documentation

◆ operator!=()

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

Inequality operator for xr_query_flags.

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

◆ operator&()

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

AND operator for xr_query_flags.

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

◆ operator<()

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

Less-than operator for xr_query_flags.

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

◆ operator<<()

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

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

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

◆ operator<=()

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

Less-than-or-equal operator for xr_query_flags.

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

◆ operator==()

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

Equality operator for xr_query_flags.

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

◆ operator>()

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

Greater-than operator for xr_query_flags.

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

◆ operator>=()

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

Greater-than-or-equal operator for xr_query_flags.

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

◆ operator|()

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

OR operator for xr_query_flags.

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

Member Data Documentation

◆ NONE

const xr_query_flags cs::xr_query_flags::NONE
static

Empty set: contains no flags.

◆ POPULATE_COUNTERS

const xr_query_flags cs::xr_query_flags::POPULATE_COUNTERS
static

Singleton set containing the "populate counters" flag: compute and store tuple counts for later retrieval by xr_query_iterator get_*() functions.

The following are only available when this flag is specified.

◆ UNIQUIFY

const xr_query_flags cs::xr_query_flags::UNIQUIFY
static

Singleton set containing the "uniquify" flag: specifies whether and how the query will perform 'uniquification' on its result set.

Behavior depends on whether or not a comparison function qcmp for the xr_query has been specified with xr_query::set_cmp().

  • If qcmp is not specified:
    • If xr_query_flags::UNIQUIFY is specified, the query will return only unique tuples. (That is, if the raw result set contains a subset of tuples that are identical across all values, all but one of those tuples will be removed before returning the set.)
    • If xr_query_flags::UNIQUIFY is not specified, no uniquification is performed.
  • If cmp is specified:
    • If xr_query_flags::UNIQUIFY is specified, the query will perform uniquification with respect to qcmp: if the raw result set contains a subset of tuples that all compare equal according to qcmp, all but one of those tuples will be removed before returning the set.)
    • If xr_query_flags::UNIQUIFY is not specified, the query will perform uniquification with respect to complete tuple uniqueness (that is, the same unquification strategy as used when qcmp is not specified and xr_query_flags::UNIQUIFY is specified).

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