Loading...
Searching...
No Matches
by::ntype Class Reference

represents native c++ type system for byeol language More...

#include <ntype.hpp>

Inheritance diagram for by::ntype:
by::expr::exprType by::mgdType by::funcType

Public Member Functions

nbool operator== (const type &rhs) const override
 check whether two ntype are same in both of native and byeol runtime environments
 
template<typename T >
nbool isImpli () const
 whether variable 'it' can be a subtype of T in runtime
 
virtual nbool isImpli (const type &to) const
 
nbool isImpli (const type *it) const BY_SIDE_FUNC(isImpli)
 
nbool isImpli (const typeProvidable &to) const
 
nbool isImpli (const typeProvidable *it) const BY_SIDE_FUNC(isImpli)
 
template<typename T >
tstr< T > asImpli (const node &it) const
 
template<typename T >
tstr< T > asImpli (const node *it) const BY_SIDE_FUNC(asImpli< T >)
 
virtual str asImpli (const node &from, const type &to) const
 
str asImpli (const node &from, const type *to) const BY_SIDE_FUNC(to
 
str asImpli (from, *to)
 
str str ())
 
str asImpli (const node *from, const type &to) const BY_SIDE_FUNC(from
 
str asImpli str ())
 
str asImpli (const node *from, const type *to) const BY_SIDE_FUNC(from &&to
 
str asImpli str ())
 
virtual nbool isCustom () const
 
template<typename T >
nbool is () const
 
nbool is (const type &to) const
 
nbool is (const type *it) const BY_SIDE_FUNC(is)
 
template<typename T >
tstr< T > as (const node &it) const
 
template<typename T >
tstr< T > as (const node *it) const BY_SIDE_FUNC(as< T >)
 
str as (const node &from, const type &to) const
 
str as (const node &from, const type *to) const BY_SIDE_FUNC(to
 
str as (from, *to)
 
str str ())
 
str as (const node *from, const type &to) const BY_SIDE_FUNC(from
 
str as str ())
 
virtual str as (const node *from, const type *to) const BY_SIDE_FUNC(from &&to
 
virtual str as str ())
 
virtual nbool isImmutable () const
 Checks if this type is immutable.
 
nbool isSameSign (const type &rhs) const
 
const ntypepromote (const ntype &r) const
 
const ntypepromote (const ntype *it) const BY_SIDE_FUNC(promote)
 
const ntypepromote (const typeProvidable &r) const
 
const ntypepromote (const typeProvidable *it) const BY_SIDE_FUNC(promote)
 
template<typename T >
const ntypepromote () const
 
static const ntype promote (l, *r)
 
const paramsgetParams () const BY_CONST_FUNC(getParams()) virtual params &getParams()
 Retrieves a non-const reference to the parameters associated with this type.
 
virtual const nodegetRet () const
 
virtual void setRet (const node &new1)
 
void setRet (const node *it) BY_SIDE_FUNC(setRet)
 
std::string createNameWithParams () const
 
const nchargetMetaTypeName () const override
 

Static Public Member Functions

static const ntypepromote (const ntype &l, const ntype &r)
 
static const ntypepromote (const ntype &l, const ntype *r) BY_SIDE_FUNC(r
 
static const ntypepromote (const ntype *l, const ntype &r) BY_SIDE_FUNC(l
 
static const ntypepromote (const ntype *l, const ntype *r) BY_SIDE_FUNC(l &&r
 

Public Attributes

str asImpli from
 
str as from
 
virtual str as from
 
static const ntype nullptr
 
static const ntype promote l
 
static const ntype promote nullptr
 

Static Public Attributes

static const std::string META_TYPENAME = "ntype"
 

Protected Member Functions

virtual const impliAses_getImpliAses () const
 
virtual const ases_getAses () const
 

Detailed Description

represents native c++ type system for byeol language

Core type class that provides type information, type conversion, and type deduction. Supports implicit/explicit casting, type compatibility checking, and parameter management. ntype stands for native type, representing meta-type information for C++ classes. mgdType stands for managed type, representing meta-type information for types defined in the Byeol language (such as functions or objects).

One important note: Although mgdType inherits from ntype in terms of implementation, this inheritance relationship does not apply at the type level when represented as type. In other words, when inheritance hierarchies such as getSupers() or getSubs() are represented, their contents can include both ntype and mgdType instances. mgdType::getSupers() is not restricted to containing only mgdType entries.

The name of an mgdType corresponds to the type name as defined in the Byeol language, while an ntype corresponds to the C++ class name.

Member Function Documentation

◆ getParams()

const params & by::ntype::getParams ( ) const &

Retrieves a non-const reference to the parameters associated with this type.

Returns
A reference to the params object, allowing modification of the type's parameters.

◆ isCustom()

virtual nbool by::ntype::isCustom ( ) const
inlinevirtual
Returns
whether this's a custom type.

◆ isImmutable()

virtual nbool by::ntype::isImmutable ( ) const
virtual

Checks if this type is immutable.

Immutable types (like scalars) are treated differently in memory management and pass-by-value semantics.

Returns
true if the type is immutable, false otherwise.

◆ isSameSign()

nbool by::ntype::isSameSign ( const type & rhs) const
Returns
true if rhs has same params and return-type in runtime

operator==() compares type equality in the native runtime(C++) environment — it returns true if both objects are of the same class. In contrast, isSameSign() compares type equality in the byeol runtime environment.

◆ operator==()

nbool by::ntype::operator== ( const type & rhs) const
override

check whether two ntype are same in both of native and byeol runtime environments

mgdType inherits ntype, so this operator==() is also able to checks equality in managed code.

◆ promote() [1/2]

static const ntype * by::ntype::promote ( const ntype & l,
const ntype & r )
static
Returns
null it it's not relative between l & r.

◆ promote() [2/2]

const ntype * by::ntype::promote ( const ntype & r) const
Returns
null if it's not relative between l & r.

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