27 #ifndef IDLFE_AST_ITEM_H_
28 #define IDLFE_AST_ITEM_H_
37 template <
class T>
class Ptr;
99 Item& operator = (
const Item& src)
101 assert (kind_ == src.kind_);
106 template <
class T>
friend class Ptr;
108 void*
operator new (std::size_t cb)
110 return ::operator
new (cb);
113 void _add_ref () const noexcept
118 void _remove_ref () const noexcept
126 mutable unsigned ref_cnt_;
135 template <
class T1>
friend class Ptr;
141 template <
class T1,
class ... Args>
142 static Ptr make (Args ... args)
144 return Ptr (
new T1 (std::forward <Args> (args)...), Make ());
155 Ptr (
const Ptr& src) noexcept :
169 Ptr (
Ptr&& src) noexcept :
176 Ptr (T1* p) noexcept :
183 Ptr (T* p) noexcept :
243 Ptr& operator = (T1* p) noexcept
253 Ptr& operator = (T* p) noexcept
263 Ptr& operator = (std::nullptr_t) noexcept
272 T* operator -> ()
const noexcept
278 operator T* ()
const noexcept
283 T& operator * ()
const noexcept
292 Ptr (T* p,
const Make&) :
300 template <
class T1,
class T>
301 T1* scast (
const Ptr <T>& ptr) noexcept
303 return static_cast <T1*
> ((T*)ptr);
bool is_forward_decl() const noexcept
@ VALUE_BOX
class ValueBox
@ VALUE_FACTORY
class ValueFactory
@ VALUE_TYPE
class ValueType
@ MODULE_ITEMS
class ModuleItems
@ INTERFACE
class Interface
@ VALUE_TYPE_DECL
class ValueTypeDecl
@ ATTRIBUTE
class Attribute
@ INTERFACE_DECL
class InterfaceDecl
@ UNION_DECL
class UnionDecl
@ ENUM_ITEM
class EnumItem
@ STATE_MEMBER
class StateMember
@ STRUCT_DECL
class StructDecl
@ UNION_ELEMENT
class UnionElement
@ PARAMETER
class Parameter
@ EXCEPTION
class Exception
@ OPERATION
class Operation
bool is_type() const noexcept
Kind kind() const noexcept
Abstract Syntax Tree namespace.