Nemiver  0.3
Public Types | Public Member Functions | List of all members
nemiver::IDebugger::Variable Class Reference

#include <nmv-i-debugger.h>

Inheritance diagram for nemiver::IDebugger::Variable:
nemiver::common::Object

Public Types

enum  Format {
  UNDEFINED_FORMAT = 0, BINARY_FORMAT, DECIMAL_FORMAT, HEXADECIMAL_FORMAT,
  OCTAL_FORMAT, NATURAL_FORMAT, UNKNOWN_FORMAT
}
 

Public Member Functions

 Variable (const UString &a_internal_name, const UString &a_name, const UString &a_value, const UString &a_type, bool a_in_scope=true, IDebugger *a_dbg=0)
 
 Variable (const UString &a_name, const UString &a_value, const UString &a_type, bool a_in_scope=true, IDebugger *a_dbg=0)
 
 Variable (const UString &a_name, IDebugger *a_dbg=0)
 
 Variable (IDebugger *a_dbg=0)
 
 ~Variable ()
 
const VariableListmembers () const
 
VariableListmembers ()
 
bool get_member_at (int a_index, VariableSafePtr &a_var) const
 
int sibling_index () const
 
bool operator== (const Variable &a_other) const
 
bool equals (const Variable &a_other) const
 
bool equals_by_value (const Variable &a_other) const
 
void append (const VariableSafePtr &a_var)
 
const UStringinternal_name () const
 
void internal_name (const UString &a_in)
 
const UStringid () const
 
IDebuggerdebugger () const
 
void debugger (IDebugger *a_dbg)
 
const UStringname () const
 
void name (const UString &a_name)
 
const UStringname_caption () const
 
void name_caption (const UString &a_n)
 
const UStringvalue () const
 
void value (const UString &a_value)
 
const UStringtype () const
 
void type (const UString &a_type)
 
void type (const string &a_type)
 
const UStringvisualizer () const
 
void visualizer (const UString &a)
 
const UStringdisplay_hint () const
 
void display_hint (const UString &a)
 
bool has_parent () const
 
bool is_morally_root () const
 
const VariableSafePtr parent () const
 A getter of the parent Variable of the current instance. More...
 
void parent (Variable *a_parent)
 
const VariableSafePtr root () const
 
void to_string (UString &a_str, bool a_show_var_name=false, const UString &a_indent_str="") const
 
void build_qname (UString &a_qname) const
 
void build_qualified_internal_name (UString &a_qname) const
 
void set_dereferenced (VariableSafePtr a_derefed)
 
VariableSafePtr get_dereferenced ()
 
bool is_dereferenced ()
 
bool is_copyable (const Variable &a_other) const
 
bool copy (const Variable &a_other)
 
void set (const Variable &a_other)
 
unsigned int num_expected_children () const
 
void num_expected_children (unsigned int a_in)
 
bool expects_children () const
 
bool needs_unfolding () const
 
const VariableSafePtr get_descendant (const UString &a_internal_path) const
 
const UStringpath_expression () const
 
void path_expression (const UString &a_expr)
 
bool in_scope () const
 
void in_scope (bool a)
 
Format format () const
 
void format (Format a_format)
 
bool needs_revisualizing () const
 
void needs_revisualizing (bool a)
 
bool is_dynamic () const
 
void is_dynamic (bool a)
 
bool has_more_children () const
 
void has_more_children (bool a)
 
- Public Member Functions inherited from nemiver::common::Object
 Object ()
 
 Object (Object const &)
 
Objectoperator= (Object const &)
 
virtual ~Object ()
 
void ref ()
 
void unref ()
 
void enable_refcount (bool a_enabled=true)
 
bool is_refcount_enabled () const
 
long get_refcount () const
 
void attach_object (const UString &a_key, const Object *a_object)
 
bool get_attached_object (const UString &a_key, const Object *&a_object)
 

Additional Inherited Members

- Protected Attributes inherited from nemiver::common::Object
SafePtr< ObjectPrivm_priv
 

Member Enumeration Documentation

◆ Format

Enumerator
UNDEFINED_FORMAT 
BINARY_FORMAT 
DECIMAL_FORMAT 
HEXADECIMAL_FORMAT 
OCTAL_FORMAT 
NATURAL_FORMAT 
UNKNOWN_FORMAT 

Constructor & Destructor Documentation

◆ Variable() [1/4]

nemiver::IDebugger::Variable::Variable ( const UString a_internal_name,
const UString a_name,
const UString a_value,
const UString a_type,
bool  a_in_scope = true,
IDebugger a_dbg = 0 
)
inlineexplicit

◆ Variable() [2/4]

