yast2-core
Public Member Functions | Private Member Functions | Private Attributes | List of all members
YBreakpoint Class Reference

YBreakpoint wrapper for YCP debugger. More...

#include <YBreakpoint.h>

Inheritance diagram for YBreakpoint:
YCode Rep

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)
 
- Public Member Functions inherited from YCode
 YCode ()
 
virtual ~YCode ()
 
std::string commentToXml () const
 
std::ostream & commentToXml (std::ostream &str) const
 
bool isError () const
 
void setCommentBefore (const char *comment)
 
void setCommentAfter (const char *comment)
 
- Public Member Functions inherited from Rep
 Rep ()
 
 Rep (const Rep &)
 
Repoperator= (const Rep &)
 
virtual ~Rep ()
 
void ref () const
 
void unref () const
 
unsigned refCount () const
 
virtual const char * repName () const
 
virtual std::ostream & dumpOn (std::ostream &str) const
 

Private Member Functions

 REP_BODY (YBreakpoint)
 

Private Attributes

YCodePtr m_code
 
bool m_enabled
 
string m_name
 

Additional Inherited Members

- Public Types inherited from YCode
enum  ykind {
  yxError = 0, ycVoid, ycBoolean, ycInteger,
  ycFloat, ycString, ycByteblock, ycPath,
  ycSymbol, ycList, ycMap, ycTerm,
  ycEntry, ycConstant, ycLocale, ycFunction,
  yePropagate, yeUnary, yeBinary, yeTriple,
  yeCompare, yeLocale, yeList, yeMap,
  yeTerm, yeIs, yeBracket, yeBlock,
  yeReturn, yeVariable, yeBuiltin, yeFunction,
  yeReference, yeFunctionPointer, yeExpression, ysTypedef,
  ysVariable, ysFunction, ysAssign, ysBracket,
  ysIf, ysWhile, ysDo, ysRepeat,
  ysExpression, ysReturn, ysBreak, ysContinue,
  ysTextdomain, ysInclude, ysFilename, ysImport,
  ysBlock, ysSwitch, ysStatement, yiBreakpoint
}
 
- Static Public Member Functions inherited from YCode
static string toString (ykind kind)
 
- Static Public Member Functions inherited from Rep
static void ref (const Rep *obj_r)
 
static void unref (const Rep *obj_r)
 
- Protected Member Functions inherited from Rep
virtual void ref_to (unsigned) const
 
virtual void unref_to (unsigned) const
 
- Protected Attributes inherited from YCode
const char * comment_before
 
const char * comment_after
 

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.

Referenced by kind().

bool YBreakpoint::enabled ( ) const

References m_enabled.

Referenced by kind().

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.

Referenced by kind().

bool YBreakpoint::isBlock ( ) const
virtual

Is this a YCP block?

Returns
true if the YCode represents a block

Reimplemented from YCode.

References m_code.

Referenced by kind().

bool YBreakpoint::isConstant ( ) const
virtual

Is this code constant?

Returns
true if the YCode represents a constant

Reimplemented from YCode.

References m_code.

Referenced by kind().

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.

Referenced by kind().

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.

Referenced by kind().

virtual ykind YBreakpoint::kind ( ) const
inlinevirtual
YBreakpoint::REP_BODY ( YBreakpoint  )
private
void YBreakpoint::setEnabled ( bool  enable)

References m_enabled.

Referenced by kind().

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.

Referenced by kind().

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 kind().

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.

Referenced by kind().

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.

Referenced by kind().

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.8.11