NewLang Project
Yet another programm language
Loading...
Searching...
No Matches
newlang::Obj Class Reference

#include <object.h>

Inheritance diagram for newlang::Obj:

Classes

struct  NativeData
 

Public Types

typedef Dict::PairType PairType
 
- Public Types inherited from newlang::Dict< Obj >
typedef std::shared_ptr< ObjType
 
typedef std::pair< std::string, TypePairType
 
typedef std::list< PairTypeListType
 

Public Member Functions

 Obj (ObjType type=ObjType::None, const char *var_name=nullptr, TermPtr func_proto=nullptr, ObjType fixed=ObjType::None, bool init=false, Sync *sync=nullptr)
 
ObjPtr shared ()
 
ObjPtr MakeConst ()
 
ObjPtr MakeMutable ()
 
virtual ObjPtr IteratorMake (const char *filter=nullptr, bool check_create=true)
 
virtual ObjPtr IteratorMake (Obj *args)
 
virtual ObjPtr IteratorData ()
 
virtual ObjPtr IteratorReset ()
 
virtual ObjPtr IteratorNext (int64_t count)
 
ObjPtr IteratorNext (ObjPtr count)
 
ObjType getType ()
 
ObjType getTypeAsLimit ()
 
std::string & getName ()
 
const std::string & getName () const
 
void SetClassName (std::string &name)
 
bool is_const () const
 
bool is_init () const
 
bool is_none_type () const
 
bool is_bool_type () const
 
bool is_arithmetic_type () const
 
bool is_string_type () const
 
bool is_string_char_type () const
 
bool is_string_wide_type () const
 
bool is_dictionary_type () const
 
bool is_plain_type () const
 
bool is_other_type () const
 
bool is_class_type () const
 
bool is_simple_type () const
 
bool is_scalar () const
 
bool is_function_type () const
 
bool is_native () const
 
bool is_tensor_type () const
 
bool is_integer () const
 
bool is_integral () const
 
bool is_complex () const
 
bool is_floating () const
 
bool is_indexing () const
 
bool is_ellipsis () const
 
bool is_range () const
 
bool is_rational () const
 
bool is_type_name () const
 
bool is_error () const
 
bool is_return () const
 
bool is_block () const
 
bool is_defined_type ()
 
bool is_any_size ()
 
void SetTermProp (Term &term)
 
virtual int64_t size () const
 
virtual int64_t size (int64_t ind) const
 
int64_t resize_ (int64_t size, ObjPtr fill, const std::string="")
 
virtual bool empty () const
 
Dict< Obj >::PairTypeat (const std::string name) const
 
Dict< Obj >::PairTypeat (const std::string name) override
 
Dict< Obj >::PairTypeat (const int64_t index) override
 
const Dict< Obj >::PairTypeat (const int64_t index) const override
 
Dict< Obj >::PairTypeat (ObjPtr find)
 
bool exist (ObjPtr &find, bool strong)
 
size_t ItemValueCount (ObjPtr &find, bool strong)
 
ObjPtr operator() ()
 
ObjPtr op_call (ObjPtr args)
 
ObjPtr op_call (Obj &args)
 
template<typename... T>
std::enable_if< is_all< Obj::PairType, T... >::value, ObjPtr >::type operator() (T ... args)
 
template<typename... T>
std::enable_if<!is_all< Obj::PairType, T... >::value, ObjPtr >::type operator() (T ... args)
 
template<typename I >
std::enable_if< std::is_integral< I >::value &&!std::is_pointer< I >::value, constPairType & >::type operator[] (const I index)
 
template<typename N >
std::enable_if< std::is_same< N, std::string >::value||std::is_pointer< N >::value, constPairType & >::type operator[] (const N name)
 
Obj::iterator find (const std::string name)
 
Obj::iterator begin ()
 
Obj::iterator end ()
 
Obj::const_iterator begin () const
 
Obj::const_iterator end () const
 
PairTypepush_back (const PairType &p)
 
PairTypepush_back (const Type value, const std::string &name="")
 
Obj::iterator at_index (const int64_t index)
 
Obj::const_iterator at_index_const (const int64_t index) const
 
Obj::const_iterator insert (Obj::const_iterator pos, const PairType &data)
 
const std::string & name (const int64_t index) const override
 
int64_t resize (int64_t new_size, const Type fill, const std::string &name="") override
 
void erase (const size_t from, const size_t to) override
 
void erase (const int64_t index) override
 
void clear_ () override
 
void clear_ (bool clear_iterator_name)
 
 operator bool () const
 
 operator int8_t () const
 
 operator uint8_t () const
 
 operator int16_t () const
 
 operator uint16_t () const
 
 operator int32_t () const
 
 operator uint32_t () const
 
 operator int64_t () const
 
 operator uint64_t () const
 
 operator float () const
 
 operator double () const
 
 operator std::string () const
 
 operator std::wstring () const
 
 operator void * () const
 
 operator Rational () const
 
ObjPtr operator+ ()
 
ObjPtr operator- ()
 
ObjPtroperator+ (ObjPtr &obj)
 
ObjPtroperator- (ObjPtr &obj)
 
ObjPtr operator++ ()
 
ObjPtr operator++ (int)
 
ObjPtr operator-- ()
 
ObjPtr operator-- (int)
 
ObjPtr operator* (ObjPtr obj)
 
ObjPtr operator* (Obj value)
 
ObjPtr operator/ (ObjPtr obj)
 
ObjPtr operator/ (Obj value)
 
ObjPtr op_div_ceil (ObjPtr obj)
 
ObjPtr op_div_ceil (Obj value)
 
ObjPtr op_concat (ObjPtr obj, ConcatMode mode=ConcatMode::Error)
 
ObjPtr op_concat (Obj &value, ConcatMode mode=ConcatMode::Error)
 
ObjPtr op_concat_ (Obj &obj, ConcatMode mode=ConcatMode::Error)
 
ObjPtr op_concat_ (ObjPtr obj, ConcatMode mode=ConcatMode::Error)
 
ObjPtr operator% (ObjPtr obj)
 
ObjPtr operator% (Obj value)
 
ObjPtr operator+ (ObjPtr obj)
 
ObjPtr operator+ (Obj value)
 
ObjPtr operator+= (ObjPtr obj)
 
ObjPtr operator+= (Obj obj)
 
ObjPtr operator- (ObjPtr obj)
 
ObjPtr operator- (Obj value)
 
ObjPtr operator-= (ObjPtr obj)
 
ObjPtr operator-= (Obj obj)
 
bool operator< (ObjPtr obj)
 
bool operator< (Obj obj)
 
bool operator<= (ObjPtr obj)
 
bool operator<= (Obj obj)
 
bool operator> (ObjPtr obj)
 
bool operator> (Obj obj)
 
bool operator>= (ObjPtr obj)
 
bool operator>= (Obj obj)
 
int op_compare (Obj &value)
 
bool op_class_test (ObjPtr obj, Context *ctx) const
 
bool op_class_test (const char *name, Context *ctx) const
 
bool op_duck_test (ObjPtr obj, bool strong)
 
bool op_duck_test (Obj *value, bool strong)
 
bool op_equal (ObjPtr value)
 
bool op_equal (Obj &value)
 

 
bool op_accurate (ObjPtr obj)
 
bool op_accurate (Obj &value)
 
ObjPtr op_bit_and (ObjPtr obj, bool strong)
 
ObjPtr op_bit_and (Obj &obj, bool strong)
 
ObjPtr op_pow (ObjPtr obj) const
 
ObjPtr op_pow (Obj &obj) const
 
ObjPtr op_pow_ (ObjPtr obj)
 
ObjPtr op_pow_ (Obj &obj)
 
ObjPtr op_assign (ObjPtr obj)
 
ObjPtr op_assign (Obj &obj)
 
bool operator= (Obj &obj)
 
ObjPtr operator*= (ObjPtr obj)
 
ObjPtr operator*= (Obj obj)
 
ObjPtr operator/= (ObjPtr obj)
 
ObjPtr operator/= (Obj obj)
 
ObjPtr op_div_ceil_ (ObjPtr obj)
 
ObjPtr op_div_ceil_ (Obj &obj)
 
ObjPtr operator%= (ObjPtr obj)
 
ObjPtr operator%= (Obj obj)
 
ObjPtr op_bit_and_set (Obj &obj, bool strong)
 
ObjPtr operator^= (ObjPtr obj)
 
ObjPtr operator^= (Obj)
 
ObjPtr operator|= (ObjPtr obj)
 
ObjPtr operator|= (Obj)
 
