DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
Loading...
Searching...
No Matches
StructureBuilderReference.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>
13#include <StructureBuilder.hh>
14#include <VolumeBuilderTypes.hh>
15
16
17namespace DLG4::VolumeBuilders {
18 template <typename T>
19 class VolumeBuilder;
20 // class StructureBuilder;
21
22
41 class StructureBuilderReference final: public StructureBuilder<StructureBuilderReference> {
42 template <typename T>
43 friend class VolumeBuilder;
44 template <typename T>
45 friend class StructureBuilder;
46
47 template <typename T>
48 friend class i_shared_ptr;
49
50 private:
52
53 template <typename T>
54 StructureBuilderReference(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 StructureBuilderReference::SolidConstructor(const G4String &name) "
62 + this->builder_configs_->name + " \n" +
63 "SolidConstructor(const G4String &name) is not implemented.");
64 }
65
67
68 protected:
69 // Clone impl, this returns a type-erased ISolidPtr
70 // But in reality must bee a BuilderPtr here to be downcast by Clone().
71 SharedPtr<IStructureBuilder> clone_impl() const override;
72
73 StructureView 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.".
SharedPtr< IStructureBuilder > clone_impl() const override
StructureBuilderReference & operator=(const StructureBuilderReference &other)=delete
A type-erased (data shared view) view of a builder or assembly, ie a "structure.".
VolumeBuilder: Common functionality for volume builder classes.
A wrapper for std::shared_ptr that allows and facilitates many implicit(i) type conversions.
SharedPtr< StructureBuilderReference > StructureView
Common interface for all structure types.