top | up | prev | next

ArrayValue Abstract Class

Definition at line 411 of Value.hpp

Constructors

ArrayValue(const ArrayValue&) delete
ArrayValue(const Span& span_, const boost::uuids::uuid& moduleId_, TypeSymbol* type_, std::vector<std::unique_ptr<Value>>&& elementValues_)

Member Functions

Value* As(TypeSymbol* targetType, bool cast, const Span& span, const boost::uuids::uuid& moduleId, bool dontThrow) const
const char* ClassName() const override
Value* Clone() const override
const std::vector<std::unique_ptr<Value>>& Elements() const
std::vector<std::unique_ptr<Value>>& Elements()
TypeSymbol* GetType(SymbolTable* symbolTable) override
void* IrValue(Emitter& emitter)
bool IsComplexValue() const override
void Read(BinaryReader& reader) override
void SetType(TypeSymbol* type_) override
void Write(BinaryWriter& writer) override
ArrayValue& operator=(const ArrayValue&) delete

Member Variables

std::vector<std::unique_ptr<Value>> elementValues
TypeSymbol* type

Constructor Details

ArrayValue Constructor

cmajor::symbols::ArrayValue::ArrayValue(const ArrayValue &) delete

Definition at line 415 of Value.hpp


ArrayValue Constructor

cmajor::symbols::ArrayValue::ArrayValue(const Span& span_, const boost::uuids::uuid& moduleId_, TypeSymbol * type_, std::vector<std::unique_ptr<Value >>&& elementValues_)

Definition at line 4021 of Value.cpp :
4021 :
4022 Value(span_moduleId_ValueType::arrayValue)type(type_)elementValues(std::move(elementValues_))
4023 {
4024 }



Member Function Details

As Member Function

Value * cmajor::symbols::ArrayValue::As(TypeSymbol * targetType, bool cast, const Span& span, const boost::uuids::uuid& moduleId, bool dontThrow) const

Definition at line 4070 of Value.cpp

Calls: cmajor::symbols::ArrayValue::Clone , cmajor::symbols::TypeSymbol::GetValueType , cmajor::symbols::Value::GetValueType


ClassName Member Function

const char * cmajor::symbols::ArrayValue::ClassName() const override

Definition at line 427 of Value.hpp :
427 { return "ArrayValue"; }

Base class overridden functions: cmajor::symbols::Value::ClassName


Clone Member Function

Value * cmajor::symbols::ArrayValue::Clone() const override

Definition at line 4026 of Value.cpp :
4027 {
4028     std::vector<std::std::unique_ptr<Value>>clonedElementValues;
4029     int64_t n = elementValues.size();
4030     for (int64_t i = 0; i < n; ++i)
4031     {
4032         clonedElementValues.push_back(std::unique_ptr<Value>(elementValues[i]->Clone()));
4033     }
4034     return new ArrayValue(GetSpan()ModuleId()typestd::move(clonedElementValues));
4035 }


Declaration at line 417 of Value.hpp

Base class overridden functions: cmajor::symbols::Value::Clone

Calls: cmajor::symbols::ArrayValue::Clone , cmajor::symbols::Value::GetSpan , cmajor::symbols::Value::ModuleId

Called by: cmajor::symbols::ArrayValue::As , cmajor::symbols::ArrayValue::Clone


Elements Member Function

const std::vector<std::unique_ptr<Value >>& cmajor::symbols::ArrayValue::Elements() const

Definition at line 425 of Value.hpp :
425 { return elementValues; }


Elements Member Function

std::vector<std::unique_ptr<Value >>& cmajor::symbols::ArrayValue::Elements()

Definition at line 426 of Value.hpp :
426 { return elementValues; }


GetType Member Function

TypeSymbol * cmajor::symbols::ArrayValue::GetType(SymbolTable * symbolTable) override

Definition at line 423 of Value.hpp :
423 { return type; }

Base class overridden functions: cmajor::symbols::Value::GetType


IrValue Member Function

void * cmajor::symbols::ArrayValue::IrValue(Emitter& emitter)

Definition at line 4037 of Value.cpp :
4038 {
4039     std::vector<void*> elementConstants;
4040     int64_t n = elementValues.size();
4041     for (int64_t i = 0; i < n; ++i)
4042     {
4043         elementConstants.push_back(elementValues[i]->IrValue(emitter));
4044     }
4045     return emitter.CreateIrValueForConstantArray(type->IrType(emitter)elementConstantsstd::string());
4046 }


Calls: cmajor::symbols::ArrayValue::IrValue , cmajor::symbols::TypeSymbol::IrType

Called by: cmajor::symbols::ArrayValue::IrValue , cmajor::symbols::ConstantSymbol::ArrayIrObject


IsComplexValue Member Function

bool cmajor::symbols::ArrayValue::IsComplexValue() const override

Definition at line 421 of Value.hpp :
421 { return true; }

Base class overridden functions: cmajor::symbols::Value::IsComplexValue


Read Member Function

void cmajor::symbols::ArrayValue::Read(BinaryReader& reader) override

Definition at line 4059 of Value.cpp :
4060 {
4061     int64_t length = reader.ReadLong();
4062     for (int64_t i = 0; i < length; ++i)
4063     {
4064         Value* elementValue = static_cast<ArrayTypeSymbol*>(type)->ElementType()->MakeValue();
4065         elementValue->Read(reader);
4066         elementValues.push_back(std::unique_ptr<Value>(elementValue));
4067     }
4068 }


Declaration at line 420 of Value.hpp

Base class overridden functions: cmajor::symbols::Value::Read

Calls: cmajor::symbols::Value::Read


SetType Member Function

void cmajor::symbols::ArrayValue::SetType(TypeSymbol * type_) override

Definition at line 424 of Value.hpp :
424 { type = type_; }

Base class overridden functions: cmajor::symbols::Value::SetType


Write Member Function

void cmajor::symbols::ArrayValue::Write(BinaryWriter& writer) override

Definition at line 4048 of Value.cpp :
4049 {
4050     int64_t length = elementValues.size();
4051     writer.Write(length);
4052     for (int64_t i = 0; i < length; ++i)
4053     {
4054         Value* value = elementValues[i].get();
4055         value->Write(writer);
4056     }
4057 }


Declaration at line 419 of Value.hpp

Base class overridden functions: cmajor::symbols::Value::Write

Calls: cmajor::symbols::ArrayValue::Write , cmajor::symbols::Value::Write

Called by: cmajor::symbols::ArrayValue::Write


operator= Member Function

ArrayValue & cmajor::symbols::ArrayValue::operator=(const ArrayValue &) delete

Definition at line 416 of Value.hpp


top | up | prev | next