ObjPtr op_lshift_set (ObjPtr obj)
 
ObjPtr op_lshift_set (Obj)
 
ObjPtr op_rshift_set (ObjPtr obj)
 
ObjPtr op_rshift_set (Obj)
 
ObjPtr op_rrshift_set (ObjPtr obj)
 
ObjPtr op_rrshift_set (Obj)
 
template<typename T >
bool operator= (T value)
 
void dump_dict_ (std::string &str, bool deep=true) const
 
std::string toString (bool deep=true) const
 
std::string GetValueAsString () const
 
std::wstring GetValueAsStringWide () const
 
std::shared_ptr< RationalGetValueAsRational () const
 
int64_t GetValueAsInteger () const
 
double GetValueAsNumber () const
 
bool GetValueAsBoolean () const
 
std::vector< int64_t > toIntVector (bool raise=true) const
 
ObjPtr CallNative (Context *ctx, Obj args)
 
ObjPtr Copy () const
 
ObjPtr Clone (const char *new_name=nullptr) const
 
void CloneTo (Obj &clone)
 
void CloneTo (ObjPtr &clone)
 
void CloneDataTo (Obj &clone) const
 
void ClonePropTo (Obj &clone) const
 
ObjPtr toType (ObjType type) const
 
void toType_ (ObjType type)
 
virtual ~Obj ()
 
const ObjPtr index_get (const std::vector< Index > &index) const
 
ObjPtr index_set (const std::vector< Index > &index, const ObjPtr value) const
 
ObjPtr index_set_ (const std::vector< Index > &index, const ObjPtr value)
 
ObjPtr op_set_index (ObjPtr index, ObjPtr value)
 
ObjPtr op_set_index (int64_t index, std::string value)
 
template<typename T >
std::enable_if< std::is_same< T, bool >::value, void >::type SetValue_ (bool value)
 
template<typename T >
std::enable_if< std::is_integral< T >::value, void >::type SetValue_ (T value)
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value, void >::type SetValue_ (T value)
 
template<typename T >
std::enable_if< std::is_same< char *, T >::value, void >::type SetValue_ (T text)
 
template<typename T >
std::enable_if< std::is_same< wchar_t *, T >::value, void >::type SetValue_ (T text)
 
void SetValue_ (std::string text)
 
void SetValue_ (std::wstring text)
 
void testConvertType (ObjType type)
 
void testResultIntegralType (ObjType type, bool upscalint)
 
void SetValue_ (ObjPtr value)
 
bool CallAll (const char *func_name, ObjPtr &arg_in, ObjPtr &result, ObjPtr object=nullptr, size_t limit=0)
 
bool CallOnce (ObjPtr &arg_in, ObjPtr &result, ObjPtr object=nullptr)
 
const TermPtr Proto ()
 
void remove (const Dict::PairType &value)
 
- Public Member Functions inherited from newlang::Dict< Obj >
std::enable_if< std::is_integral< I >::value &&!std::is_pointer< I >::value, constPairType & >::type operator[] (I index)
 
std::enable_if< std::is_same< N, std::string >::value||std::is_pointer< N >::value, constPairType & >::type operator[] (N name)
 
PairTypepush_back (const PairType &p)
 
PairTypepush_back (const Type value, const std::string &name="")
 
ListType::iterator find (const std::string_view name)
 
virtual int64_t index (const std::string_view field_name)
 
ListType::iterator at_index (const int64_t index)
 
ListType::const_iterator at_index_const (const int64_t index) const
 
virtual ~Dict ()
 
 Dict ()
 
 Dict (PairType arg)
 
 Dict (PairType arg, A... rest)
 

Static Public Member Functions

static PairType ArgNull (const std::string name="")
 
static PairType Arg ()
 
static PairType Arg (ObjPtr value, const std::string name="")
 
template<typename T >
static std::enable_if< std::is_pointer< T >::value||std::is_same< std::string, T >::value, PairType >::type Arg (T value, const std::string name="")
 
template<typename T >
static std::enable_if<!std::is_same< PairType, T >::value &&!std::is_pointer< T >::value &&!std::is_same< std::string, T >::value, PairType >::type Arg (T value, const std::string name="")
 
static bool is_true (const char *text)
 
static bool op_duck_test_prop (Obj *base, Obj *value, bool strong)
 
static ObjPtr GetIndex (ObjPtr obj, TermPtr index_arg)
 
static ObjPtr GetIndex (ObjPtr obj, size_t index)
 
static ObjPtr CreateType (ObjType type, ObjType fixed=ObjType::None, bool is_init=false, Sync *sync=nullptr)
 
static ObjPtr CreateRational (const Rational &val)
 
static ObjPtr CreateRational (const std::string val)
 
static ObjPtr BaseTypeConstructor (Context *ctx, Obj &in)
 
static ObjPtr ConstructorSimpleType_ (Context *ctx, Obj &args)
 
static ObjPtr ConstructorDictionary_ (Context *ctx, Obj &args)
 
static ObjPtr ConstructorNative_ (Context *ctx, Obj &args)
 
static ObjPtr ConstructorStub_ (Context *ctx, Obj &args)
 
static ObjPtr ConstructorClass_ (Context *ctx, Obj &args)
 
static ObjPtr ConstructorStruct_ (Context *ctx, Obj &args)
 
static ObjPtr ConstructorEnum_ (Context *ctx, Obj &args)
 
static ObjPtr CreateBaseType (ObjType type)
 
static ObjPtr CreateNone (Sync *sync=nullptr)
 
static ObjPtr CreateEmpty (Sync *sync=nullptr)
 
static ObjPtr CreatePointer (void *ptr=nullptr, Sync *sync=nullptr)
 
static ObjPtr CreateNil (Sync *sync=nullptr)
 
static ObjPtr CreateBool (bool value, Sync *sync=nullptr)
 
template<typename T1 , typename T2 , typename T3 >
static ObjPtr CreateRange (T1 start, T2 stop, T3 step, Sync *sync=nullptr)
 
template<typename T1 , typename T2 >
static ObjPtr CreateRange (T1 start, T2 stop, Sync *sync=nullptr)
 
template<typename T >
static std::enable_if< std::is_same< T, std::string >::value||std::is_same< T, constchar * >::value, ObjPtr >::type CreateValue (T value, Sync *sync=nullptr)
 
template<typename T >
static std::enable_if< std::is_same< T, std::wstring >::value||std::is_same< T, constwchar_t * >::value, ObjPtr >::type CreateValue (T value, Sync *sync=nullptr)
 
template<typename T >
static std::enable_if< std::is_integral< T >::value, ObjPtr >::type CreateValue (T value, ObjType fix_type=ObjType::None, Sync *sync=nullptr)
 
template<typename T >
static std::enable_if< std::is_floating_point< T >::value, ObjPtr >::type CreateValue (T value, ObjType fix_type=ObjType::None, Sync *sync=nullptr)
 
static ObjPtr CreateString (const std::string_view str, Sync *sync=nullptr)
 
static ObjPtr CreateString (const std::wstring_view str, Sync *sync=nullptr)
 
static ObjPtr Yes (Sync *sync=nullptr)
 
static ObjPtr No (Sync *sync=nullptr)
 
static ObjPtr CreateDict (Sync *sync=nullptr)
 
template<typename... T>
static std::enable_if< is_all< PairType, T... >::value, ObjPtr >::type CreateDict (T ... args)
 
static ObjPtr CreateDict (const std::vector< ObjPtr > &arr, Sync *sync=nullptr)
 
static ObjPtr CreateClass (std::string name)
 
template<typename... T>
static std::enable_if< is_all< PairType, T... >::value, ObjPtr >::type CreateClass (std::string name, T ... args)
 
- Static Public Member Functions inherited from newlang::Dict< Obj >
static PairType pair (const Type value, const std::string name="")
 

Public Attributes

ObjType m_var_type_current
 Текущий тип значения объекта
 
ObjType m_var_type_fixed
 Максимальный размер для арифметических типов, который задается разработчиком
 
bool m_var_is_init
 Содержит ли объект корректное значение ???
 
std::string m_var_name
 Имя переменной, в которой хранится объект
 
std::string m_class_name
 Имя класса объекта (у базовых типов отсуствует)
 
std::vector< ObjPtrm_class_parents
 Родительские классы (типы)
 
std::string m_module_name
 
const TermPtr m_prototype
 Описание прототипа функции (или данных)
 
Contextm_ctx
 
ObjPtr m_dimensions
 Размерности для ObjType::Type.
 
PairType m_str_pair
 
std::string m_func_mangle_name
 
