Smithy Qt 0.1.0-pre
Smithy code generator for Qt
Loading...
Searching...
No Matches
Model Class Reference

The Model class provides a Qt representation of a Smithy semantic model. More...

Public Types

enum class  Error {
  NoError = 0 , NoData = 1 , InvalidMetadata = 2 , InvalidShapes = 3 ,
  InvalidShapeId = 4 , InvalidShape = 5 , ConflictingMetadata = 6
}
 

Public Member Functions

 Model ()
 Constructs a new, empty Smithy model.
 
 Model (Model &&other)
 
 Model (const Model &other)
 
Modeloperator= (const Model &model)
 
Modeloperator= (const Model &&model)
 
 ~Model ()
 Destroys this Model object.
 
void clear ()
 
bool insert (const QJsonObject &ast)
 Add the logical content of the JSON AST model file given by ast into this semantic model.
 
bool finish ()
 
Error error () const
 
bool isValid () const
 
QJsonObject metadata () const
 
Shape shape (const ShapeId &shapeId) const
 
QHash< ShapeId, Shapeshapes (const Shape::Type &type=Shape::Type::Undefined) const
 

Detailed Description

The Model class provides a Qt representation of a Smithy semantic model.

See also
https://awslabs.github.io/smithy/2.0/spec/model.html#semantic-model

Constructor & Destructor Documentation

◆ Model()

Model::Model ( )

Constructs a new, empty Smithy model.

Todo
Load the Smithy prelude here?
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ finish()

bool Model::finish ( )
Todo
resolve shape conflicts.
Todo
Todo
resolve trait conflicts; include 'apply' statements.
Here is the call graph for this function:

◆ insert()

bool Model::insert ( const QJsonObject & ast)

Add the logical content of the JSON AST model file given by ast into this semantic model.

A Smithy semantic model is split into one or more model files. Use this method to add all model files that comprise this semantic model.

See also
https://awslabs.github.io/smithy/2.0/spec/model.html
Here is the call graph for this function:

◆ shape()

Shape Model::shape ( const ShapeId & shapeId) const
Todo
this should be d->mergedShapes, but using allShapes while finish() is incomplete.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shapes()

QHash< ShapeId, Shape > Model::shapes ( const Shape::Type & type = Shape::Type::Undefined) const
Todo
this should be d->mergedShapes, but using allShapes while finish() is incomplete.
Here is the call graph for this function:
Here is the caller graph for this function:

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