libcudf  24.04.00
Public Member Functions | List of all members
cudf::ast::literal Class Reference

A literal value used in an abstract syntax tree. More...

#include <expressions.hpp>

Inheritance diagram for cudf::ast::literal:
cudf::ast::expression

Public Member Functions

template<typename T >
 literal (cudf::numeric_scalar< T > &value)
 Construct a new literal object. More...
 
template<typename T >
 literal (cudf::timestamp_scalar< T > &value)
 Construct a new literal object. More...
 
template<typename T >
 literal (cudf::duration_scalar< T > &value)
 Construct a new literal object. More...
 
 literal (cudf::string_scalar &value)
 Construct a new literal object. More...
 
cudf::data_type get_data_type () const
 Get the data type. More...
 
generic_scalar_device_view get_value () const
 Get the value object. More...
 
cudf::size_type accept (detail::expression_parser &visitor) const override
 Accepts a visitor class. More...
 
std::reference_wrapper< expression const > accept (detail::expression_transformer &visitor) const override
 Accepts a visitor class. More...
 
bool may_evaluate_null (table_view const &left, table_view const &right, rmm::cuda_stream_view stream) const override
 Returns true if the expression may evaluate to null. More...
 
bool is_valid (rmm::cuda_stream_view stream) const
 Check if the underlying scalar is valid. More...
 
- Public Member Functions inherited from cudf::ast::expression
bool may_evaluate_null (table_view const &left, rmm::cuda_stream_view stream) const
 Returns true if the expression may evaluate to null. More...
 

Detailed Description

A literal value used in an abstract syntax tree.

Definition at line 262 of file expressions.hpp.

Constructor & Destructor Documentation

◆ literal() [1/4]

template<typename T >
cudf::ast::literal::literal ( cudf::numeric_scalar< T > &  value)
inline

Construct a new literal object.

Template Parameters
TNumeric scalar template type
Parameters
valueA numeric scalar value

Definition at line 271 of file expressions.hpp.

◆ literal() [2/4]

template<typename T >
cudf::ast::literal::literal ( cudf::timestamp_scalar< T > &  value)
inline

Construct a new literal object.

Template Parameters
TTimestamp scalar template type
Parameters
valueA timestamp scalar value

Definition at line 282 of file expressions.hpp.

◆ literal() [3/4]

template<typename T >
cudf::ast::literal::literal ( cudf::duration_scalar< T > &  value)
inline

Construct a new literal object.

Template Parameters
TDuration scalar template type
Parameters
valueA duration scalar value

Definition at line 293 of file expressions.hpp.

◆ literal() [4/4]

cudf::ast::literal::literal ( cudf::string_scalar value)
inline

Construct a new literal object.

Parameters
valueA string scalar value

Definition at line 302 of file expressions.hpp.

Member Function Documentation

◆ accept() [1/2]

cudf::size_type cudf::ast::literal::accept ( detail::expression_parser &  visitor) const
overridevirtual

Accepts a visitor class.

Parameters
visitorThe expression_parser parsing this expression tree
Returns
Index of device data reference for this instance

Implements cudf::ast::expression.

◆ accept() [2/2]

std::reference_wrapper<expression const> cudf::ast::literal::accept ( detail::expression_transformer &  visitor) const
overridevirtual

Accepts a visitor class.

Parameters
visitorThe expression_parser parsing this expression tree
Returns
Index of device data reference for this instance

Implements cudf::ast::expression.

◆ get_data_type()

cudf::data_type cudf::ast::literal::get_data_type ( ) const
inline

Get the data type.

Returns
The data type of the literal

Definition at line 309 of file expressions.hpp.

◆ get_value()

generic_scalar_device_view cudf::ast::literal::get_value ( ) const
inline

Get the value object.

Returns
The device scalar object

Definition at line 316 of file expressions.hpp.

◆ is_valid()

bool cudf::ast::literal::is_valid ( rmm::cuda_stream_view  stream) const
inline

Check if the underlying scalar is valid.

Parameters
streamCUDA stream used for device memory operations and kernel launches
Returns
true if the underlying scalar is valid

Definition at line 342 of file expressions.hpp.

◆ may_evaluate_null()

bool cudf::ast::literal::may_evaluate_null ( table_view const &  left,
table_view const &  right,
rmm::cuda_stream_view  stream 
) const
inlineoverridevirtual

Returns true if the expression may evaluate to null.

Parameters
leftThe left operand of the expression
rightThe right operand of the expression
streamCUDA stream used for device memory operations and kernel launches
Returns
true if the expression may evaluate to null, otherwise false

Implements cudf::ast::expression.

Definition at line 329 of file expressions.hpp.


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