FuncSketch
Loading...
Searching...
No Matches
func_sketch::expressions::ExpressionPtr Class Reference

Class of pointers to expressions with RAII. More...

#include <func_sketch/expressions/expression_ptr.h>

Collaboration diagram for func_sketch::expressions::ExpressionPtr:

Classes

class  Deleter
 Deleter for ExpressionPtr. More...

Public Member Functions

 ExpressionPtr (Expression *expression, std::unique_ptr< ExpressionMemoryPool > memory_pool) noexcept
 Constructor.
 ExpressionPtr () noexcept=default
 Constructor.
void reset () noexcept
 Clear the pointer.
Expressionget () const noexcept
 Get the pointed expression.
Expressionoperator* () const noexcept
 Access the pointed expression.
Expressionoperator-> () const noexcept
 Access the member of the pointed expression.

Private Attributes

std::unique_ptr< Expression, Deleterexpression_
 Pointer.

Detailed Description

Class of pointers to expressions with RAII.

Note
This class destroys the pointed expression when the ExpressionPtr object is destroyed.

Definition at line 35 of file expression_ptr.h.

Constructor & Destructor Documentation

◆ ExpressionPtr()

func_sketch::expressions::ExpressionPtr::ExpressionPtr ( Expression * expression,
std::unique_ptr< ExpressionMemoryPool > memory_pool )
inlinenoexcept

Constructor.

Parameters
[in]expressionExpression.
[in]memory_poolMemory pool used to create the expression.
Note
The memory pool must be the one used to create the expression. Use of a different memory pool causes undefined behavior.

Definition at line 46 of file expression_ptr.h.

Member Function Documentation

◆ reset()

void func_sketch::expressions::ExpressionPtr::reset ( )
inlinenoexcept

Clear the pointer.

Definition at line 58 of file expression_ptr.h.

◆ get()

Expression * func_sketch::expressions::ExpressionPtr::get ( ) const
inlinenodiscardnoexcept

Get the pointed expression.

Returns
Pointed expression.

Definition at line 67 of file expression_ptr.h.

◆ operator*()

Expression & func_sketch::expressions::ExpressionPtr::operator* ( ) const
inlinenodiscardnoexcept

Access the pointed expression.

Returns
Reference to the pointed expression.

Definition at line 74 of file expression_ptr.h.

◆ operator->()

Expression * func_sketch::expressions::ExpressionPtr::operator-> ( ) const
inlinenodiscardnoexcept

Access the member of the pointed expression.

Returns
Pointer to the member of the pointed expression.

Definition at line 83 of file expression_ptr.h.

Member Data Documentation

◆ expression_

std::unique_ptr<Expression, Deleter> func_sketch::expressions::ExpressionPtr::expression_
private

Pointer.

Definition at line 122 of file expression_ptr.h.


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