ROSE 0.11.145.134
Public Member Functions | List of all members
Rose::BinaryAnalysis::LockedInstruction Class Reference

Description

Smart pointer that locks an instruction AST.

This class is primarily used internally to implement temporary instruction locks in order to prevent the instruction from being evicted by an InstructionCache. Users will generally interact directly with InstructionPtr instead, and these LockedInstruction pointers are returned as temporaries.

A LockedInstruction pointer is like a shared-ownership smart pointer except instead of adjusting a reference count it adjusts a lock count. Any SgAsmInstruction AST node that has a positive lock count will not be evicted from an InstructionCache.

Definition at line 137 of file InstructionCache.h.

#include <Rose/BinaryAnalysis/InstructionCache.h>

Public Member Functions

 LockedInstruction ()
 Construct a null pointer.
 
 LockedInstruction (SgAsmInstruction *insn)
 Point to a specific instruction.
 
 LockedInstruction (const InstructionPtr &insn)
 Point to a specific instruction.
 
 LockedInstruction (const LockedInstruction &other)
 Copy constructor.
 
LockedInstructionoperator= (const LockedInstruction &other)
 Assignment.
 
 ~LockedInstruction ()
 Destructor.
 
void reset ()
 Reset to null.
 
SgAsmInstructionoperator* () const
 Dereference.
 
SgAsmInstructionoperator-> () const
 Dereference.
 
SgAsmInstructionget () const
 Get the raw pointer.
 
 operator bool () const
 Test whether this pointer is non-null.
 

Constructor & Destructor Documentation

◆ LockedInstruction() [1/3]

Rose::BinaryAnalysis::LockedInstruction::LockedInstruction ( SgAsmInstruction insn)
explicit

Point to a specific instruction.

The lock count for the instruction is incremented if insn is non-null.

◆ LockedInstruction() [2/3]

Rose::BinaryAnalysis::LockedInstruction::LockedInstruction ( const InstructionPtr insn)
explicit

Point to a specific instruction.

The instruction is loaded into memory (if it had been evicted) and is then locked into the cache by incrementing its lock count.

◆ LockedInstruction() [3/3]

Rose::BinaryAnalysis::LockedInstruction::LockedInstruction ( const LockedInstruction other)

Copy constructor.

The copy constructor increments the lock count on the instruction if other is non-null.

◆ ~LockedInstruction()

Rose::BinaryAnalysis::LockedInstruction::~LockedInstruction ( )

Destructor.

The destructor decrements the lock count if this was non-null.

Member Function Documentation

◆ operator=()

LockedInstruction & Rose::BinaryAnalysis::LockedInstruction::operator= ( const LockedInstruction other)

Assignment.

The lock counts for this and other are adjusted appropriately.

Thread safety: This method is thread safe.

◆ reset()

void Rose::BinaryAnalysis::LockedInstruction::reset ( )

Reset to null.

After this call, the pointer will be a null pointer. If it had been pointing to anything previously, then the lock count for that object is decremented.

Thread safety: This method is thread safe.

◆ operator*()

SgAsmInstruction & Rose::BinaryAnalysis::LockedInstruction::operator* ( ) const

Dereference.

Dereferences this pointer to return a reference to the underlying SgAsmInstruction node. This pointer must not be a null pointer.

Thread safety: This method is thread safe.

◆ operator->()

SgAsmInstruction * Rose::BinaryAnalysis::LockedInstruction::operator-> ( ) const
inline

Dereference.

Dereference this pointer to return a pointer to the SgAsmInstruction node. This pointer must not be a null pointer.

Thread safety: This method is thread safe.

Definition at line 501 of file InstructionCache.h.

◆ get()

SgAsmInstruction * Rose::BinaryAnalysis::LockedInstruction::get ( ) const

Get the raw pointer.

Thread safety: This method is thread safe.

◆ operator bool()

Rose::BinaryAnalysis::LockedInstruction::operator bool ( ) const
explicit

Test whether this pointer is non-null.

Returns true if this pointer is non-null, false if null.

Thread safety: This method is thread safe.


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