G4OCCT 0.1.0
Geant4 interface to Open CASCADE Technology (OCCT) geometry definitions
Loading...
Searching...
No Matches
G4OCCTAssemblyRegistry.hh
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later
2// Copyright (C) 2026 G4OCCT Contributors
3
6
7#ifndef G4OCCT_G4OCCTAssemblyRegistry_hh
8#define G4OCCT_G4OCCTAssemblyRegistry_hh
9
10#include <cstddef>
11#include <map>
12#include <string>
13
15
39public:
42
50 void Register(const std::string& name, G4OCCTAssemblyVolume* assembly);
51
58 G4OCCTAssemblyVolume* Get(const std::string& name) const;
59
67 G4OCCTAssemblyVolume* Release(const std::string& name);
68
72 std::size_t Size() const;
73
74private:
75 G4OCCTAssemblyRegistry() = default;
77
78 std::map<std::string, G4OCCTAssemblyVolume*> fAssemblies;
79};
80
81#endif // G4OCCT_G4OCCTAssemblyRegistry_hh
Singleton registry for named G4OCCTAssemblyVolume instances.
G4OCCTAssemblyVolume * Get(const std::string &name) const
static G4OCCTAssemblyRegistry & Instance()
Return the singleton instance.
G4OCCTAssemblyVolume * Release(const std::string &name)
void Register(const std::string &name, G4OCCTAssemblyVolume *assembly)
Extends Geant4's G4AssemblyVolume with an OCCT XDE label reference.