std::variant< std::monostate, int64_t, double, void *, bool *, int8_t *, int16_t *, int32_t *, int64_t *, float *, double *, NativeData, std::string, TermPtr, Iterator< Obj > > m_var
 
std::string m_value
 Содержит байтовую строку или байтовый массив с данными для представления в нативном виде (Struct, Unuion, Enum)
 
std::wstring m_string
 Содержит строку широких символов
 
std::shared_ptr< torch::Tensor > m_tensor
 Содержит только размерные тензоры (скляры хранятся в поле m_pointer и не создают m_tensor->defined())
 
Rational m_rational
 Содержит дробь из длинных чисел
 
std::shared_ptr< Iterator< Obj > > m_iterator
 Итератор для данных
 
ObjPtr m_iter_range_value
 
TermPtr m_sequence
 Последовательно распарсенных команд для выполнения
 
ObjPtr m_return_obj
 
ObjWeak m_reference
 
Syncm_sync
 
bool m_check_args
 
bool m_is_const
 
bool m_is_reference
 

Detailed Description

Definition at line 347 of file object.h.

Member Typedef Documentation

◆ PairType

Definition at line 356 of file object.h.

Constructor & Destructor Documentation

◆ Obj()

Obj::Obj ( ObjType type = ObjType::None,
const char * var_name = nullptr,
TermPtr func_proto = nullptr,
ObjType fixed = ObjType::None,
bool init = false,
Sync * sync = nullptr )

◆ ~Obj()

virtual newlang::Obj::~Obj ( )
inlinevirtual

Definition at line 1742 of file object.h.

References clear_().

Member Function Documentation

◆ ArgNull()

static PairType newlang::Obj::ArgNull ( const std::string name = "")
inlinestaticnodiscard

Definition at line 363 of file object.h.

References CreateNil(), name(), and newlang::Dict< Obj >::pair().

◆ Arg() [1/4]

static PairType newlang::Obj::Arg ( )
inlinestaticnodiscard

Definition at line 368 of file object.h.

References CreateNone(), and newlang::Dict< Obj >::pair().

◆ Arg() [2/4]

static PairType newlang::Obj::Arg ( ObjPtr value,
const std::string name = "" )
inlinestaticnodiscard

Definition at line 373 of file object.h.

References name(), and newlang::Dict< Obj >::pair().

◆ Arg() [3/4]

template<typename T >
static std::enable_if< std::is_pointer< T >::value||std::is_same< std::string, T >::value, PairType >::type newlang::Obj::Arg ( T value,
const std::string name = "" )
inlinestatic

Definition at line 379 of file object.h.

References CreateString(), name(), and newlang::Dict< Obj >::pair().

◆ Arg() [4/4]

template<typename T >
static std::enable_if<!std::is_same< PairType, T >::value &&!std::is_pointer< T >::value &&!std::is_same< std::string, T >::value, PairType >::type newlang::Obj::Arg ( T value,
const std::string name = "" )
inlinestatic

Definition at line 385 of file object.h.

References CreateValue(), name(), newlang::None, and newlang::Dict< Obj >::pair().

◆ shared()

◆ MakeConst()

ObjPtr newlang::Obj::MakeConst ( )
inline

Definition at line 397 of file object.h.

References m_is_const, and shared().

◆ MakeMutable()

ObjPtr newlang::Obj::MakeMutable ( )
inline

Definition at line 402 of file object.h.

References m_is_const, and shared().

◆ IteratorMake() [1/2]

ObjPtr Obj::IteratorMake ( const char * filter = nullptr,
bool check_create = true )
virtual

◆ IteratorMake() [2/2]

◆ IteratorData()

◆ IteratorReset()

ObjPtr Obj::IteratorReset ( )
virtual

◆ IteratorNext() [1/2]

ObjPtr Obj::IteratorNext ( int64_t count)
virtual

Definition at line 3306 of file object.cpp.

References ASSERT, newlang::Iterator, LOG_RUNTIME, m_iterator, and m_var_type_current.

Referenced by IteratorNext().

◆ IteratorNext() [2/2]

ObjPtr newlang::Obj::IteratorNext ( ObjPtr count)
inline

Definition at line 413 of file object.h.

References IteratorNext().

◆ getType()

◆ getTypeAsLimit()

◆ getName() [1/2]

std::string & newlang::Obj::getName ( )
inlinenodiscard

Definition at line 442 of file object.h.

References m_var_name.

◆ getName() [2/2]

const std::string & newlang::Obj::getName ( ) const
inlinenodiscard

Definition at line 447 of file object.h.

References m_var_name.

◆ SetClassName()

void newlang::Obj::SetClassName ( std::string & name)
inline

Definition at line 451 of file object.h.

References m_class_name, and name().

◆ is_const()

bool newlang::Obj::is_const ( ) const
inlinenodiscard

Definition at line 456 of file object.h.

References m_is_const.

◆ is_init()

bool newlang::Obj::is_init ( ) const
inlinenodiscard

Definition at line 461 of file object.h.

References m_var_is_init.

Referenced by newlang::CheckSystemField(), and CreateType().

◆ is_none_type()

bool newlang::Obj::is_none_type ( ) const
inlinenodiscard

◆ is_bool_type()

bool newlang::Obj::is_bool_type ( ) const
inlinenodiscard

Definition at line 471 of file object.h.

References newlang::isBooleanType(), and m_var_type_current.

Referenced by is_other_type(), op_accurate(), and op_equal().

◆ is_arithmetic_type()

bool newlang::Obj::is_arithmetic_type ( ) const
inlinenodiscard

◆ is_string_type()

bool newlang::Obj::is_string_type ( ) const
inlinenodiscard

◆ is_string_char_type()

bool newlang::Obj::is_string_char_type ( ) const
inlinenodiscard

Definition at line 486 of file object.h.

References newlang::isStringChar(), and m_var_type_current.

Referenced by toType_().

◆ is_string_wide_type()

bool newlang::Obj::is_string_wide_type ( ) const
inlinenodiscard

Definition at line 491 of file object.h.

References newlang::isStringWide(), and m_var_type_current.

Referenced by toType_().

◆ is_dictionary_type()

◆ is_plain_type()

bool newlang::Obj::is_plain_type ( ) const
inlinenodiscard

Definition at line 502 of file object.h.

References newlang::isPlainDataType(), and m_var_type_current.

◆ is_other_type()

bool newlang::Obj::is_other_type ( ) const
inlinenodiscard

◆ is_class_type()

bool newlang::Obj::is_class_type ( ) const
inlinenodiscard

Definition at line 512 of file object.h.

References newlang::isClass(), and m_var_type_current.

Referenced by SetValue_().

◆ is_simple_type()

bool newlang::Obj::is_simple_type ( ) const
inlinenodiscard

Definition at line 517 of file object.h.

References newlang::isSimpleType(), and m_var_type_current.

Referenced by GetValueAsNumber(), and op_duck_test().

◆ is_scalar()

◆ is_function_type()

bool newlang::Obj::is_function_type ( ) const
inlinenodiscard

Definition at line 525 of file object.h.

References newlang::isFunction(), and m_var_type_current.

Referenced by newlang::Context::Call(), and op_duck_test().

◆ is_native()

bool newlang::Obj::is_native ( ) const
inlinenodiscard

Definition at line 530 of file object.h.

References newlang::isNative(), and m_var_type_current.

Referenced by newlang::Context::Call().

◆ is_tensor_type()

◆ is_integer()

bool newlang::Obj::is_integer ( ) const
inlinenodiscard

Definition at line 540 of file object.h.

References newlang::isIntegralType(), and m_var_type_current.

Referenced by operator-(), and toSlice().

◆ is_integral()

◆ is_complex()

bool newlang::Obj::is_complex ( ) const
inlinenodiscard

Definition at line 550 of file object.h.

References newlang::isComplexType(), and m_var_type_current.

Referenced by op_compare().

◆ is_floating()

bool newlang::Obj::is_floating ( ) const
inlinenodiscard

◆ is_indexing()

◆ is_ellipsis()

bool newlang::Obj::is_ellipsis ( ) const
inlinenodiscard

Definition at line 565 of file object.h.

References newlang::isEllipsis(), and m_var_type_current.

Referenced by toIndex().

◆ is_range()

bool newlang::Obj::is_range ( ) const
inlinenodiscard

◆ is_rational()

bool newlang::Obj::is_rational ( ) const
inlinenodiscard

Definition at line 575 of file object.h.

References m_var_type_current, and newlang::Rational.

Referenced by op_compare(), op_equal(), and op_pow_().

