souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Private Attributes
souffle::ast::ComponentType Class Reference

Component type of a component. More...

#include <ComponentType.h>

Inheritance diagram for souffle::ast::ComponentType:
Inheritance graph
Collaboration diagram for souffle::ast::ComponentType:
Collaboration graph

Public Member Functions

ComponentTypeclone () const override
 Create a clone (i.e. More...
 
 ComponentType (std::string name="", std::vector< QualifiedName > params={}, SrcLocation loc={})
 
const std::string & getName () const
 Return component name. More...
 
const std::vector< QualifiedName > & getTypeParameters () const
 Return component type parameters. More...
 
void setName (std::string n)
 Set component name. More...
 
void setTypeParameters (const std::vector< QualifiedName > &params)
 Set component type parameters. More...
 
- Public Member Functions inherited from souffle::ast::Node
virtual void apply (const NodeMapper &)
 Apply the mapper to all child nodes. More...
 
std::string extloc () const
 Return source location of the syntactic element. More...
 
virtual std::vector< const Node * > getChildNodes () const
 Obtain a list of all embedded AST child nodes. More...
 
const SrcLocationgetSrcLoc () const
 Return source location of the Node. More...
 
 Node (SrcLocation loc={})
 
bool operator!= (const Node &other) const
 Inequality check for two AST nodes. More...
 
bool operator== (const Node &other) const
 Equivalence check for two AST nodes. More...
 
void setSrcLoc (SrcLocation l)
 Set source location for the Node. More...
 
virtual ~Node ()=default
 

Protected Member Functions

bool equal (const Node &node) const override
 Abstract equality check for two AST nodes. More...
 
void print (std::ostream &os) const override
 Output to a given output stream. More...
 

Private Attributes

std::string name
 Component name. More...
 
std::vector< QualifiedNametypeParams
 Component type parameters. More...
 

Detailed Description

Component type of a component.

Example: name < Type1, Type2, ... > where name is the component name and < Type, Type, ... > is a list of component type parameters (either actual or formal).

Definition at line 45 of file ComponentType.h.

Constructor & Destructor Documentation

◆ ComponentType()

souffle::ast::ComponentType::ComponentType ( std::string  name = "",
std::vector< QualifiedName params = {},
SrcLocation  loc = {} 
)
inline

Definition at line 47 of file ComponentType.h.

Member Function Documentation

◆ clone()

ComponentType* souffle::ast::ComponentType::clone ( ) const
inlineoverridevirtual

Create a clone (i.e.

deep copy) of this node

Implements souffle::ast::Node.

Definition at line 70 of file ComponentType.h.

71  {
72  os << "<" << join(typeParams) << ">";

References souffle::join(), and typeParams.

Here is the call graph for this function:

◆ equal()

bool souffle::ast::ComponentType::equal ( const Node ) const
inlineoverrideprotectedvirtual

Abstract equality check for two AST nodes.

Reimplemented from souffle::ast::Node.

Definition at line 82 of file ComponentType.h.

◆ getName()

const std::string& souffle::ast::ComponentType::getName ( ) const
inline

Return component name.

Definition at line 51 of file ComponentType.h.

◆ getTypeParameters()

const std::vector<QualifiedName>& souffle::ast::ComponentType::getTypeParameters ( ) const
inline

Return component type parameters.

Definition at line 61 of file ComponentType.h.

64  {

◆ print()

void souffle::ast::ComponentType::print ( std::ostream &  os) const
inlineoverrideprotectedvirtual

Output to a given output stream.

Implements souffle::ast::Node.

Definition at line 75 of file ComponentType.h.

76  {
77  const auto& other = static_cast<const ComponentType&>(node);
78  return name == other.name && typeParams == other.typeParams;
79  }
80 

References name, and typeParams.

◆ setName()

void souffle::ast::ComponentType::setName ( std::string  n)
inline

Set component name.

Definition at line 56 of file ComponentType.h.

◆ setTypeParameters()

void souffle::ast::ComponentType::setTypeParameters ( const std::vector< QualifiedName > &  params)
inline

Set component type parameters.

Definition at line 66 of file ComponentType.h.

68  :
69  void print(std::ostream& os) const override {

Field Documentation

◆ name

std::string souffle::ast::ComponentType::name
private

Component name.

Definition at line 89 of file ComponentType.h.

Referenced by print().

◆ typeParams

std::vector<QualifiedName> souffle::ast::ComponentType::typeParams
private

Component type parameters.

Definition at line 92 of file ComponentType.h.

Referenced by clone(), and print().


The documentation for this class was generated from the following file:
souffle::ast::ComponentType::typeParams
std::vector< QualifiedName > typeParams
Component type parameters.
Definition: ComponentType.h:92
souffle::ast::ComponentType::name
std::string name
Component name.
Definition: ComponentType.h:89
souffle::ast::ComponentType::print
void print(std::ostream &os) const override
Output to a given output stream.
Definition: ComponentType.h:75
souffle::ast::ComponentType::ComponentType
ComponentType(std::string name="", std::vector< QualifiedName > params={}, SrcLocation loc={})
Definition: ComponentType.h:47
souffle::join
detail::joined_sequence< Iter, Printer > join(const Iter &a, const Iter &b, const std::string &sep, const Printer &p)
Creates an object to be forwarded to some output stream for printing sequences of elements interspers...
Definition: StreamUtil.h:175