libabigail
Public Types | Public Member Functions | Public Attributes | List of all members
array_type_def::subrange_type::bound_value Class Reference

This class is to hold the value of the bound of a subrange. The value can be either signed or unsigned, at least when it comes from DWARF. The class keeps the sign information, but allows users to access the value as signed or unsigned as they see fit. More...

#include <abg-ir.h>

Public Types

enum  signedness { UNSIGNED_SIGNEDNESS , SIGNED_SIGNEDNESS }
 

Public Member Functions

 bound_value ()
 Default constructor of the array_type_def::subrange_type::bound_value class. More...
 
 bound_value (int64_t)
 Initialize a signed bound_value with a given value. More...
 
 bound_value (uint64_t)
 Initialize an unsigned bound_value with a given value. More...
 
int64_t get_signed_value () const
 Getter of the bound value as a signed value. More...
 
enum signedness get_signedness () const
 Getter of the signedness (unsigned VS signed) of the bound value. More...
 
uint64_t get_unsigned_value ()
 Getter of the bound value as an unsigned value. More...
 
bool operator== (const bound_value &) const
 Equality operator of the bound value. More...
 
void set_signed (int64_t v)
 Setter of the bound value as signed. More...
 
void set_signedness (enum signedness s)
 Setter of the signedness (unsigned VS signed) of the bound value. More...
 
void set_unsigned (uint64_t v)
 Setter of the bound value as unsigned. More...
 

Public Attributes

union {
   int64_t   signed_
 
   uint64_t   unsigned_
 
v_
 

Detailed Description

This class is to hold the value of the bound of a subrange. The value can be either signed or unsigned, at least when it comes from DWARF. The class keeps the sign information, but allows users to access the value as signed or unsigned as they see fit.

Definition at line 2559 of file abg-ir.h.

Constructor & Destructor Documentation

◆ bound_value() [1/3]

Default constructor of the array_type_def::subrange_type::bound_value class.

Constructs an unsigned bound_value of value zero.

Definition at line 18729 of file abg-ir.cc.

◆ bound_value() [2/3]

bound_value ( uint64_t  v)

Initialize an unsigned bound_value with a given value.

Parameters
vthe initial bound value.

Definition at line 18738 of file abg-ir.cc.

◆ bound_value() [3/3]

bound_value ( int64_t  v)

Initialize a signed bound_value with a given value.

Parameters
vthe initial bound value.

Definition at line 18747 of file abg-ir.cc.

Member Function Documentation

◆ get_signed_value()

int64_t get_signed_value ( ) const

Getter of the bound value as a signed value.

Returns
the bound value as signed.

Definition at line 18771 of file abg-ir.cc.

◆ get_signedness()

enum array_type_def::subrange_type::bound_value::signedness get_signedness ( ) const

Getter of the signedness (unsigned VS signed) of the bound value.

Returns
the signedness of the bound value.

Definition at line 18747 of file abg-ir.cc.

◆ get_unsigned_value()

uint64_t get_unsigned_value ( )

Getter of the bound value as an unsigned value.

Returns
the bound value as unsigned.

Definition at line 18779 of file abg-ir.cc.

◆ operator==()

bool operator== ( const bound_value v) const

Equality operator of the bound value.

Parameters
vthe other bound value to compare with.
Returns
true iff the current bound value equals v.

Definition at line 18808 of file abg-ir.cc.

◆ set_signed()

void set_signed ( int64_t  v)

Setter of the bound value as signed.

Parameters
vthe new signed value.

Definition at line 18796 of file abg-ir.cc.

◆ set_signedness()

void set_signedness ( enum signedness  s)

Setter of the signedness (unsigned VS signed) of the bound value.

Parameters
sthe new signedness of the bound value.

Definition at line 18764 of file abg-ir.cc.

◆ set_unsigned()

void set_unsigned ( uint64_t  v)

Setter of the bound value as unsigned.

Parameters
vthe new unsigned value.

Definition at line 18786 of file abg-ir.cc.


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