CodeSonar C++ API
[For improved navigation, enable JavaScript.]
Public Types | Public Member Functions | List of all members
cs::xform_expr Class Reference

Specifies parts of a query expression for step_xform::query() or step_xform::query_bounds(). More...

Public Types

typedef const cs_xform_expr * ctype
 

Public Member Functions

 xform_expr (symbol _base, const std::vector< access_path > &_ap=std::vector< access_path >(), const std::string &_attribute="", xform_expr_mode _mode=xform_expr_mode::POST, csint32 _a=1, csint32 _b=0, csint32 _c=1)
 Constructor for an xform_expr object representing expression (ax + b)/c, where x is an attribute attached to some memory location. More...
 
 xform_expr (csint32 _b, csint32 _c=1)
 Constructor for a constant-valued xform_expr object with value b/c. More...
 
std::string as_repr () const
 Get a representation of a xform_expr object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a xform_expr object. More...
 

Detailed Description

Specifies parts of a query expression for step_xform::query() or step_xform::query_bounds().

Represents an expression of the form (ax+b)/c, where x is an attribute attached to the memory location obtained by applying a specified access path to a specified base symbol.

May also represent a constant expression b/c.

Constructor & Destructor Documentation

◆ xform_expr() [1/2]

cs::xform_expr::xform_expr ( symbol  _base,
const std::vector< access_path > &  _ap = std::vector<access_path>(),
const std::string &  _attribute = "",
xform_expr_mode  _mode = xform_expr_mode::POST,
csint32  _a = 1,
csint32  _b = 0,
csint32  _c = 1 
)
inline

Constructor for an xform_expr object representing expression (ax + b)/c, where x is an attribute attached to some memory location.

Parameters
[in]_baseThe base for x.
[in]_apThe access path for the memory location of which x is an attribute (based at _base)
[in]_attributeThe attribute x.
[in]_modeThe temporal mode for evaluation of x.
[in]_aThe coefficient a in the expression (ax + b)/c.
[in]_bThe constant b in the expression (ax + b)/c.
[in]_cThe denominator c in the expression (ax + b)/c.

Constructs an xform_expr object representing expression (ax + b)/c, where:

Exceptions
result::ERROR_INVALID_ATTRIBUTEif _attribute is not a known attribute.
result::ERROR_INVALID_OPERATORif _ap specifies an invalid sequence of operators.
result::ERROR_INVALID_ARGUMENTin the following cases:
result::ERROR_PARAMETER_TOO_LARGEif the offset_in_bits field of an offset cs::access_path cannot be represented as a 32-bit signed integer.

◆ xform_expr() [2/2]

cs::xform_expr::xform_expr ( csint32  _b,
csint32  _c = 1 
)
inline

Constructor for a constant-valued xform_expr object with value b/c.

Parameters
[in]_bThe numerator of the constant expression.
[in]_cThe denominator of the constant expression.
Exceptions
result::ERROR_INVALID_ARGUMENTin the following cases:
  • _b is -2147483648
  • _c is -2147483648
  • _c is 0

The xform_expr object will be created with xform_expr_mode::PRE.

Member Function Documentation

◆ as_repr()

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

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

Returns
The string representation.

◆ as_string()

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

Get a simple string representation of a xform_expr object.

Returns
The string representation.

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