DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
Loading...
Searching...
No Matches
StructureBuilderCore.hh
Go to the documentation of this file.
1#pragma once
2#ifndef STRUCTUREBUILDER_HPP
3#define STRUCTUREBUILDER_HPP
4//
5// Created by Douglas S. Leonard on 6/8/25. All rights Reserved
6// See related files for license, if any is provided.
7//
8// Assemblies for treating a collection of builders as a single unit.
9//#include "StructureBuilder.hh"
10#include "Linkable.hh"
11#include "i_shared_ptr.hh"
12#include <stdexcept>
15
16
18 template <typename T>
19 class VolumeBuilderBase;
20 // class StructureBuilder;
21
22
41 class StructureBuilderCore final: public StructureBuilderBase<StructureBuilderCore> {
42 template <typename T>
43 friend class VolumeBuilderBase;
44 template <typename T>
46
47 template <typename T>
48 friend class i_shared_ptr;
49
50 private:
52
53 template <typename T>
54 StructureBuilderCore(i_shared_ptr<T> other, // NOLINT(*-explicit-constructor)
55 std::enable_if_t<std::is_base_of_v<IStructureBuilder, T>,
57 }
58
59 G4VSolid *SolidConstructor(const G4String &name) override {
60 throw std::runtime_error(
61 "Error in StructureBuilderCore::SolidConstructor(const G4String &name) "
62 + this->builder_configs_->name + " \n" +
63 "SolidConstructor(const G4String &name) is not implemented.");
64 }
65
66 StructureBuilderCore(const StructureBuilderCore &other) = default;
67
68 protected:
69 // Clone impl, this returns a type-erased ISolidPtr
70 // But in reality must bee a Builder here to be downcast by Clone().
71 SharedPtr<IStructureBuilder> clone_impl() const override;
72
73 StructureBuilder ToStructureView() const override;
74
75 public:
77 };
78}
79
80
81#endif
#define SET_LINK
Definition Linkable.hh:63
A type-erased (data shared view) view of a builder or assembly, ie a "structure.".
friend class StructureBuilderCore
A type-erased (data shared view) view of a builder or assembly, ie a "structure.".
A type-erased (data shared view) view of a builder or assembly, ie a "structure.".
SharedPtr< IStructureBuilder > clone_impl() const override
StructureBuilderCore & operator=(const StructureBuilderCore &other)=delete
VolumeBuilder: Common functionality for volume builder classes.
SharedPtr< StructureBuilderCore > StructureBuilder