yast2-core
Public Member Functions | Private Member Functions | Private Attributes
YBreakpoint Class Reference

YBreakpoint wrapper for YCP debugger. More...

#include <YBreakpoint.h>

Inheritance diagram for YBreakpoint:
YCode Rep

List of all members.

Public Member Functions

 YBreakpoint (YCodePtr wrapped_ycp, string name)
virtual ~YBreakpoint ()
virtual ykind kind () const
virtual string toString () const
virtual std::ostream & toStream (std::ostream &str) const
virtual std::ostream & toXml (std::ostream &str, int indent) const
virtual bool isConstant () const
virtual bool isStatement () const
virtual bool isBlock () const
virtual bool isReferenceable () const
virtual YCPValue evaluate (bool cse=false)
virtual constTypePtr type () const
YCodePtr code () const
bool enabled () const
void setEnabled (bool enable)

Private Member Functions

 REP_BODY (YBreakpoint)

Private Attributes

YCodePtr m_code
bool m_enabled
string m_name

Detailed Description

YBreakpoint wrapper for YCP debugger.

A class representing a breakpoint in YCP code.


Constructor & Destructor Documentation

YBreakpoint::YBreakpoint ( YCodePtr  wrapped_ycp,
std::string  name 
)

Creates a new YCode element

YBreakpoint::~YBreakpoint ( ) [virtual]

Destructor

References m_code.


Member Function Documentation

YCodePtr YBreakpoint::code ( ) const

References m_code.

bool YBreakpoint::enabled ( ) const

References m_enabled.

YCPValue YBreakpoint::evaluate ( bool  cse = false) [virtual]

Execute YCP code to get the resulting YCPValue. Every inherited class of YCode should reimplement this method.

Returns:
YCPValue after executing the code
Parameters:
cseshould the evaluation be done for parse time evaluation (i.e. constant subexpression elimination)

Reimplemented from YCode.

References m_code, m_enabled, m_name, Debugger::setTracing(), Debugger::stashOutput(), toString(), y2debug, and y2internal.

bool YBreakpoint::isBlock ( ) const [virtual]

Is this a YCP block?

Returns:
true if the YCode represents a block

Reimplemented from YCode.

References m_code.

bool YBreakpoint::isConstant ( ) const [virtual]

Is this code constant?

Returns:
true if the YCode represents a constant

Reimplemented from YCode.

References m_code.

bool YBreakpoint::isReferenceable ( ) const [virtual]

Can this code be stored in a variable of a type reference?

Returns:
true if the YCode represents something we can reference to

Reimplemented from YCode.

References m_code.

bool YBreakpoint::isStatement ( ) const [virtual]

Is this a YCP statement (e.g. if, while, ...)

Returns:
true if the YCode represents a statement

Reimplemented from YCode.

References m_code.

virtual ykind YBreakpoint::kind ( ) const [inline, virtual]

Kind of this YCode.

Returns:
the YCode kind

Implements YCode.

References YCode::yiBreakpoint.

YBreakpoint::REP_BODY ( YBreakpoint  ) [private]
void YBreakpoint::setEnabled ( bool  enable)

References m_enabled.

std::ostream & YBreakpoint::toStream ( std::ostream &  str) const [virtual]

Write YCP code to a byte stream (bytecode implementation). No-op.

Implements YCode.

References m_code.

string YBreakpoint::toString ( void  ) const [virtual]

Return ASCII represtation of this YCP code. Actually no-op.

Returns:
ASCII string representation

Reimplemented from YCode.

References m_code.

Referenced by evaluate(), and Debugger::setBreakpoint().

std::ostream & YBreakpoint::toXml ( std::ostream &  str,
int  indent 
) const [virtual]

Write YCP code as XML representation. No-op.

Parameters:
strstring stream to store into
indendindentation level for pretty print
Returns:
string stream for chaining writing XML (str)

Implements YCode.

References m_code.

constTypePtr YBreakpoint::type ( ) const [virtual]

Return type of this YCP code (interesting mostly for function calls).

Returns:
type of the value to be returned after calling evaluate

Reimplemented from YCode.

References m_code.


Member Data Documentation

YCodePtr YBreakpoint::m_code [private]
bool YBreakpoint::m_enabled [private]

Referenced by enabled(), evaluate(), and setEnabled().

string YBreakpoint::m_name [private]

Referenced by evaluate().


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

Generated on a sunny day for yast2-core by doxygen 1.7.5.1