retdec
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
retdec::ctypes::Parameter Class Reference

A representation of a function parameter. More...

#include <parameter.h>

Collaboration diagram for retdec::ctypes::Parameter:
Collaboration graph
[legend]

Public Types

using Annotations = std::set< std::shared_ptr< Annotation > >
 
using annotation_iterator = Annotations::iterator
 
using const_annotation_iterator = Annotations::const_iterator
 

Public Member Functions

 Parameter (const std::string &name, const std::shared_ptr< Type > &type, const Annotations &annotations={})
 Constructs a new parameter. More...
 
const std::string & getName () const
 Returns parameter's name. More...
 
std::shared_ptr< TypegetType () const
 Returns parameter's type. More...
 
bool operator== (const Parameter &other) const
 
bool operator!= (const Parameter &other) const
 
Parameter annotations.
annotation_iterator annotation_begin ()
 Returns an iterator to the annotation. More...
 
const_annotation_iterator annotation_begin () const
 Returns a constant iterator to the annotation. More...
 
annotation_iterator annotation_end ()
 Returns an iterator past the last annotation. More...
 
const_annotation_iterator annotation_end () const
 Returns a constant iterator past the last annotation. More...
 
bool isIn () const
 Returns true when parameter is input, false otherwise. More...
 
bool isOut () const
 Returns true when parameter is output, false otherwise. More...
 
bool isInOut () const
 Returns true when parameter will be changed by the function, false otherwise. More...
 
bool isOptional () const
 Returns true when parameter may be null, false otherwise. More...
 

Private Types

using AnnotationTypeHandler = bool(Annotation::*)() const
 Pointer to Annotation's member functions. More...
 

Private Member Functions

bool hasAnnotationOfType (const AnnotationTypeHandler &annotationType) const
 

Private Attributes

std::string name
 
std::shared_ptr< Typetype
 
Annotations annotations
 

Detailed Description

A representation of a function parameter.

Member Typedef Documentation

◆ annotation_iterator

using retdec::ctypes::Parameter::annotation_iterator = Annotations::iterator

◆ Annotations

using retdec::ctypes::Parameter::Annotations = std::set<std::shared_ptr<Annotation> >

◆ AnnotationTypeHandler

using retdec::ctypes::Parameter::AnnotationTypeHandler = bool (Annotation::*)() const
private

Pointer to Annotation's member functions.

◆ const_annotation_iterator

using retdec::ctypes::Parameter::const_annotation_iterator = Annotations::const_iterator

Constructor & Destructor Documentation

◆ Parameter()

retdec::ctypes::Parameter::Parameter ( const std::string &  name,
const std::shared_ptr< Type > &  type,
const Annotations annotations = {} 
)

Constructs a new parameter.

Member Function Documentation

◆ annotation_begin() [1/2]

Parameter::annotation_iterator retdec::ctypes::Parameter::annotation_begin ( )

Returns an iterator to the annotation.

◆ annotation_begin() [2/2]

Parameter::const_annotation_iterator retdec::ctypes::Parameter::annotation_begin ( ) const

Returns a constant iterator to the annotation.

◆ annotation_end() [1/2]

Parameter::annotation_iterator retdec::ctypes::Parameter::annotation_end ( )

Returns an iterator past the last annotation.

◆ annotation_end() [2/2]

Parameter::const_annotation_iterator retdec::ctypes::Parameter::annotation_end ( ) const

Returns a constant iterator past the last annotation.

◆ getName()

const std::string & retdec::ctypes::Parameter::getName ( ) const

Returns parameter's name.

◆ getType()

std::shared_ptr< Type > retdec::ctypes::Parameter::getType ( ) const

Returns parameter's type.

◆ hasAnnotationOfType()

bool retdec::ctypes::Parameter::hasAnnotationOfType ( const AnnotationTypeHandler annotationType) const
private

◆ isIn()

bool retdec::ctypes::Parameter::isIn ( ) const

Returns true when parameter is input, false otherwise.

◆ isInOut()

bool retdec::ctypes::Parameter::isInOut ( ) const

Returns true when parameter will be changed by the function, false otherwise.

◆ isOptional()

bool retdec::ctypes::Parameter::isOptional ( ) const

Returns true when parameter may be null, false otherwise.

◆ isOut()

bool retdec::ctypes::Parameter::isOut ( ) const

Returns true when parameter is output, false otherwise.

◆ operator!=()

bool retdec::ctypes::Parameter::operator!= ( const Parameter other) const

◆ operator==()

bool retdec::ctypes::Parameter::operator== ( const Parameter other) const

Member Data Documentation

◆ annotations

Annotations retdec::ctypes::Parameter::annotations
private

◆ name

std::string retdec::ctypes::Parameter::name
private

◆ type

std::shared_ptr<Type> retdec::ctypes::Parameter::type
private

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