ROSE 0.11.145.147
Public Types | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Rosebud::Ast::Property Class Reference

Description

Represents a class property definition.

A property is somewhat like a class data member, except it has accessors and mutators. This node represents a property definition.

Definition at line 316 of file Ast.h.

#include <Rosebud/Ast.h>

Inheritance diagram for Rosebud::Ast::Property:
Inheritance graph
[legend]
Collaboration diagram for Rosebud::Ast::Property:
Collaboration graph
[legend]

Public Types

using Ptr = PropertyPtr
 Shared-ownership pointer.
 
- Public Types inherited from Rosebud::Ast::Definition
using Ptr = DefinitionPtr
 Shared-ownership pointer.
 
- Public Types inherited from Rosebud::Ast::Node
using Ptr = NodePtr
 
- Public Types inherited from Sawyer::Tree::Vertex< Node >
using UserBase = Node
 User's base class.
 
using UserBasePtr = std::shared_ptr< UserBase >
 Pointer to user's base class.
 
using TraversalEvent = Sawyer::Tree::TraversalEvent
 Alias for traversal events.
 

Static Public Member Functions

static Ptr instance ()
 Allocating constructor.
 

Public Attributes

Edge< TokenListcType
 Optional pointer to tokens that define the property type.
 
Edge< TokenListcInit
 Optional pointer to tokens that define the property's initial value.
 
Sawyer::Optional< std::string > dataMemberName
 Optional data member name override.
 
Sawyer::Optional< std::vector< std::string > > accessorNames
 Optional override for accessor names.
 
Sawyer::Optional< std::vector< std::string > > mutatorNames
 Optional override for mutator names.
 
Sawyer::Optional< std::string > serializerBaseName
 Optional override for the serializer name.
 
- Public Attributes inherited from Rosebud::Ast::Definition
Token startToken
 Token at the start of the definition.
 
std::string name
 Unqualified name for the definition.
 
Token nameToken
 Token for the definition's unqualified name.
 
std::string doc
 Doxygen documentation comment.
 
Token docToken
 Token associated with the Doxygen comment.
 
Edge< CppStackcppStack
 C preprocessor pending conditional compilation directives.
 
std::string priorText
 Input text before the definition.
 
Token priorTextToken
 Token describing the location of the prior text.
 
EdgeVector< Attributeattributes
 Non-null pointer to the list of attributes controlling this property.
 
- Public Attributes inherited from Sawyer::Tree::Vertex< Node >
ReverseEdge parent
 Pointer to the parent in the tree.
 

Protected Member Functions

 Property ()
 Default constructor used only by derived classes.
 
- Protected Member Functions inherited from Rosebud::Ast::Definition
 Definition ()
 Default constructor used only by derived classes.
 
- Protected Member Functions inherited from Sawyer::Tree::Vertex< Node >
virtual void destructorHelper ()
 

Additional Inherited Members

- Public Member Functions inherited from Rosebud::Ast::Definition
AttributePtr findAttribute (const std::string &fqName)
 Finds an attribute with the specified fully qualified name.
 
- Public Member Functions inherited from Rosebud::Ast::Node
template<class T >
std::shared_ptr< T > findAncestor ()
 
- Public Member Functions inherited from Sawyer::Tree::Vertex< Node >
UserBasePtr pointer ()
 Returns a shared pointer to this vertex.
 
std::shared_ptr< T > isa ()
 Tests whether this object is a certain type.
 
auto traverseReverse (const Visitor &visitor)
 Traverse in reverse direction from children to parents.
 
auto traverse (const Visitor &visitor)
 Traverse in forward direction from parents to children.
 
auto traversePre (const Visitor &visitor)
 Pre-order forward traversal.
 
auto traversePost (const Visitor &visitor)
 Post-order forward traversal.
 
std::shared_ptr< T > findFirstAncestor ()
 Traversal that finds the closest ancestor of type T or derived from T.
 
std::shared_ptr< T > findLastAncestor ()
 Traversal that finds the farthest ancestor of type T or derived from T.
 
std::vector< std::shared_ptr< T > > findDescendants ()
 Traversal that finds all the descendants of a particular type.
 
UserBasePtr child (size_t i) const
 Returns the pointer for a child.
 
size_t nChildren () const
 Returns the number of children.
 

Member Typedef Documentation

◆ Ptr

Shared-ownership pointer.

Definition at line 319 of file Ast.h.

Member Data Documentation

◆ cType

Edge<TokenList> Rosebud::Ast::Property::cType

Optional pointer to tokens that define the property type.

Definition at line 323 of file Ast.h.

◆ cInit

Edge<TokenList> Rosebud::Ast::Property::cInit

Optional pointer to tokens that define the property's initial value.

Definition at line 326 of file Ast.h.

◆ dataMemberName

Sawyer::Optional<std::string> Rosebud::Ast::Property::dataMemberName

Optional data member name override.

This usually comes from the "Rosebud::data" attribute, but can be set directly. If there is no data member name, then the name is chosen by the backend code generator.

Definition at line 332 of file Ast.h.

◆ accessorNames

Sawyer::Optional<std::vector<std::string> > Rosebud::Ast::Property::accessorNames

Optional override for accessor names.

This usually comes from the "Rosebud::accessors" attribute, but can be set directly. An empty vector means that no accessors will be generated. Lack of a vector means that the backend should choose accessor names.

Definition at line 338 of file Ast.h.

◆ mutatorNames

Sawyer::Optional<std::vector<std::string> > Rosebud::Ast::Property::mutatorNames

Optional override for mutator names.

This usually comes from the "Rosebud::mutators" attribute, but can be set directly. An empty vector means that no mutators will be generated. Lack of a vector means that the backend should choose mutator names.

Definition at line 344 of file Ast.h.

◆ serializerBaseName

Sawyer::Optional<std::string> Rosebud::Ast::Property::serializerBaseName

Optional override for the serializer name.

This usually comes from the "Rosebud::serializer" attribute, but can be set directly. An empty name means that the property is not serialized. If no valueis present, then the default serialization function is used.

Definition at line 350 of file Ast.h.


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