◆ is_type_name()

bool newlang::Obj::is_type_name ( ) const
inlinenodiscard

Definition at line 580 of file object.h.

References newlang::isTypeName(), and m_var_type_current.

Referenced by newlang::Context::Call(), and getTypeAsLimit().

◆ is_error()

bool newlang::Obj::is_error ( ) const
inlinenodiscard

◆ is_return()

bool newlang::Obj::is_return ( ) const
inlinenodiscard

Definition at line 590 of file object.h.

References m_var_type_current, newlang::RetMinus, newlang::RetPlus, and newlang::RetRepeat.

Referenced by is_indexing().

◆ is_block()

bool newlang::Obj::is_block ( ) const
inlinenodiscard

◆ is_defined_type()

bool newlang::Obj::is_defined_type ( )
inlinenodiscard

Definition at line 601 of file object.h.

References m_var_type_fixed, and newlang::None.

◆ is_any_size()

bool newlang::Obj::is_any_size ( )
inlinenodiscard

Definition at line 606 of file object.h.

References newlang::Ellipsis, m_var_type_current, and newlang::None.

◆ SetTermProp()

void newlang::Obj::SetTermProp ( Term & term)

◆ size() [1/2]

◆ size() [2/2]

int64_t Obj::size ( int64_t ind) const
virtual

◆ resize_()

◆ empty()

◆ at() [1/5]

◆ at() [2/5]

Dict< Obj >::PairType & newlang::Obj::at ( const std::string name)
inlineoverridevirtual

Reimplemented from newlang::Dict< Obj >.

Definition at line 643 of file object.h.

References newlang::Dict< T, PTR >::at(), newlang::CheckSystemField(), m_str_pair, and name().

◆ at() [3/5]

◆ at() [4/5]

◆ at() [5/5]

Dict< Obj >::PairType & newlang::Obj::at ( ObjPtr find)
inline

Definition at line 656 of file object.h.

References newlang::Dict< T, PTR >::at(), find(), and LOG_RUNTIME.

◆ exist()

bool Obj::exist ( ObjPtr & find,
bool strong )

Definition at line 535 of file object.cpp.

References find().

Referenced by op_bit_and_set().

◆ ItemValueCount()

size_t Obj::ItemValueCount ( ObjPtr & find,
bool strong )

Definition at line 968 of file object.cpp.

References find(), and result.

◆ is_true()

static bool newlang::Obj::is_true ( const char * text)
inlinestatic

Definition at line 666 of file object.h.

◆ operator()() [1/3]

ObjPtr newlang::Obj::operator() ( )
inline

Definition at line 672 of file object.h.

References newlang::Dictionary, and op_call().

◆ op_call() [1/2]

ObjPtr newlang::Obj::op_call ( ObjPtr args)
inline

Definition at line 677 of file object.h.

References ASSERT, and op_call().

Referenced by op_call(), operator()(), and operator()().

◆ op_call() [2/2]

ObjPtr Obj::op_call ( Obj & args)

Definition at line 3395 of file object.cpp.

References newlang::Context::Call(), and m_ctx.

◆ operator()() [2/3]

template<typename... T>
std::enable_if< is_all< Obj::PairType, T... >::value, ObjPtr >::type newlang::Obj::operator() ( T ... args)
inline

Definition at line 686 of file object.h.

References CreateDict(), and op_call().

◆ operator()() [3/3]

template<typename... T>
std::enable_if<!is_all< Obj::PairType, T... >::value, ObjPtr >::type newlang::Obj::operator() ( T ... args)
inline

Definition at line 697 of file object.h.

References CreateDict(), CreateValue(), and op_call().

◆ operator[]() [1/2]

template<typename I >
std::enable_if< std::is_integral< I >::value &&!std::is_pointer< I >::value, constPairType & >::type newlang::Obj::operator[] ( const I index)
inline

◆ operator[]() [2/2]

template<typename N >
std::enable_if< std::is_same< N, std::string >::value||std::is_pointer< N >::value, constPairType & >::type newlang::Obj::operator[] ( const N name)
inline

◆ find()

Obj::iterator newlang::Obj::find ( const std::string name)
inline

◆ begin() [1/2]

Obj::iterator newlang::Obj::begin ( )
inline

◆ end() [1/2]

Obj::iterator newlang::Obj::end ( )
inline

Definition at line 763 of file object.h.

References is_indexing(), LOG_RUNTIME, m_var_type_current, newlang::Range, and newlang::toString().

Referenced by operator-=().

◆ begin() [2/2]

Obj::const_iterator newlang::Obj::begin ( ) const
inline

◆ end() [2/2]

Obj::const_iterator newlang::Obj::end ( ) const
inline

◆ push_back() [1/2]

PairType & newlang::Obj::push_back ( const PairType & p)
inline

◆ push_back() [2/2]

PairType & newlang::Obj::push_back ( const Type value,
const std::string & name = "" )
inline

◆ at_index()

Obj::iterator newlang::Obj::at_index ( const int64_t index)
inline

◆ at_index_const()

Obj::const_iterator newlang::Obj::at_index_const ( const int64_t index) const
inline

◆ insert()

Obj::const_iterator newlang::Obj::insert ( Obj::const_iterator pos,
const PairType & data )
inline

Definition at line 812 of file object.h.

References is_indexing(), LOG_RUNTIME, m_var_type_current, and newlang::toString().

Referenced by newlang::Context::Call().

◆ name()

const std::string & newlang::Obj::name ( const int64_t index) const
inlineoverridevirtual

◆ resize()

int64_t newlang::Obj::resize ( int64_t new_size,
const Type fill,
const std::string & name = "" )
inlineoverridevirtual

◆ erase() [1/2]

void Obj::erase ( const size_t from,
const size_t to )
overridevirtual

◆ erase() [2/2]

void newlang::Obj::erase ( const int64_t index)
inlineoverridevirtual

◆ clear_() [1/2]

void newlang::Obj::clear_ ( )
inlineoverridevirtual

◆ clear_() [2/2]

void Obj::clear_ ( bool clear_iterator_name)

◆ operator bool()

newlang::Obj::operator bool ( ) const
inlineexplicit

Definition at line 854 of file object.h.

References GetValueAsBoolean().

◆ operator int8_t()

newlang::Obj::operator int8_t ( ) const
inlineexplicit

Definition at line 874 of file object.h.

◆ operator uint8_t()

newlang::Obj::operator uint8_t ( ) const
inlineexplicit

Definition at line 874 of file object.h.

◆ operator int16_t()

newlang::Obj::operator int16_t ( ) const
inlineexplicit

Definition at line 875 of file object.h.

◆ operator uint16_t()

newlang::Obj::operator uint16_t ( ) const
inlineexplicit

Definition at line 875 of file object.h.

◆ operator int32_t()

newlang::Obj::operator int32_t ( ) const
inlineexplicit

Definition at line 876 of file object.h.

◆ operator uint32_t()

newlang::Obj::operator uint32_t ( ) const
inlineexplicit

Definition at line 876 of file object.h.

◆ operator int64_t()

newlang::Obj::operator int64_t ( ) const
inlineexplicit

Definition at line 878 of file object.h.

References GetValueAsInteger().

◆ operator uint64_t()

newlang::Obj::operator uint64_t ( ) const
inlineexplicit

Definition at line 882 of file object.h.

References GetValueAsInteger(), GetValueAsString(), LOG_RUNTIME, and result.

◆ operator float()

Obj::operator float ( ) const
explicit

Definition at line 1540 of file object.cpp.

References LOG_DEBUG, LOG_RUNTIME, and result.

◆ operator double()

Obj::operator double ( ) const
explicit

Definition at line 1554 of file object.cpp.

◆ operator std::string()

newlang::Obj::operator std::string ( ) const
inlineexplicit

Definition at line 896 of file object.h.

References GetValueAsString().

◆ operator std::wstring()

newlang::Obj::operator std::wstring ( ) const
inlineexplicit

Definition at line 900 of file object.h.

References GetValueAsStringWide().

◆ operator void *()

newlang::Obj::operator void * ( ) const
inlineexplicit

Definition at line 904 of file object.h.

References m_var.

◆ operator Rational()

newlang::Obj::operator Rational ( ) const
inlineexplicit

Definition at line 908 of file object.h.

References GetValueAsRational().

◆ operator+() [1/4]

ObjPtr newlang::Obj::operator+ ( )
inline

Definition at line 914 of file object.h.

References is_arithmetic_type(), LOG_RUNTIME, shared(), and toString().

Referenced by operator+().

◆ operator-() [1/4]

