Molybden API
Loading...
Searching...
No Matches
method_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_METHOD_CONTAINER_HPP
6#define MOLYBDEN_METHOD_CONTAINER_HPP
7
8#include <map>
9
10#include "molybden/js/internal/js_accessible_method.hpp"
11
12namespace molybden {
13namespace internal {
14
21class MethodContainer {
22 protected:
33 template <class C, class R, class... T>
34 int addMethod(MethodSignature<C, R, T...> signature, const char* name);
35
39 bool hasMethod(const std::string& method_name);
40
48 JsReturnValue callMethod(const std::string& method_name,
49 const std::vector<JsValue>& args);
50
54 std::vector<std::string> methodNames();
55 virtual ~MethodContainer() = default;
56
57 private:
58 std::map<std::string, std::unique_ptr<JsAccessibleMethod>> methods_;
59};
60
61} // namespace internal
62} // namespace molybden
63
64#endif // MOLYBDEN_METHOD_CONTAINER_HPP