Yoba Perl
Variableabstract

Base class for perl variables. More...

Inherited by Array, Code, Hash, and Scalar.

Public Member Functions

 Variable (Perl &perl, SV *sv, bool increase_refcount)
 Constructor.
 
 Variable (const Variable &to_copy)
 Copy constructor. More...
 
 Variable (Variable &&to_move)
 Move constructor. More...
 
virtual ~Variable ()
 Destructor. More...
 
Misc
virtual std::string toString () const =0
 Convert to C++ string.
 
void setReadOnly (bool state)
 Add/remove readonly flag.
 
bool isReadOnly () const
 Check if SV has readonly flag.
 
PerlgetPerl () const
 Get Perl instance.
 
Internals
SV * getSV () const
 Get raw scalar.
 
SV * detachSV ()
 Nullify object and return SV. More...
 
SV * detachMortalSV ()
 Nullify object and return mortalized SV. More...
 
U32 getRefcount () const
 Get SV reference count.
 
void increaseRefcount ()
 Increase SV reference count.
 
void decreaseRefcount ()
 Decrease SV reference count.
 
void dump () const
 Dump SV data to stderr.
 

Operators

bool operator== (const Variable &other)
 Compare SV pointers.
 
bool operator!= (const Variable &other)
 
std::ostream & operator<< (std::ostream &stream, const Variable &var)
 Operator for streams. More...
 

Detailed Description

Base class for perl variables.

Definition at line 20 of file variable.hpp.

Constructor & Destructor Documentation

Variable ( const Variable to_copy)

Copy constructor.

Note
Increases SV reference count

Definition at line 18 of file variable.cpp.

Variable ( Variable &&  to_move)

Move constructor.

Reference count not affected

Definition at line 27 of file variable.cpp.

~Variable ( )
virtual

Destructor.

Note
Decreases SV reference count

Definition at line 36 of file variable.cpp.

Member Function Documentation

SV * detachSV ( )

Nullify object and return SV.

Reference count not affected

Definition at line 70 of file variable.cpp.

SV * detachMortalSV ( )

Nullify object and return mortalized SV.

Reference count not affected

Definition at line 77 of file variable.cpp.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Variable var 
)
friend

Operator for streams.

Calls virtual toString()

Definition at line 115 of file variable.cpp.


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