◆ operator+() [2/4]

ObjPtr & newlang::Obj::operator+ ( ObjPtr & obj)
inline

Definition at line 923 of file object.h.

References is_tensor_type(), and LOG_RUNTIME.

◆ operator-() [2/4]

ObjPtr & Obj::operator- ( ObjPtr & obj)

Definition at line 614 of file object.cpp.

References is_tensor_type(), and LOG_RUNTIME.

◆ operator++() [1/2]

ObjPtr Obj::operator++ ( )

Definition at line 625 of file object.cpp.

References is_tensor_type(), LOG_RUNTIME, m_tensor, shared(), and toString().

Referenced by operator++().

◆ operator++() [2/2]

ObjPtr newlang::Obj::operator++ ( int )
inline

Definition at line 940 of file object.h.

References Clone(), and operator++().

◆ operator--() [1/2]

ObjPtr Obj::operator-- ( )

Definition at line 606 of file object.cpp.

References is_tensor_type(), LOG_RUNTIME, m_tensor, shared(), and toString().

Referenced by operator--().

◆ operator--() [2/2]

ObjPtr newlang::Obj::operator-- ( int )
inline

Definition at line 952 of file object.h.

References Clone(), and operator--().

◆ operator*() [1/2]

ObjPtr newlang::Obj::operator* ( ObjPtr obj)
inline

Definition at line 958 of file object.h.

References ASSERT, and operator*().

Referenced by operator*().

◆ operator*() [2/2]

ObjPtr newlang::Obj::operator* ( Obj value)
inline

Definition at line 963 of file object.h.

References Clone(), and result.

◆ operator/() [1/2]

ObjPtr newlang::Obj::operator/ ( ObjPtr obj)
inline

Definition at line 969 of file object.h.

References ASSERT, and operator/().

Referenced by operator/().

◆ operator/() [2/2]

ObjPtr newlang::Obj::operator/ ( Obj value)
inline

Definition at line 974 of file object.h.

References Clone(), and result.

◆ op_div_ceil() [1/2]

ObjPtr newlang::Obj::op_div_ceil ( ObjPtr obj)
inline

Definition at line 980 of file object.h.

References ASSERT, and op_div_ceil().

Referenced by op_div_ceil().

◆ op_div_ceil() [2/2]

ObjPtr newlang::Obj::op_div_ceil ( Obj value)
inline

Definition at line 985 of file object.h.

References Clone(), and result.

◆ op_concat() [1/2]

ObjPtr newlang::Obj::op_concat ( ObjPtr obj,
ConcatMode mode = ConcatMode::Error )
inline

Definition at line 991 of file object.h.

References ASSERT, and op_concat().

Referenced by op_concat().

◆ op_concat() [2/2]

ObjPtr newlang::Obj::op_concat ( Obj & value,
ConcatMode mode = ConcatMode::Error )
inline

Definition at line 996 of file object.h.

References Clone(), and result.

◆ op_concat_() [1/2]

ObjPtr newlang::Obj::op_concat_ ( Obj & obj,
ConcatMode mode = ConcatMode::Error )
inline

Definition at line 1002 of file object.h.

References newlang::ConcatData(), and shared().

Referenced by op_concat_().

◆ op_concat_() [2/2]

ObjPtr newlang::Obj::op_concat_ ( ObjPtr obj,
ConcatMode mode = ConcatMode::Error )
inline

Definition at line 1007 of file object.h.

References op_concat_().

◆ operator%() [1/2]

ObjPtr newlang::Obj::operator% ( ObjPtr obj)
inline

Definition at line 1011 of file object.h.

References ASSERT, and operator%().

Referenced by operator%().

◆ operator%() [2/2]

ObjPtr newlang::Obj::operator% ( Obj value)
inline

Definition at line 1016 of file object.h.

References Clone(), and result.

◆ operator+() [3/4]

ObjPtr newlang::Obj::operator+ ( ObjPtr obj)
inline

Definition at line 1022 of file object.h.

References ASSERT, and operator+().

◆ operator+() [4/4]

ObjPtr newlang::Obj::operator+ ( Obj value)
inline

Definition at line 1027 of file object.h.

References Clone(), and result.

◆ operator+=() [1/2]

ObjPtr newlang::Obj::operator+= ( ObjPtr obj)
inline

Definition at line 1033 of file object.h.

References ASSERT, and operator+=().

Referenced by operator+=().

◆ operator+=() [2/2]

◆ operator-() [3/4]

ObjPtr newlang::Obj::operator- ( ObjPtr obj)
inline

Definition at line 1039 of file object.h.

References ASSERT, and operator-().

◆ operator-() [4/4]

ObjPtr newlang::Obj::operator- ( Obj value)
inline

Definition at line 1044 of file object.h.

References Clone(), and result.

◆ operator-=() [1/2]

ObjPtr newlang::Obj::operator-= ( ObjPtr obj)
inline

Definition at line 1050 of file object.h.

References ASSERT, and operator-=().

Referenced by operator-=().

◆ operator-=() [2/2]

◆ operator<() [1/2]

bool newlang::Obj::operator< ( ObjPtr obj)
inline

Definition at line 1068 of file object.h.

References ASSERT, and operator<().

Referenced by operator<().

◆ operator<() [2/2]

bool newlang::Obj::operator< ( Obj obj)
inline

Definition at line 1073 of file object.h.

References op_compare().

◆ operator<=() [1/2]

bool newlang::Obj::operator<= ( ObjPtr obj)
inline

Definition at line 1081 of file object.h.

References ASSERT, and operator<=().

Referenced by operator<=().

◆ operator<=() [2/2]

bool newlang::Obj::operator<= ( Obj obj)
inline

Definition at line 1086 of file object.h.

References op_compare().

◆ operator>() [1/2]

bool newlang::Obj::operator> ( ObjPtr obj)
inline

Definition at line 1090 of file object.h.

References ASSERT, and operator>().

Referenced by operator>().

◆ operator>() [2/2]

bool newlang::Obj::operator> ( Obj obj)
inline

Definition at line 1095 of file object.h.

References op_compare().

◆ operator>=() [1/2]

bool newlang::Obj::operator>= ( ObjPtr obj)
inline

Definition at line 1099 of file object.h.

References ASSERT, and operator>=().

Referenced by operator>=().

◆ operator>=() [2/2]

bool newlang::Obj::operator>= ( Obj obj)
inline

Definition at line 1104 of file object.h.

References op_compare().

◆ op_compare()

◆ op_class_test() [1/2]

bool Obj::op_class_test ( ObjPtr obj,
Context * ctx ) const

Definition at line 1874 of file object.cpp.

References op_class_test(), and newlang::toString().

Referenced by op_class_test().

◆ op_class_test() [2/2]

◆ op_duck_test() [1/2]

bool newlang::Obj::op_duck_test ( ObjPtr obj,
bool strong )
inline

Definition at line 1125 of file object.h.

References ASSERT, and op_duck_test().

Referenced by op_duck_test().

◆ op_duck_test() [2/2]

◆ op_duck_test_prop()

bool Obj::op_duck_test_prop ( Obj * base,
Obj * value,
bool strong )
static

Definition at line 1919 of file object.cpp.

References m_var_type_current, name(), newlang::None, and size().

Referenced by op_duck_test().

◆ op_equal() [1/2]

bool newlang::Obj::op_equal ( ObjPtr value)
inline

Definition at line 1132 of file object.h.

References ASSERT, and op_equal().

Referenced by op_accurate(), and op_equal().

◆ op_equal() [2/2]

◆ op_accurate() [1/2]

bool newlang::Obj::op_accurate ( ObjPtr obj)
inline

Definition at line 1142 of file object.h.

References ASSERT, and op_accurate().

Referenced by op_accurate().

◆ op_accurate() [2/2]

bool Obj::op_accurate ( Obj & value)

◆ op_bit_and() [1/2]

ObjPtr newlang::Obj::op_bit_and ( ObjPtr obj,
bool strong )
inline

Definition at line 1148 of file object.h.

References ASSERT, and op_bit_and().

Referenced by op_bit_and().

◆ op_bit_and() [2/2]

ObjPtr newlang::Obj::op_bit_and ( Obj & obj,
bool strong )
inline

Definition at line 1153 of file object.h.

References Clone(), and result.

◆ op_pow() [1/2]

ObjPtr newlang::Obj::op_pow ( ObjPtr obj) const
inline

Definition at line 1159 of file object.h.

References ASSERT, and op_pow().

Referenced by op_pow().

◆ op_pow() [2/2]

