Molybden API
Loading...
Searching...
No Matches
field_container.hpp
1// Copyright (c) 2000-2023 TeamDev Ltd. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_FIELD_CONTAINER_HPP
6#define MOLYBDEN_FIELD_CONTAINER_HPP
7
8#include <map>
9
10#include "molybden/js/internal/js_accessible_field.hpp"
11
12namespace molybden {
13namespace internal {
14
19class FieldContainer {
20 protected:
30 template <class C, class T>
31 int addField(Field<C, T> field, const char* name);
32
37 JsValue getFieldValue(const std::string& property_name);
38
42 bool hasField(const std::string& property_name);
43
52 bool setFieldValue(const std::string& property_name, const JsValue& value);
53
57 std::vector<std::string> propertyNames();
58
59 virtual ~FieldContainer() = default;
60
61 private:
62 std::map<std::string, std::unique_ptr<JsAccessibleField>> fields_;
63};
64
65} // namespace internal
66} // namespace molybden
67
68#endif // MOLYBDEN_FIELD_CONTAINER_HPP