v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::torque::cpp::Function Class Reference

#include <cpp-builder.h>

Collaboration diagram for v8::internal::torque::cpp::Function:

Classes

struct  Parameter
 

Public Types

enum  FunctionFlag
 

Public Member Functions

 Function (std::string name)
 
 Function (Class *owning_class, std::string name)
 
 ~Function ()=default
 
void SetFlag (FunctionFlag flag, bool value=true)
 
void SetFlags (base::Flags< FunctionFlag > flags, bool value=true)
 
bool HasFlag (FunctionFlag flag) const
 
void SetDescription (std::string description)
 
void SetName (std::string name)
 
void SetReturnType (std::string return_type)
 
void AddParameter (std::string type, std::string name={}, std::string default_value={})
 
void InsertParameter (int index, std::string type, std::string name={}, std::string default_value={})
 
std::vector< ParameterGetParameters () const
 
std::vector< std::string > GetParameterNames () const
 
void PrintDeclaration (std::ostream &stream, int indentation=kAutomaticIndentation) const
 
void PrintDefinition (std::ostream &stream, const std::function< void(std::ostream &)> &builder, int indentation=0) const
 
void PrintInlineDefinition (std::ostream &stream, const std::function< void(std::ostream &)> &builder, int indentation=2) const
 
void PrintBeginDefinition (std::ostream &stream, int indentation=0) const
 
void PrintEndDefinition (std::ostream &stream, int indentation=0) const
 

Static Public Member Functions

static Function DefaultGetter (std::string return_type, Class *owner, std::string name)
 
static Function DefaultSetter (Class *owner, std::string name, std::string parameter_type, std::string parameter_name)
 

Static Public Attributes

static constexpr int kAutomaticIndentation = -1
 

Protected Member Functions

void PrintDeclarationHeader (std::ostream &stream, int indentation) const
 

Private Attributes

SourcePosition pos_
 
Classowning_class_
 
std::string description_
 
std::string name_
 
std::string return_type_
 
std::vector< Parameterparameters_
 
base::Flags< FunctionFlagflags_
 

Detailed Description

Definition at line 53 of file cpp-builder.h.

Member Enumeration Documentation

◆ FunctionFlag

Constructor & Destructor Documentation

◆ Function() [1/2]

v8::internal::torque::cpp::Function::Function ( std::string name)
inlineexplicit

Definition at line 73 of file cpp-builder.h.

◆ Function() [2/2]

v8::internal::torque::cpp::Function::Function ( Class * owning_class,
std::string name )
inline

Definition at line 77 of file cpp-builder.h.

◆ ~Function()

v8::internal::torque::cpp::Function::~Function ( )
default

Member Function Documentation

◆ AddParameter()

void v8::internal::torque::cpp::Function::AddParameter ( std::string type,
std::string name = {},
std::string default_value = {} )
inline

Definition at line 130 of file cpp-builder.h.

Here is the caller graph for this function:

◆ DefaultGetter()

static Function v8::internal::torque::cpp::Function::DefaultGetter ( std::string return_type,
Class * owner,
std::string name )
inlinestatic

Definition at line 83 of file cpp-builder.h.

◆ DefaultSetter()

static Function v8::internal::torque::cpp::Function::DefaultSetter ( Class * owner,
std::string name,
std::string parameter_type,
std::string parameter_name )
inlinestatic

Definition at line 92 of file cpp-builder.h.

◆ GetParameterNames()

std::vector< std::string > v8::internal::torque::cpp::Function::GetParameterNames ( ) const
inline

Definition at line 144 of file cpp-builder.h.

Here is the caller graph for this function:

◆ GetParameters()

std::vector< Parameter > v8::internal::torque::cpp::Function::GetParameters ( ) const
inline

Definition at line 143 of file cpp-builder.h.

◆ HasFlag()

bool v8::internal::torque::cpp::Function::HasFlag ( FunctionFlag flag) const
inline

Definition at line 116 of file cpp-builder.h.

◆ InsertParameter()

void v8::internal::torque::cpp::Function::InsertParameter ( int index,
std::string type,
std::string name = {},
std::string default_value = {} )
inline

Definition at line 135 of file cpp-builder.h.

◆ PrintBeginDefinition()

void v8::internal::torque::cpp::Function::PrintBeginDefinition ( std::ostream & stream,
int indentation = 0 ) const

Definition at line 68 of file cpp-builder.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintDeclaration()

void v8::internal::torque::cpp::Function::PrintDeclaration ( std::ostream & stream,
int indentation = kAutomaticIndentation ) const

Definition at line 39 of file cpp-builder.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintDeclarationHeader()

void v8::internal::torque::cpp::Function::PrintDeclarationHeader ( std::ostream & stream,
int indentation ) const
protected

Definition at line 12 of file cpp-builder.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintDefinition()

void v8::internal::torque::cpp::Function::PrintDefinition ( std::ostream & stream,
const std::function< void(std::ostream &)> & builder,
int indentation = 0 ) const

Definition at line 47 of file cpp-builder.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintEndDefinition()

void v8::internal::torque::cpp::Function::PrintEndDefinition ( std::ostream & stream,
int indentation = 0 ) const

Definition at line 115 of file cpp-builder.cc.

Here is the caller graph for this function:

◆ PrintInlineDefinition()

void v8::internal::torque::cpp::Function::PrintInlineDefinition ( std::ostream & stream,
const std::function< void(std::ostream &)> & builder,
int indentation = 2 ) const

Definition at line 57 of file cpp-builder.cc.

Here is the call graph for this function:

◆ SetDescription()

void v8::internal::torque::cpp::Function::SetDescription ( std::string description)
inline

Definition at line 123 of file cpp-builder.h.

◆ SetFlag()

void v8::internal::torque::cpp::Function::SetFlag ( FunctionFlag flag,
bool value = true )
inline

Definition at line 102 of file cpp-builder.h.

Here is the call graph for this function:

◆ SetFlags()

void v8::internal::torque::cpp::Function::SetFlags ( base::Flags< FunctionFlag > flags,
bool value = true )
inline

Definition at line 109 of file cpp-builder.h.

◆ SetName()

void v8::internal::torque::cpp::Function::SetName ( std::string name)
inline

Definition at line 126 of file cpp-builder.h.

◆ SetReturnType()

void v8::internal::torque::cpp::Function::SetReturnType ( std::string return_type)
inline

Definition at line 127 of file cpp-builder.h.

Here is the caller graph for this function:

Member Data Documentation

◆ description_

std::string v8::internal::torque::cpp::Function::description_
private

Definition at line 170 of file cpp-builder.h.

◆ flags_

base::Flags<FunctionFlag> v8::internal::torque::cpp::Function::flags_
private

Definition at line 174 of file cpp-builder.h.

◆ kAutomaticIndentation

int v8::internal::torque::cpp::Function::kAutomaticIndentation = -1
staticconstexpr

Definition at line 152 of file cpp-builder.h.

◆ name_

std::string v8::internal::torque::cpp::Function::name_
private

Definition at line 171 of file cpp-builder.h.

◆ owning_class_

Class* v8::internal::torque::cpp::Function::owning_class_
private

Definition at line 169 of file cpp-builder.h.

◆ parameters_

std::vector<Parameter> v8::internal::torque::cpp::Function::parameters_
private

Definition at line 173 of file cpp-builder.h.

◆ pos_

SourcePosition v8::internal::torque::cpp::Function::pos_
private

Definition at line 168 of file cpp-builder.h.

◆ return_type_

std::string v8::internal::torque::cpp::Function::return_type_
private

Definition at line 172 of file cpp-builder.h.


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