ObjPtr newlang::Obj::op_pow ( Obj & obj) const
inline

Definition at line 1164 of file object.h.

References Clone(), and result.

◆ op_pow_() [1/2]

ObjPtr newlang::Obj::op_pow_ ( ObjPtr obj)
inline

Definition at line 1170 of file object.h.

References ASSERT, and op_pow_().

Referenced by op_pow_().

◆ op_pow_() [2/2]

◆ op_assign() [1/2]

ObjPtr newlang::Obj::op_assign ( ObjPtr obj)
inline

Definition at line 1193 of file object.h.

References clear_(), op_assign(), and shared().

Referenced by op_assign().

◆ op_assign() [2/2]

ObjPtr newlang::Obj::op_assign ( Obj & obj)
inline

Definition at line 1201 of file object.h.

References clear_(), CloneDataTo(), ClonePropTo(), and shared().

◆ operator=() [1/2]

bool newlang::Obj::operator= ( Obj & obj)
inline

Definition at line 1208 of file object.h.

References clear_(), CloneDataTo(), and ClonePropTo().

◆ operator*=() [1/2]

ObjPtr newlang::Obj::operator*= ( ObjPtr obj)
inline

Definition at line 1223 of file object.h.

References ASSERT, and operator*=().

Referenced by operator*=().

◆ operator*=() [2/2]

◆ operator/=() [1/2]

ObjPtr newlang::Obj::operator/= ( ObjPtr obj)
inline

Definition at line 1232 of file object.h.

References ASSERT, and operator/=().

Referenced by operator/=().

◆ operator/=() [2/2]

◆ op_div_ceil_() [1/2]

ObjPtr newlang::Obj::op_div_ceil_ ( ObjPtr obj)
inline

Definition at line 1239 of file object.h.

References ASSERT, and op_div_ceil_().

Referenced by op_div_ceil_().

◆ op_div_ceil_() [2/2]

◆ operator%=() [1/2]

ObjPtr newlang::Obj::operator%= ( ObjPtr obj)
inline

Definition at line 1246 of file object.h.

References ASSERT, and operator%=().

Referenced by operator%=().

◆ operator%=() [2/2]

◆ op_bit_and_set()

◆ operator^=() [1/2]

ObjPtr newlang::Obj::operator^= ( ObjPtr obj)
inline

Definition at line 1256 of file object.h.

References ASSERT, and operator^=().

Referenced by operator^=().

◆ operator^=() [2/2]

ObjPtr newlang::Obj::operator^= ( Obj )
inline

Definition at line 1261 of file object.h.

References LOG_RUNTIME.

◆ operator|=() [1/2]

ObjPtr newlang::Obj::operator|= ( ObjPtr obj)
inline

Definition at line 1265 of file object.h.

References ASSERT, and operator|=().

Referenced by operator|=().

◆ operator|=() [2/2]

ObjPtr newlang::Obj::operator|= ( Obj )
inline

Definition at line 1270 of file object.h.

References LOG_RUNTIME.

◆ op_lshift_set() [1/2]

ObjPtr newlang::Obj::op_lshift_set ( ObjPtr obj)
inline

Definition at line 1274 of file object.h.

References ASSERT, and op_lshift_set().

Referenced by op_lshift_set().

◆ op_lshift_set() [2/2]

ObjPtr newlang::Obj::op_lshift_set ( Obj )
inline

Definition at line 1279 of file object.h.

References LOG_RUNTIME.

◆ op_rshift_set() [1/2]

ObjPtr newlang::Obj::op_rshift_set ( ObjPtr obj)
inline

Definition at line 1283 of file object.h.

References ASSERT, and op_rshift_set().

Referenced by op_rshift_set().

◆ op_rshift_set() [2/2]

ObjPtr newlang::Obj::op_rshift_set ( Obj )
inline

Definition at line 1288 of file object.h.

References LOG_RUNTIME.

◆ op_rrshift_set() [1/2]

ObjPtr newlang::Obj::op_rrshift_set ( ObjPtr obj)
inline

Definition at line 1292 of file object.h.

References ASSERT, and op_rrshift_set().

Referenced by op_rrshift_set().

◆ op_rrshift_set() [2/2]

ObjPtr newlang::Obj::op_rrshift_set ( Obj )
inline

Definition at line 1297 of file object.h.

References LOG_RUNTIME.

◆ operator=() [2/2]

template<typename T >
bool newlang::Obj::operator= ( T value)
inline

Definition at line 1302 of file object.h.

References SetValue_().

◆ GetIndex() [1/2]

ObjPtr Obj::GetIndex ( ObjPtr obj,
TermPtr index_arg )
static

◆ GetIndex() [2/2]

static ObjPtr newlang::Obj::GetIndex ( ObjPtr obj,
size_t index )
inlinestatic

Definition at line 1310 of file object.h.

References newlang::Dict< Obj >::index().

◆ dump_dict_()

void newlang::Obj::dump_dict_ ( std::string & str,
bool deep = true ) const
inline

Definition at line 1314 of file object.h.

References newlang::Class.

Referenced by toString().

◆ toString()

std::string Obj::toString ( bool deep = true) const

Definition at line 1049 of file object.cpp.

References ASSERT, at(), newlang::BLOCK, newlang::BLOCK_MINUS, newlang::BLOCK_PLUS, newlang::BLOCK_TRY, newlang::Break, newlang::Class, newlang::Continue, newlang::Dictionary, dump_dict_(), newlang::Ellipsis, empty(), newlang::Enum, newlang::Error, newlang::ErrorParser, newlang::ErrorRunTime, newlang::ErrorSignal, newlang::EVAL_FUNCTION, newlang::FmtChar, newlang::FmtWide, newlang::Function, newlang::Rational::GetAsString(), GetValueAsString(), is_scalar(), is_tensor_type(), newlang::isSimpleType(), newlang::Iterator, newlang::IteratorEnd, LOG_RUNTIME, m_class_name, m_dimensions, m_is_reference, m_prototype, m_rational, m_reference, m_return_obj, m_string, m_tensor, m_value, m_var, m_var_name, m_var_type_current, m_var_type_fixed, newlang::Module, newlang::NativeFunc, newlang::None, newlang::Pointer, newlang::PureFunc, newlang::Range, newlang::Rational, newlang::Reference, result, newlang::RetMinus, newlang::RetPlus, newlang::RetRepeat, size(), newlang::StrChar, newlang::Struct, newlang::StrWide, TensorToString(), newlang::toString(), newlang::Type, newlang::Union, and newlang::utf8_encode().

Referenced by newlang::Context::Call(), newlang::Context::CallNative_(), newlang::CheckSystemField(), ClonePropTo(), newlang::ConcatData(), getSummaryTensorType(), GetValueAsBoolean(), GetValueAsInteger(), GetValueAsNumber(), GetValueAsRational(), GetValueAsString(), index_set_(), IteratorData(), IteratorMake(), IteratorMake(), op_div_ceil_(), op_pow_(), operator%=(), operator*=(), operator+(), operator++(), operator+=(), operator-(), operator--(), operator-=(), operator/=(), operator<<(), toIndex(), and toType_().

◆ GetValueAsString()

◆ GetValueAsStringWide()

std::wstring newlang::Obj::GetValueAsStringWide ( ) const
inline

Definition at line 1355 of file object.h.

References GetValueAsString(), and newlang::utf8_decode().

Referenced by newlang::ConcatData(), op_compare(), and operator std::wstring().

◆ GetValueAsRational()

std::shared_ptr< Rational > newlang::Obj::GetValueAsRational ( ) const
inline

◆ GetValueAsInteger()

◆ GetValueAsNumber()

◆ GetValueAsBoolean()

◆ CreateType()

◆ CreateRational() [1/2]

static ObjPtr newlang::Obj::CreateRational ( const Rational & val)
inlinestatic

◆ CreateRational() [2/2]

static ObjPtr newlang::Obj::CreateRational ( const std::string val)
inlinestatic

Definition at line 1443 of file object.h.

References CreateType(), LOG_RUNTIME, and newlang::Rational.

◆ BaseTypeConstructor()

◆ ConstructorSimpleType_()

◆ ConstructorDictionary_()

ObjPtr Obj::ConstructorDictionary_ ( Context * ctx,
Obj & args )
static

Definition at line 2828 of file object.cpp.

References ASSERT, CreateDict(), empty(), getType(), name(), result, size(), and newlang::Type.

Referenced by BaseTypeConstructor().

◆ ConstructorNative_()

ObjPtr Obj::ConstructorNative_ ( Context * ctx,
Obj & args )
static

