cymoca
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Protected Attributes | List of all members
cymoca::ast::model::ElementDict Class Reference

#include <model.h>

Inheritance diagram for cymoca::ast::model::ElementDict:
Inheritance graph
Collaboration diagram for cymoca::ast::model::ElementDict:
Collaboration graph

Public Member Functions

void enter (listener::Base &listener) override
 
void exit (listener::Base &listener) override
 
template<class... Args>
 ElementDict (Args...args)
 
void set (const std::string &name, std::unique_ptr< element::Base > element)
 
element::Base & get (const std::string &name)
 
std::unordered_map
< std::string, std::unique_ptr
< element::Base > > & 
getMap ()
 
std::vector< INode * > getChildren () override
 
std::unique_ptr< INode > clone () const override
 
- Public Member Functions inherited from cymoca::ast::INode
virtual ~INode ()
 
template<class T >
std::unique_ptr< T > cloneAs ()
 

Protected Attributes

std::unordered_map
< std::string, std::unique_ptr
< element::Base > > 
m_map {}
 

Detailed Description

A dictionary of elements with names as keys and allocated element instances as values.

Definition at line 15 of file model.h.

Constructor & Destructor Documentation

template<class... Args>
cymoca::ast::model::ElementDict::ElementDict ( Args...  args)
inlineexplicit

Definition at line 22 of file model.h.

Member Function Documentation

std::unique_ptr<INode> cymoca::ast::model::ElementDict::clone ( ) const
inlineoverridevirtual

Perform a deep copy of this node.

Implements cymoca::ast::INode.

Definition at line 45 of file model.h.

void cymoca::ast::model::ElementDict::enter ( listener::Base &  listener)
inlineoverridevirtual

A double dispatch entrace hook for listeners.

Implements cymoca::ast::INode.

Definition at line 20 of file model.h.

void cymoca::ast::model::ElementDict::exit ( listener::Base &  listener)
inlineoverridevirtual

A double dispatch exit hook for listeners.

Implements cymoca::ast::INode.

Definition at line 20 of file model.h.

element::Base& cymoca::ast::model::ElementDict::get ( const std::string &  name)
inline

Definition at line 32 of file model.h.

std::vector<INode *> cymoca::ast::model::ElementDict::getChildren ( )
inlineoverridevirtual

Returns a list of children (non-owning).

Implements cymoca::ast::INode.

Definition at line 38 of file model.h.

std::unordered_map<std::string, std::unique_ptr<element::Base> >& cymoca::ast::model::ElementDict::getMap ( )
inline

Definition at line 34 of file model.h.

void cymoca::ast::model::ElementDict::set ( const std::string &  name,
std::unique_ptr< element::Base >  element 
)
inline

Definition at line 28 of file model.h.

Member Data Documentation

std::unordered_map<std::string, std::unique_ptr<element::Base> > cymoca::ast::model::ElementDict::m_map {}
protected

Definition at line 17 of file model.h.


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