| Flutter Impeller |

Namespaces | Macros | Functions
capture.cc File Reference
`#include "impeller/core/capture.h"`
`#include <initializer_list>`
`#include <memory>`

Go to the source code of this file.

## Namespaces
| impeller

## Macros
#define | _CAPTURE_PROPERTY_CAST_DEFINITION(type_name, pascal_name, lower_name)
#define | _CAPTURE_PROPERTY_DEFINITION(type_name, pascal_name, lower_name)

## Functions
| impeller::_FOR_EACH_CAPTURE_PROPERTY (_CAPTURE_PROPERTY_CAST_DEFINITION)
| impeller::_FOR_EACH_CAPTURE_PROPERTY (_CAPTURE_PROPERTY_DEFINITION)

## Macro Definition Documentation

## ◆ _CAPTURE_PROPERTY_CAST_DEFINITION

#define _CAPTURE_PROPERTY_CAST_DEFINITION | ( |  | type_name,
|  |  | pascal_name,
|  |  | lower_name
| ) |  |

Value:
std::optional<type_name> CaptureProperty::As##pascal_name() const { \
if (GetType() != Type::k##pascal_name) { \
return std::nullopt; \
} \
return reinterpret_cast<const Capture##pascal_name##Property*>(this) \
->value; \
}

Definition at line 31 of file capture.cc.

## ◆ _CAPTURE_PROPERTY_DEFINITION

#define _CAPTURE_PROPERTY_DEFINITION | ( |  | type_name,
|  |  | pascal_name,
|  |  | lower_name
| ) |  |

Value:
Capture##pascal_name##Property::Capture##pascal_name##Property( \
const std::string& label, type_name value, Options options) \
: CaptureProperty(label, options), value(std::move(value)) {} \
\
std::shared_ptr<Capture##pascal_name##Property> \
Capture##pascal_name##Property::Make(const std::string& label, \
type_name value, Options options) { \
auto result = std::shared_ptr<Capture##pascal_name##Property>( \
new Capture##pascal_name##Property(label, std::move(value), options)); \
return result; \
} \
\
CaptureProperty::Type Capture##pascal_name##Property::GetType() const { \
return Type::k##pascal_name; \
} \
\
void Capture##pascal_name##Property::Invoke( \
const CaptureProcTable& proc_table) { \
proc_table.lower_name(*this); \
}

Definition at line 42 of file capture.cc.