Definition at line 2842 of file object.cpp.

References LOG_RUNTIME.

Referenced by BaseTypeConstructor().

◆ ConstructorStub_()

ObjPtr Obj::ConstructorStub_ ( Context * ctx,
Obj & args )
static

Definition at line 2854 of file object.cpp.

References CreateClass().

◆ ConstructorClass_()

ObjPtr Obj::ConstructorClass_ ( Context * ctx,
Obj & args )
static

Definition at line 2869 of file object.cpp.

References ASSERT.

Referenced by BaseTypeConstructor(), and ConstructorStruct_().

◆ ConstructorStruct_()

ObjPtr Obj::ConstructorStruct_ ( Context * ctx,
Obj & args )
static

◆ ConstructorEnum_()

◆ CreateBaseType()

◆ toIntVector()

std::vector< int64_t > newlang::Obj::toIntVector ( bool raise = true) const
inline

Definition at line 1498 of file object.h.

References at(), LOG_RUNTIME, result, and size().

Referenced by toIndex().

◆ CreateNone()

◆ CreateEmpty()

static ObjPtr newlang::Obj::CreateEmpty ( Sync * sync = nullptr)
inlinestatic

Definition at line 1514 of file object.h.

References CreateType(), and newlang::None.

◆ CreatePointer()

static ObjPtr newlang::Obj::CreatePointer ( void * ptr = nullptr,
Sync * sync = nullptr )
inlinestatic

Definition at line 1518 of file object.h.

References CreateType(), and newlang::Pointer.

Referenced by CreateNil().

◆ CreateNil()

static ObjPtr newlang::Obj::CreateNil ( Sync * sync = nullptr)
inlinestatic

Definition at line 1524 of file object.h.

References CreatePointer().

Referenced by ArgNull(), and newlang::Context::StringPrintf().

◆ CreateBool()

static ObjPtr newlang::Obj::CreateBool ( bool value,
Sync * sync = nullptr )
inlinestatic

◆ CreateRange() [1/2]

template<typename T1 , typename T2 , typename T3 >
static ObjPtr newlang::Obj::CreateRange ( T1 start,
T2 stop,
T3 step,
Sync * sync = nullptr )
inlinestatic

◆ CreateRange() [2/2]

template<typename T1 , typename T2 >
static ObjPtr newlang::Obj::CreateRange ( T1 start,
T2 stop,
Sync * sync = nullptr )
inlinestatic

Definition at line 1546 of file object.h.

References CreateType(), CreateValue(), newlang::Dictionary, newlang::None, and newlang::Range.

◆ CreateValue() [1/4]

◆ CreateValue() [2/4]

template<typename T >
static std::enable_if< std::is_same< T, std::wstring >::value||std::is_same< T, constwchar_t * >::value, ObjPtr >::type newlang::Obj::CreateValue ( T value,
Sync * sync = nullptr )
inlinestatic

Definition at line 1568 of file object.h.

References CreateString().

◆ CreateValue() [3/4]

template<typename T >
static std::enable_if< std::is_integral< T >::value, ObjPtr >::type newlang::Obj::CreateValue ( T value,
ObjType fix_type = ObjType::None,
Sync * sync = nullptr )
inlinestatic

◆ CreateValue() [4/4]

template<typename T >
static std::enable_if< std::is_floating_point< T >::value, ObjPtr >::type newlang::Obj::CreateValue ( T value,
ObjType fix_type = ObjType::None,
Sync * sync = nullptr )
inlinestatic

◆ CreateString() [1/2]

◆ CreateString() [2/2]

static ObjPtr newlang::Obj::CreateString ( const std::wstring_view str,
Sync * sync = nullptr )
inlinestatic

Definition at line 1602 of file object.h.

References CreateType(), result, newlang::String, and newlang::StrWide.

◆ Yes()

static ObjPtr newlang::Obj::Yes ( Sync * sync = nullptr)
inlinestatic

Definition at line 1609 of file object.h.

References newlang::Bool, CreateType(), and result.

◆ No()

static ObjPtr newlang::Obj::No ( Sync * sync = nullptr)
inlinestatic

Definition at line 1615 of file object.h.

References newlang::Bool, CreateType(), and result.

◆ CreateDict() [1/3]

◆ CreateDict() [2/3]

template<typename... T>
static std::enable_if< is_all< PairType, T... >::value, ObjPtr >::type newlang::Obj::CreateDict ( T ... args)
inlinestatic

Definition at line 1631 of file object.h.

References CreateType(), newlang::Dictionary, and result.

◆ CreateDict() [3/3]

static ObjPtr newlang::Obj::CreateDict ( const std::vector< ObjPtr > & arr,
Sync * sync = nullptr )
inlinestatic

Definition at line 1642 of file object.h.

References CreateType(), newlang::Dictionary, newlang::None, and result.

◆ CreateClass() [1/2]

static ObjPtr newlang::Obj::CreateClass ( std::string name)
inlinestatic

Definition at line 1657 of file object.h.

References newlang::Class, CreateType(), name(), and result.

Referenced by ConstructorStub_().

◆ CreateClass() [2/2]

template<typename... T>
static std::enable_if< is_all< PairType, T... >::value, ObjPtr >::type newlang::Obj::CreateClass ( std::string name,
T ... args )
inlinestatic

Definition at line 1667 of file object.h.

References newlang::Class, CreateType(), name(), and result.

◆ CallNative()

ObjPtr newlang::Obj::CallNative ( Context * ctx,
Obj args )

◆ Copy()

ObjPtr newlang::Obj::Copy ( ) const
inline

Definition at line 1682 of file object.h.

References CloneDataTo(), ClonePropTo(), and CreateNone().

◆ Clone()

◆ CloneTo() [1/2]

void newlang::Obj::CloneTo ( Obj & clone)
inline

Definition at line 1700 of file object.h.

References newlang::clone(), CloneDataTo(), and ClonePropTo().

◆ CloneTo() [2/2]

void newlang::Obj::CloneTo ( ObjPtr & clone)
inline

Definition at line 1710 of file object.h.

References newlang::clone(), CloneDataTo(), ClonePropTo(), and CreateNone().

◆ CloneDataTo()

◆ ClonePropTo()

void Obj::ClonePropTo ( Obj & clone) const

◆ toType()

◆ toType_()

◆ index_get()

◆ index_set()

ObjPtr newlang::Obj::index_set ( const std::vector< Index > & index,
const ObjPtr value ) const
inline

Definition at line 1750 of file object.h.

References Clone(), newlang::Dict< Obj >::index(), and result.

◆ index_set_()

◆ op_set_index() [1/2]

ObjPtr newlang::Obj::op_set_index ( ObjPtr index,
ObjPtr value )
inline

Definition at line 1758 of file object.h.

References newlang::Dict< Obj >::index(), and op_set_index().

Referenced by op_set_index().

◆ op_set_index() [2/2]

◆ SetValue_() [1/8]

template<typename T >
std::enable_if< std::is_same< T, bool >::value, void >::type newlang::Obj::SetValue_ ( bool value)
inline

Definition at line 1766 of file object.h.

References SetValue_().

Referenced by operator-(), operator=(), SetValue_(), SetValue_(), and SetValue_().

◆ SetValue_() [2/8]

template<typename T >
std::enable_if< std::is_integral< T >::value, void >::type newlang::Obj::SetValue_ ( T value)
inline

◆ SetValue_() [3/8]

template<typename T >
std::enable_if< std::is_floating_point< T >::value, void >::type newlang::Obj::SetValue_ ( T value)
inline

◆ SetValue_() [4/8]

template<typename T >
std::enable_if< std::is_same< char *, T >::value, void >::type newlang::Obj::SetValue_ ( T text)
inline

Definition at line 1797 of file object.h.

References SetValue_().

◆ SetValue_() [5/8]

template<typename T >
std::enable_if< std::is_same< wchar_t *, T >::value, void >::type newlang::Obj::SetValue_ ( T text)
inline

Definition at line 1805 of file object.h.

References SetValue_().

◆ SetValue_() [6/8]

void newlang::Obj::SetValue_ ( std::string text)
inline

◆ SetValue_() [7/8]

void newlang::Obj::SetValue_ ( std::wstring text)
inline

◆ testConvertType()

void newlang::Obj::testConvertType ( ObjType type)
inline

◆ testResultIntegralType()

◆ SetValue_() [8/8]

◆ CallAll()

bool newlang::Obj::CallAll ( const char * func_name,
ObjPtr & arg_in,
ObjPtr & result,
ObjPtr object = nullptr,
size_t limit = 0 )

