Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
module_config.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 Stanford University, NVIDIA Corporation
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18// model configure for Realm
19
20#ifndef REALM_MODULECONFIG_H
21#define REALM_MODULECONFIG_H
22
23#include "realm/realm_config.h"
24#include "realm/realm_c.h"
25
26#include <string>
27#include <unordered_map>
28#include <vector>
29
30namespace Realm {
31
33 protected:
34 ModuleConfig(const std::string &name);
35
36 public:
37 virtual ~ModuleConfig(void);
38 template <typename T>
39 RealmStatus set_property(const std::string &name, T value);
40 template <typename T>
41 RealmStatus get_property(const std::string &name, T &value) const;
42 void finish_configure(void);
43 const std::string &get_name(void) const;
44 template <typename T>
45 RealmStatus get_resource(const std::string &name, T &value) const;
46 virtual void configure_from_cmdline(std::vector<std::string> &cmdline);
47
48 protected:
49 // these maps store a map between configuration name and address of configurations,
50 // so that we can access these configurations using the name
51 std::unordered_map<std::string, void *const> config_map;
52
53 // these maps store a map between resource name and address of resource,
54 // so that we can access these resources using the name
55 std::unordered_map<std::string, void *const> resource_map;
56
57 std::string module_name;
58
59 bool resource_discover_finished = false;
60
61 bool finish_configured = false;
62 };
63
64}; // namespace Realm
65
66#endif // ifndef REALM_MODULECONFIG_H
67
68#include "realm/module_config.inl"
Definition module_config.h:32
virtual void configure_from_cmdline(std::vector< std::string > &cmdline)
virtual ~ModuleConfig(void)
const std::string & get_name(void) const
std::unordered_map< std::string, void *const > resource_map
Definition module_config.h:55
ModuleConfig(const std::string &name)
RealmStatus set_property(const std::string &name, T value)
std::string module_name
Definition module_config.h:57
RealmStatus get_property(const std::string &name, T &value) const
std::unordered_map< std::string, void *const > config_map
Definition module_config.h:51
void finish_configure(void)
RealmStatus get_resource(const std::string &name, T &value) const
#define REALM_PUBLIC_API
Definition compiler_support.h:217
Definition activemsg.h:38
realm_status_t RealmStatus
Definition realm_c.h:355