ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
AutoCast Struct Reference

Description:

This built-in compiler plug-in of ALib Expressions, performs auto-casts only if two different types are given. In this case, the following casts are performed:

  1. If one argument is of type Types::String, the other is converted to string. The expression function returned for (optional) de-compilation is "String()".
  2. If one argument is of type Types::Float and the other of type Types::Integer, the integral value is cast to floating point. The expression function returned for (optional) de-compilation is "Float()".
  3. If one argument is of type Types::Float and the other of type Types::Boolean, the boolean value is cast to floating point. The expression function returned for (optional) de-compilation is "Float()".
  4. If one argument is of type Types::Integer and the other of type Types::Boolean, the boolean value is cast to integer. The expression function returned for (optional) de-compilation is "Integer()".
  5. If one argument is of type Types::Boolean, the other is converted to boolean using an internal callback function that simply invokes box-function FIsTrue. The expression function returned for (optional) de-compilation is "Boolean()".

Definition at line 40 of file autocast.hpp.

#include <autocast.hpp>

Inheritance diagram for AutoCast:
[legend]
Collaboration diagram for AutoCast:
[legend]

Public Method Index:

ALIB_API AutoCast (Compiler &compiler)
 
virtual ~AutoCast () override
 Virtual destructor.
 
virtual ALIB_API bool TryCompilation (CIAutoCast &ciAutoCast) override
 
- Public Method Index: inherited from CompilerPlugin
 CompilerPlugin (const NString &name, Compiler &compiler, CompilePriorities pPriority)
 
virtual ~CompilerPlugin ()
 Virtual destructor.
 
virtual bool TryCompilation (CIBinaryOp &ciBinaryOp)
 
virtual bool TryCompilation (CIFunction &ciFunction)
 
virtual bool TryCompilation (CIUnaryOp &ciUnaryOp)
 
- Public Method Index: inherited from Plugin< Compiler, CompilePriorities >
PrioritiesType GetPriority () const
 

Additional Inherited Members

- Public Type Index: inherited from Plugin< Compiler, CompilePriorities >
using PluginType
 This exposes the template parameter TPlugin to the outer world.
 
using PrioritiesType
 This exposes the template parameter pTPlugin to the outer world.
 
- Public Field Index: inherited from CompilerPlugin
CompilerCmplr
 The compiler that this plug-in is attached to.
 
const NString Name
 
- Protected Field Index: inherited from Plugin< Compiler, CompilePriorities >
PrioritiesType priority
 The priority of this plug-in.
 
- Protected Method Index: inherited from Plugin< Compiler, CompilePriorities >
 Plugin (PrioritiesType pPriority)
 

Constructor(s) / Destructor Details:

◆ AutoCast()

ALIB_API AutoCast ( Compiler & compiler)

Constructor.

Parameters
compilerThe compiler we will get attached to.

◆ ~AutoCast()

virtual ~AutoCast ( )
inlineoverridevirtual

Virtual destructor.

Definition at line 51 of file autocast.hpp.

Method Details:

◆ TryCompilation()

virtual ALIB_API bool TryCompilation ( CIAutoCast & ciAutoCast)
overridevirtual

Offers auto-cast functions for built-in types.

Parameters
[out]ciAutoCastThe compilation result.
Returns
true if an entry was found. false otherwise.

Reimplemented from CompilerPlugin.


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