Pegmatite
Public Member Functions | List of all members
pegmatite::ASTPtr< T, Optional > Class Template Reference

An ASTPtr is a wrapper around a pointer to an AST object. More...

#include <ast.hh>

Inheritance diagram for pegmatite::ASTPtr< T, Optional >:
pegmatite::ASTMember

Public Member Functions

 ASTPtr ()
 Constructs the object in the.
 
T * get () const
 gets the underlying ptr value. More...
 
const std::unique_ptr< T > & operator* () const
 auto conversion to the underlying object ptr. More...
 
const std::unique_ptr< T > & operator-> () const
 member access. More...
 
 operator bool () const noexcept
 
virtual void construct (const InputRange &r, ASTStack &st)
 Pops the next matching object from the AST stack st and claims it.
 
- Public Member Functions inherited from pegmatite::ASTMember
 ASTMember ()
 On construction, ASTMember sets its container_node field to the ASTContainer currently under construction and registers itself with the container, to be notified during the construction phase.
 
ASTContainercontainer () const
 Returns the container of which this object is a field.
 

Additional Inherited Members

- Protected Attributes inherited from pegmatite::ASTMember
ASTContainercontainer_node
 The container that owns this object.
 

Detailed Description

template<class T, bool Optional = false>
class pegmatite::ASTPtr< T, Optional >

An ASTPtr is a wrapper around a pointer to an AST object.

It is intended to be a member of an ASTContainer and will automatically pop the top item from the stack and claim it when building the AST..

Member Function Documentation

template<class T , bool Optional = false>
T* pegmatite::ASTPtr< T, Optional >::get ( ) const
inline

gets the underlying ptr value.

Returns
the underlying ptr value.
template<class T , bool Optional = false>
const std::unique_ptr<T>& pegmatite::ASTPtr< T, Optional >::operator* ( ) const
inline

auto conversion to the underlying object ptr.

Returns
the underlying ptr value.
template<class T , bool Optional = false>
const std::unique_ptr<T>& pegmatite::ASTPtr< T, Optional >::operator-> ( ) const
inline

member access.

Returns
the underlying ptr value.

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