◆ CallOnce()

bool newlang::Obj::CallOnce ( ObjPtr & arg_in,
ObjPtr & result,
ObjPtr object = nullptr )

◆ Proto()

const TermPtr newlang::Obj::Proto ( )
inline

Definition at line 1851 of file object.h.

References m_prototype.

◆ remove()

void newlang::Obj::remove ( const Dict::PairType & value)
inline

Definition at line 1860 of file object.h.

Member Data Documentation

◆ m_var_type_current

ObjType newlang::Obj::m_var_type_current

Текущий тип значения объекта

Definition at line 1864 of file object.h.

Referenced by at(), at(), at_index(), at_index_const(), begin(), begin(), newlang::Context::CallNative_(), newlang::CheckSystemField(), clear_(), CloneDataTo(), ClonePropTo(), newlang::ConcatData(), ConvertTensorToDict(), empty(), end(), end(), erase(), erase(), find(), GetGenericValueRef(), getSummaryTensorType(), getType(), getTypeAsLimit(), GetValueAsBoolean(), GetValueAsInteger(), GetValueAsNumber(), GetValueAsRational(), GetValueAsString(), index_get(), index_set_(), insert(), is_any_size(), is_arithmetic_type(), is_block(), is_bool_type(), is_class_type(), is_complex(), is_dictionary_type(), is_ellipsis(), is_error(), is_floating(), is_function_type(), is_indexing(), is_integer(), is_integral(), is_native(), is_none_type(), is_plain_type(), is_range(), is_rational(), is_return(), is_simple_type(), is_string_char_type(), is_string_type(), is_string_wide_type(), is_tensor_type(), is_type_name(), IteratorData(), IteratorMake(), IteratorMake(), IteratorNext(), IteratorReset(), op_bit_and_set(), op_class_test(), op_compare(), op_div_ceil_(), op_duck_test(), op_duck_test_prop(), op_equal(), op_pow_(), op_set_index(), operator%=(), operator*=(), operator+=(), operator-(), operator-=(), operator/=(), operator[](), operator[](), push_back(), push_back(), resize(), resize_(), SetValue_(), SetValue_(), SetValue_(), SetValue_(), size(), newlang::Context::StringPrintf(), testResultIntegralType(), toIndex(), toString(), and toType_().

◆ m_var_type_fixed

ObjType newlang::Obj::m_var_type_fixed

Максимальный размер для арифметических типов, который задается разработчиком

Definition at line 1865 of file object.h.

Referenced by BaseTypeConstructor(), newlang::CheckSystemField(), CloneDataTo(), ConstructorSimpleType_(), getSummaryTensorType(), getTypeAsLimit(), GetValueAsInteger(), GetValueAsString(), is_defined_type(), is_error(), is_indexing(), Obj(), op_class_test(), testConvertType(), testResultIntegralType(), toString(), and toType_().

◆ m_var_is_init

bool newlang::Obj::m_var_is_init

Содержит ли объект корректное значение ???

Definition at line 1866 of file object.h.

Referenced by clear_(), CloneDataTo(), newlang::ConcatData(), ConvertTensorToDict(), empty(), GetValueAsString(), index_set_(), is_init(), Obj(), op_class_test(), op_set_index(), SetValue_(), SetValue_(), SetValue_(), and SetValue_().

◆ m_var_name

std::string newlang::Obj::m_var_name

Имя переменной, в которой хранится объект

Definition at line 1870 of file object.h.

Referenced by newlang::CheckSystemField(), CloneDataTo(), getName(), getName(), GetValueAsString(), SetValue_(), and toString().

◆ m_class_name

std::string newlang::Obj::m_class_name

Имя класса объекта (у базовых типов отсуствует)

Definition at line 1871 of file object.h.

Referenced by newlang::CheckSystemField(), CloneDataTo(), GetValueAsString(), op_class_test(), SetClassName(), SetValue_(), and toString().

◆ m_class_parents

std::vector<ObjPtr> newlang::Obj::m_class_parents

Родительские классы (типы)

Definition at line 1872 of file object.h.

Referenced by newlang::CheckSystemField(), clear_(), CloneDataTo(), GetValueAsBoolean(), and op_class_test().

◆ m_module_name

std::string newlang::Obj::m_module_name

Definition at line 1873 of file object.h.

◆ m_prototype

const TermPtr newlang::Obj::m_prototype

Описание прототипа функции (или данных)

Definition at line 1874 of file object.h.

Referenced by newlang::Context::Call(), newlang::Context::CallNative_(), CloneDataTo(), Proto(), and toString().

◆ m_ctx

Context* newlang::Obj::m_ctx

Definition at line 1876 of file object.h.

Referenced by CloneDataTo(), Obj(), op_call(), and op_class_test().

◆ m_dimensions

ObjPtr newlang::Obj::m_dimensions

Размерности для ObjType::Type.

Definition at line 1878 of file object.h.

Referenced by newlang::Context::Call(), CloneDataTo(), ConstructorSimpleType_(), Obj(), and toString().

◆ m_str_pair

PairType newlang::Obj::m_str_pair
mutable

Definition at line 1880 of file object.h.

Referenced by at(), at(), at(), and at().

◆ m_func_mangle_name

std::string newlang::Obj::m_func_mangle_name

Definition at line 1882 of file object.h.

◆ m_var

std::variant< std::monostate, int64_t, double, void *, bool *, int8_t *, int16_t *, int32_t *, int64_t *, float *, double *, NativeData, std::string, TermPtr, Iterator < Obj> > newlang::Obj::m_var

◆ m_value

std::string newlang::Obj::m_value

Содержит байтовую строку или байтовый массив с данными для представления в нативном виде (Struct, Unuion, Enum)

Definition at line 1905 of file object.h.

Referenced by at(), at(), clear_(), CloneDataTo(), newlang::ConcatData(), empty(), GetGenericValueRef(), GetValueAsBoolean(), GetValueAsInteger(), GetValueAsString(), newlang::Context::HasReThrow(), index_get(), index_set_(), op_compare(), op_pow_(), op_set_index(), operator*=(), operator+=(), resize_(), SetValue_(), size(), toString(), and toType_().

◆ m_string

std::wstring newlang::Obj::m_string

◆ m_tensor

std::shared_ptr<torch::Tensor> newlang::Obj::m_tensor

Содержит только размерные тензоры (скляры хранятся в поле m_pointer и не создают m_tensor->defined())

Definition at line 1907 of file object.h.

Referenced by at(), at(), clear_(), CloneDataTo(), newlang::ConcatData(), empty(), erase(), GetValueAsBoolean(), GetValueAsString(), index_get(), index_set_(), is_scalar(), Obj(), op_bit_and_set(), op_div_ceil_(), op_equal(), op_pow_(), operator%=(), operator*=(), operator++(), operator+=(), operator--(), operator-=(), operator/=(), resize_(), SetValue_(), size(), testResultIntegralType(), toIndex(), toString(), and toType_().

◆ m_rational

◆ m_iterator

std::shared_ptr<Iterator < Obj> > newlang::Obj::m_iterator

Итератор для данных

Definition at line 1909 of file object.h.

Referenced by CloneDataTo(), GetValueAsBoolean(), GetValueAsInteger(), GetValueAsNumber(), IteratorData(), IteratorNext(), and IteratorReset().

◆ m_iter_range_value

ObjPtr newlang::Obj::m_iter_range_value
mutable

Definition at line 1910 of file object.h.

Referenced by CloneDataTo().

◆ m_sequence

TermPtr newlang::Obj::m_sequence

Последовательно распарсенных команд для выполнения

Definition at line 1911 of file object.h.

Referenced by newlang::Context::Call(), CloneDataTo(), and SetValue_().

◆ m_return_obj

ObjPtr newlang::Obj::m_return_obj

◆ m_reference

ObjWeak newlang::Obj::m_reference

Definition at line 1914 of file object.h.

Referenced by CloneDataTo(), and toString().

◆ m_sync

Sync* newlang::Obj::m_sync

Definition at line 1915 of file object.h.

Referenced by CloneDataTo(), and Obj().

◆ m_check_args

bool newlang::Obj::m_check_args

Definition at line 1917 of file object.h.

Referenced by Obj().

◆ m_is_const

bool newlang::Obj::m_is_const

Definition at line 1925 of file object.h.

Referenced by CloneDataTo(), is_const(), MakeConst(), MakeMutable(), and Obj().

◆ m_is_reference

bool newlang::Obj::m_is_reference

Definition at line 1926 of file object.h.

Referenced by Obj(), and toString().


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