nemiver::IDebugger::Variable::Variable ( const UString a_name,
const UString a_value,
const UString a_type,
bool  a_in_scope = true,
IDebugger a_dbg = 0 
)
inlineexplicit

◆ Variable() [3/4]

nemiver::IDebugger::Variable::Variable ( const UString a_name,
IDebugger a_dbg = 0 
)
inlineexplicit

◆ Variable() [4/4]

nemiver::IDebugger::Variable::Variable ( IDebugger a_dbg = 0)
inline

◆ ~Variable()

nemiver::IDebugger::Variable::~Variable ( )
inline

Member Function Documentation

◆ append()

void nemiver::IDebugger::Variable::append ( const VariableSafePtr a_var)
inline

◆ build_qname()

void nemiver::IDebugger::Variable::build_qname ( UString a_qname) const
inline

◆ build_qualified_internal_name()

void nemiver::IDebugger::Variable::build_qualified_internal_name ( UString a_qname) const
inline

◆ copy()

bool nemiver::IDebugger::Variable::copy ( const Variable a_other)
inline

◆ debugger() [1/2]

IDebugger* nemiver::IDebugger::Variable::debugger ( ) const
inline

◆ debugger() [2/2]

void nemiver::IDebugger::Variable::debugger ( IDebugger a_dbg)
inline

◆ display_hint() [1/2]

const UString& nemiver::IDebugger::Variable::display_hint ( ) const
inline

◆ display_hint() [2/2]

void nemiver::IDebugger::Variable::display_hint ( const UString a)
inline

◆ equals()

bool nemiver::IDebugger::Variable::equals ( const Variable a_other) const
inline

References internal_name().

◆ equals_by_value()

bool nemiver::IDebugger::Variable::equals_by_value ( const Variable a_other) const
inline

Tests value equality between two variables. Two variables are considered equal by value if their respective members have the same values and same type.

Parameters
a_otherthe other variable to test against
Returns
true if a_other equals the current instance by value.

References members(), name(), and type().

◆ expects_children()

bool nemiver::IDebugger::Variable::expects_children ( ) const
inline

◆ format() [1/2]

Format nemiver::IDebugger::Variable::format ( ) const
inline

◆ format() [2/2]

void nemiver::IDebugger::Variable::format ( Format  a_format)
inline

◆ get_dereferenced()

VariableSafePtr nemiver::IDebugger::Variable::get_dereferenced ( )
inline

◆ get_descendant()

const VariableSafePtr nemiver::IDebugger::Variable::get_descendant ( const UString a_internal_path) const
inline

Return the descendant of the current instance of Variable.

Parameters
a_internal_paththe internal fully qualified path of the descendant variable.

References nemiver::common::SafePtr< PointerType, ReferenceFunctor, UnreferenceFunctor >::reset().

◆ get_member_at()

bool nemiver::IDebugger::Variable::get_member_at ( int  a_index,
VariableSafePtr a_var 
) const
inline

Returns the Nth member variable, if any. Please note that this function has O(n) complexity. So use it with care.

Parameters
a_index,theindex of the member variable to return, starting from zero.
a_varthe output parameter. Is set if and only if the the function returned true.
Returns
true if there was a variable at the specified index, false otherwise.

◆ has_more_children() [1/2]

bool nemiver::IDebugger::Variable::has_more_children ( ) const
inline

◆ has_more_children() [2/2]

void nemiver::IDebugger::Variable::has_more_children ( bool  a)
inline

◆ has_parent()

bool nemiver::IDebugger::Variable::has_parent ( ) const
inline

Return true if this instance of Variable has a parent variable, false otherwise.

◆ id()

const UString& nemiver::IDebugger::Variable::id ( ) const
inline

Return the ID of the variable. The ID is either the internal_name of the variable if it has one, or its user facing name.

◆ in_scope() [1/2]

bool nemiver::IDebugger::Variable::in_scope ( ) const
inline

◆ in_scope() [2/2]

void nemiver::IDebugger::Variable::in_scope ( bool  a)
inline

◆ internal_name() [1/2]

const UString& nemiver::IDebugger::Variable::internal_name ( ) const
inline

If this variable was created with a backend counterpart (e.g. backend side variable objects in GDB), then this returns the name of the backend side counterpart of this variable.

Returns
the name of the backend side counterpart of this variable. It can be an empty string if there is no backend side counterpart variable object created for this object.

Referenced by equals().

◆ internal_name() [2/2]

void nemiver::IDebugger::Variable::internal_name ( const UString a_in)
inline

Set the name of the backend side counterpart object. (e.g. variable object in GDB).

Parameters
a_inthe new name of backend side counterpart variable object.

◆ is_copyable()

bool nemiver::IDebugger::Variable::is_copyable ( const Variable a_other) const
inline

References members(), and type().

