Molybden API
Loading...
Searching...
No Matches
js_accessible_field_impl.hpp
1// Copyright (c) 2000-2024 TeamDev. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_JS_ACCESSIBLE_FIELD_IMPL_HPP
6#define MOLYBDEN_JS_ACCESSIBLE_FIELD_IMPL_HPP
7
8#include "molybden/js/internal/js_convertible_types.hpp"
9#include "molybden/js/internal/js_value_converter.hpp"
10
11namespace molybden {
12namespace internal {
13
14template <class C, class T>
15using Field = T(C::*);
16
17template <class C, class T>
18class JsAccessibleFieldImpl : public JsAccessibleField {
19 public:
20 JsAccessibleFieldImpl(C* object, Field<C, T> field);
21
22 // JsAccessibleField
23 JsValue value() override;
24 bool setValue(const JsValue& value) override;
25
26 private:
27 C* object_;
28 Field<C, T> field_;
29};
30
31} // namespace internal
32} // namespace molybden
33
34#endif // MOLYBDEN_JS_ACCESSIBLE_FIELD_IMPL_HPP