top | up | prev | next

StructuredValue Abstract Class

Definition at line 433 of Value.hpp

Constructors

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

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
TypeSymbol* GetType(SymbolTable* symbolTable) override
void* IrValue(Emitter& emitter)
bool IsComplexValue() const override
const std::vector<std::unique_ptr<Value>>& Members() const
std::vector<std::unique_ptr<Value>>& Members()
void Read(BinaryReader& reader) override
void SetType(TypeSymbol* type_) override
void Write(BinaryWriter& writer) override
StructuredValue& operator=(const StructuredValue&) delete

Member Variables

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

Constructor Details

StructuredValue Constructor

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

Definition at line 4089 of Value.cpp :
4089 :
4090 Value(span_moduleId_ValueType::structuredValue)type(type_)memberValues(std::move(memberValues_))
4091 {
4092 }



StructuredValue Constructor

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

Definition at line 437 of Value.hpp


Member Function Details

As Member Function

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

Definition at line 4149 of Value.cpp

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


ClassName Member Function

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

Definition at line 449 of Value.hpp :
449 { return "StructuredValue"; }

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


Clone Member Function

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

Definition at line 4094 of Value.cpp :
4095 {
4096     std::vector<std::std::unique_ptr<Value>>clonedMemberValues;
4097     int n = memberValues.size();
4098     for (int i = 0; i < n; ++i)
4099     {
4100         std::unique_ptr<Value> memberValue(memberValues[i]->Clone());
4101         clonedMemberValues.push_back(std::move(memberValue));
4102     }
4103     return new StructuredValue(GetSpan()ModuleId()typestd::move(clonedMemberValues));
4104 }


Declaration at line 439 of Value.hpp

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

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

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


GetType Member Function

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

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

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


IrValue Member Function

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

Definition at line 4106 of Value.cpp

Calls: cmajor::symbols::ClassTypeSymbol::ObjectLayout , cmajor::symbols::StructuredValue::IrValue , cmajor::symbols::TypeSymbol::CreateDefaultIrValue , cmajor::symbols::TypeSymbol::IrType

Called by: cmajor::symbols::ConstantSymbol::StructureIrObject , cmajor::symbols::StructuredValue::IrValue


IsComplexValue Member Function

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

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

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


Members Member Function

const std::vector<std::unique_ptr<Value >>& cmajor::symbols::StructuredValue::Members() const

Definition at line 447 of Value.hpp :
447 { return memberValues; }


Members Member Function

std::vector<std::unique_ptr<Value >>& cmajor::symbols::StructuredValue::Members()

Definition at line 448 of Value.hpp :
448 { return memberValues; }


Read Member Function

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

Definition at line 4139 of Value.cpp :
4140 {
4141     for (MemberVariableSymbol* memberVariable : static_cast<ClassTypeSymbol*>(type)->MemberVariables())
4142     {
4143         Value* memberValue = memberVariable->GetType()->MakeValue();
4144         memberValue->Read(reader);
4145         memberValues.push_back(std::unique_ptr<Value>(memberValue));
4146     }
4147 }


Declaration at line 442 of Value.hpp

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

Calls: cmajor::symbols::TypeSymbol::MakeValue , cmajor::symbols::Value::Read , cmajor::symbols::VariableSymbol::GetType


SetType Member Function

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

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

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


Write Member Function

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

Definition at line 4131 of Value.cpp :
4132 {
4133     for (const std::std::unique_ptr<Value>&memberValue : memberValues)
4134     {
4135         memberValue->Write(writer);
4136     }
4137 }


Declaration at line 441 of Value.hpp

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

Calls: cmajor::symbols::StructuredValue::Write

Called by: cmajor::symbols::StructuredValue::Write


operator= Member Function

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

Definition at line 438 of Value.hpp


top | up | prev | next