◆ is_dereferenced()

bool nemiver::IDebugger::Variable::is_dereferenced ( )
inline

◆ is_dynamic() [1/2]

bool nemiver::IDebugger::Variable::is_dynamic ( ) const
inline

◆ is_dynamic() [2/2]

void nemiver::IDebugger::Variable::is_dynamic ( bool  a)
inline

◆ is_morally_root()

bool nemiver::IDebugger::Variable::is_morally_root ( ) const
inline

If this variable has a backend counterpart (e.g GDB Backend variable object) then, there are cases where a variable sub-object can be returned by the backend without being linked to its ancestor tree. Such a variable appears as being structurally root (it has no parent), but is morally a sub-variable. A variable that is structurally non-root is also morally non-root.

To know if a variable is morally root, this function detects if the fully qualified internal name of the variable has dot (".") in it (e.g, "variable.member"). If does not, then the function assumes the variable is morally root and returns true.

◆ members() [1/2]

VariableList& nemiver::IDebugger::Variable::members ( )
inline

◆ members() [2/2]

const VariableList& nemiver::IDebugger::Variable::members ( ) const
inline

Referenced by equals_by_value(), and is_copyable().

◆ name() [1/2]

const UString& nemiver::IDebugger::Variable::name ( ) const
inline

Referenced by equals_by_value().

◆ name() [2/2]

void nemiver::IDebugger::Variable::name ( const UString a_name)
inline

◆ name_caption() [1/2]

const UString& nemiver::IDebugger::Variable::name_caption ( ) const
inline

◆ name_caption() [2/2]

void nemiver::IDebugger::Variable::name_caption ( const UString a_n)
inline

◆ needs_revisualizing() [1/2]

bool nemiver::IDebugger::Variable::needs_revisualizing ( ) const
inline

◆ needs_revisualizing() [2/2]

void nemiver::IDebugger::Variable::needs_revisualizing ( bool  a)
inline

◆ needs_unfolding()

bool nemiver::IDebugger::Variable::needs_unfolding ( ) const
inline
Returns
true if the current variable needs to be unfolded by a call to IDebugger::unfold_variable()

◆ num_expected_children() [1/2]

unsigned int nemiver::IDebugger::Variable::num_expected_children ( ) const
inline

◆ num_expected_children() [2/2]

void nemiver::IDebugger::Variable::num_expected_children ( unsigned int  a_in)
inline

◆ operator==()

bool nemiver::IDebugger::Variable::operator== ( const Variable a_other) const
inline

◆ parent() [1/2]

const VariableSafePtr nemiver::IDebugger::Variable::parent ( ) const
inline

A getter of the parent Variable of the current instance.

◆ parent() [2/2]

void nemiver::IDebugger::Variable::parent ( Variable a_parent)
inline

Parent variable setter. We don't increase the ref count of the parent variable to avoid memory leaks due to refcounting cyles. The parent already holds a reference on this instance of Variable so we really should not hold a reference on it as well.

◆ path_expression() [1/2]

const UString& nemiver::IDebugger::Variable::path_expression ( ) const
inline

◆ path_expression() [2/2]

void nemiver::IDebugger::Variable::path_expression ( const UString a_expr)
inline

◆ root()

const VariableSafePtr nemiver::IDebugger::Variable::root ( ) const
inline
Returns
the root parent of this variable.

◆ set()

void nemiver::IDebugger::Variable::set ( const Variable a_other)
inline

◆ set_dereferenced()

void nemiver::IDebugger::Variable::set_dereferenced ( VariableSafePtr  a_derefed)
inline

◆ sibling_index()

int nemiver::IDebugger::Variable::sibling_index ( ) const
inline
Returns
the sibbling index of the variable node. If first sibbling at a given level has index 0.

References THROW.

◆ to_string()

void nemiver::IDebugger::Variable::to_string ( UString a_str,
bool  a_show_var_name = false,
const UString a_indent_str = "" 
) const
inline

◆ type() [1/3]

const UString& nemiver::IDebugger::Variable::type ( ) const
inline

Referenced by equals_by_value(), and is_copyable().

◆ type() [2/3]

void nemiver::IDebugger::Variable::type ( const string &  a_type)
inline

◆ type() [3/3]

void nemiver::IDebugger::Variable::type ( const UString a_type)
inline

◆ value() [1/2]

const UString& nemiver::IDebugger::Variable::value ( ) const
inline

◆ value() [2/2]

void nemiver::IDebugger::Variable::value ( const UString a_value)
inline

◆ visualizer() [1/2]

const UString& nemiver::IDebugger::Variable::visualizer ( ) const
inline

◆ visualizer() [2/2]

void nemiver::IDebugger::Variable::visualizer ( const UString a)
inline

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