top | up | prev | next

TemplateParameterNode Class

Definition at line 33 of Template.hpp

Constructors

TemplateParameterNode(const Span& span_, const boost::uuids::uuid& moduleId_)
TemplateParameterNode(const Span& span_, const boost::uuids::uuid& moduleId_, IdentifierNode* id_, Node* defaultTemplateArgument_)

Member Functions

void Accept(Visitor& visitor) override
Node* Clone(CloneContext& cloneContext) const override
const Node* DefaultTemplateArgument() const
Node* DefaultTemplateArgument()
const IdentifierNode* Id() const
IdentifierNode* Id()
void Read(AstReader& reader) override
void Write(AstWriter& writer) override

Member Variables

std::unique_ptr<Node> defaultTemplateArgument
std::unique_ptr<IdentifierNode> id

Constructor Details

TemplateParameterNode Constructor

sngcm::ast::TemplateParameterNode::TemplateParameterNode(const Span& span_, const boost::uuids::uuid& moduleId_)

Definition at line 78 of Template.cpp :
 78 : Node(NodeType::templateParameterNodespan_moduleId_)id()
 79 {
 80 }


Declaration at line 36 of Template.hpp


TemplateParameterNode Constructor

sngcm::ast::TemplateParameterNode::TemplateParameterNode(const Span& span_, const boost::uuids::uuid& moduleId_, IdentifierNode * id_, Node * defaultTemplateArgument_)

Definition at line 82 of Template.cpp :
 82 :
 83 Node(NodeType::templateParameterNodespan_moduleId_)id(id_)defaultTemplateArgument(defaultTemplateArgument_)
 84 {
 85     id->SetParent(this);
 86     if (defaultTemplateArgument)
 87     {
 88         defaultTemplateArgument->SetParent(this);
 89     }
 90 }


Declaration at line 37 of Template.hpp


Member Function Details

Accept Member Function

void sngcm::ast::TemplateParameterNode::Accept(Visitor & visitor) override

Definition at line 103 of Template.cpp :
104 {
105     visitor.Visit(*this);
106 }


Declaration at line 39 of Template.hpp

Base class overridden functions: sngcm::ast::Node::Accept

Calls: sngcm::ast::Visitor::Visit


Clone Member Function

Node * sngcm::ast::TemplateParameterNode::Clone(CloneContext & cloneContext) const override

Definition at line 92 of Template.cpp :
 93 {
 94     Node* clonedDefaultTemplateArgument = nullptr;
 95     if (defaultTemplateArgument)
 96     {
 97         clonedDefaultTemplateArgument = defaultTemplateArgument->Clone(cloneContext);
 98     }
 99     TemplateParameterNode* clone = new TemplateParameterNode(GetSpan()ModuleId()static_cast<IdentifierNode*>(id->Clone(cloneContext))clonedDefaultTemplateArgument);
100     return clone;
101 }


Declaration at line 38 of Template.hpp

Base class overridden functions: sngcm::ast::Node::Clone

Calls: sngcm::ast::Node::GetSpan , sngcm::ast::Node::ModuleId , sngcm::ast::TemplateParameterNode::Clone

Called by: sngcm::ast::TemplateParameterNode::Clone


DefaultTemplateArgument Member Function

const Node * sngcm::ast::TemplateParameterNode::DefaultTemplateArgument() const

Definition at line 44 of Template.hpp :
44 { return defaultTemplateArgument.get(); }


DefaultTemplateArgument Member Function

Node * sngcm::ast::TemplateParameterNode::DefaultTemplateArgument()

Definition at line 45 of Template.hpp :
45 { return defaultTemplateArgument.get(); }

Called by: sngcm::ast::SourceWriter::Visit


Id Member Function

const IdentifierNode * sngcm::ast::TemplateParameterNode::Id() const

Definition at line 42 of Template.hpp :
42 { return id.get(); }


Id Member Function

IdentifierNode * sngcm::ast::TemplateParameterNode::Id()

Definition at line 43 of Template.hpp :
43 { return id.get(); }

Called by: sngcm::ast::SourceWriter::Visit


Read Member Function

void sngcm::ast::TemplateParameterNode::Read(AstReader & reader) override

Definition at line 120 of Template.cpp
Declaration at line 41 of Template.hpp

Base class overridden functions: sngcm::ast::Node::Read

Calls: sngcm::ast::AstReader::GetBinaryReader , sngcm::ast::AstReader::ReadIdentifierNode , sngcm::ast::AstReader::ReadNode , sngcm::ast::Node::Read , sngcm::ast::Node::SetParent , soulng::util::BinaryReader::ReadBool


Write Member Function

void sngcm::ast::TemplateParameterNode::Write(AstWriter & writer) override

Definition at line 108 of Template.cpp :
109 {
110     Node::Write(writer);
111     writer.Write(id.get());
112     bool hasDefaultTemplateArgument = defaultTemplateArgument != nullptr;
113     writer.GetBinaryWriter().Write(hasDefaultTemplateArgument);
114     if (hasDefaultTemplateArgument)
115     {
116         writer.Write(defaultTemplateArgument.get());
117     }
118 }


Declaration at line 40 of Template.hpp

Base class overridden functions: sngcm::ast::Node::Write

Calls: sngcm::ast::AstWriter::GetBinaryWriter , sngcm::ast::Node::Write , soulng::util::BinaryWriter::Write


top | up | prev | next