NewLang Project
Yet another programm language
Loading...
Searching...
No Matches
object.h File Reference
#include <regex>
#include "types.h"
#include "dict.h"
#include "rational.h"
Include dependency graph for object.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  newlang::Iterator< T >
 
class  newlang::Obj
 
struct  newlang::Obj::NativeData
 
class  newlang::IntAny
 
class  newlang::IntPlus
 
class  newlang::IntMinus
 

Namespaces

namespace  newlang
 

Macros

#define INCLUDED_OBJECT_H_
 
#define TEST_CONST_()   if (m_is_const) {LOG_RUNTIME("Can`t edit const value '%s'!", toString().c_str());}
 
#define TEST_INIT_()   if (!m_var_is_init) {LOG_RUNTIME("Object not initialized '%s'!", toString().c_str());}
 
#define PLACE_RANGE_CHECK_VALUE(itype, utype)
 

Typedefs

typedef at::indexing::TensorIndex Index
 
typedef at::IntArrayRef Dimension
 

Enumerations

enum class  newlang::ConcatMode : uint8_t { newlang::Error = 0 , newlang::Append = 1 , newlang::Discard = 2 }
 

Functions

std::vector< int64_t > newlang::TensorShapeFromDict (const Obj *obj)
 
ObjPtr newlang::CheckSystemField (const Obj *obj, const std::string name)
 
int64_t newlang::ConcatData (Obj *dest, Obj &src, ConcatMode mode=ConcatMode::Error)
 
std::ostream & operator<< (std::ostream &out, newlang::Obj &var)
 
std::ostream & operator<< (std::ostream &out, newlang::ObjPtr var)
 

Macro Definition Documentation

◆ INCLUDED_OBJECT_H_

#define INCLUDED_OBJECT_H_

Definition at line 3 of file object.h.

◆ TEST_CONST_

#define TEST_CONST_ ( )    if (m_is_const) {LOG_RUNTIME("Can`t edit const value '%s'!", toString().c_str());}

◆ TEST_INIT_

#define TEST_INIT_ ( )    if (!m_var_is_init) {LOG_RUNTIME("Object not initialized '%s'!", toString().c_str());}

◆ PLACE_RANGE_CHECK_VALUE

#define PLACE_RANGE_CHECK_VALUE ( itype,
utype )
Value:
explicit inline operator itype() const { \
int64_t result = GetValueAsInteger(); \
if (result > std::numeric_limits<itype>::max() || result < std::numeric_limits<itype>::lowest()) { \
LOG_RUNTIME("Value '%s' is out of range of the casting type %s!", GetValueAsString().c_str(), #itype); \
} \
return result; \
} \
explicit inline operator utype() const { \
int64_t result = GetValueAsInteger(); \
if (result > std::numeric_limits<utype>::max() || result < 0) { \
LOG_RUNTIME("Value '%s' is out of range of the casting type %s!", GetValueAsString().c_str(), #utype); \
} \
return result; \
}
int result
Definition lexer.l:367

Definition at line 858 of file object.h.

Typedef Documentation

◆ Index

typedef at::indexing::TensorIndex Index

Definition at line 12 of file object.h.

◆ Dimension

typedef at::IntArrayRef Dimension

Definition at line 13 of file object.h.

Function Documentation

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream & out,
newlang::Obj & var )

Definition at line 164 of file object.cpp.

References newlang::Obj::toString().

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & out,
newlang::ObjPtr var )

Definition at line 169 of file object.cpp.