DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
Loading...
Searching...
No Matches
include
AssemblyCore.hh
Go to the documentation of this file.
1
#pragma once
2
#ifndef DLG4_ASSEMBLY_HPP
3
#define DLG4_ASSEMBLY_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 <VolumeBuilder.hh>
14
#include <
VolumeBuildersTypes.hh
>
15
#include <
StructureBuilderBase.hh
>
16
#include <
BuilderFactories.hh
>
17
18
// Factory CreateAssembly moved to BuilderFactories.hh
19
20
namespace
DLG4::VolumeBuilders::_internals_
{
38
class
AssemblyCore
final:
public
StructureBuilderBase
<AssemblyCore> {
39
template
<
typename
T>
40
friend
class
VolumeBuilderBase
;
41
template
<
typename
T>
42
friend
class
StructureBuilderBase
;
43
friend
Assembly
VB::CreateAssembly
(G4String name);
44
45
friend
class
i_shared_ptr
<
AssemblyCore
>;
46
47
public
:
48
Assembly
AddStructure
(
const
StructureBuilder
&other);
49
50
private
:
51
//ctor used by factory. Will construct an assembly from a builder actually.
52
template
<
typename
T>
53
AssemblyCore
(
i_shared_ptr<T>
other,
// NOLINT(*-explicit-constructor)
54
std::enable_if_t<std::is_base_of_v<IStructureBuilder, T>,
55
int
> = 0) :
StructureBuilderBase
<
AssemblyCore
>(other,
SET_LINK
) {
56
}
57
58
[[noreturn]]
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
template
<
typename
T>
67
friend
class
i_shared_ptr
;
68
69
70
AssemblyCore
(
const
AssemblyCore
&other);
71
AssemblyCore
() =
default
;
72
73
protected
:
74
// Clone impl, this returns a type-erased ISolidPtr
75
// But in reality must bee a Builder here to be downcast by Clone().
76
77
public
:
78
AssemblyCore
&
operator=
(
const
AssemblyCore
&other) =
delete
;
79
};
80
}
81
82
83
#endif
BuilderFactories.hh
Linkable.hh
SET_LINK
#define SET_LINK
Definition
Linkable.hh:63
StructureBuilderBase.hh
VolumeBuildersTypes.hh
DLG4::VolumeBuilders::_internals_::AssemblyCore
A type-erased (data shared view) view of a builder or assembly, ie a "structure.".
Definition
AssemblyCore.hh:38
DLG4::VolumeBuilders::_internals_::AssemblyCore::operator=
AssemblyCore & operator=(const AssemblyCore &other)=delete
DLG4::VolumeBuilders::_internals_::AssemblyCore::AddStructure
Assembly AddStructure(const StructureBuilder &other)
Definition
AssemblyCore.cc:45
DLG4::VolumeBuilders::_internals_::StructureBuilderBase
A type-erased (data shared view) view of a builder or assembly, ie a "structure.".
Definition
StructureBuilderBase.hh:61
DLG4::VolumeBuilders::_internals_::VolumeBuilderBase
VolumeBuilder: Common functionality for volume builder classes.
Definition
VolumeBuilderBase.hh:61
DLG4::VolumeBuilders::_internals_::i_shared_ptr
Definition
i_shared_ptr.hh:36
DLG4::VolumeBuilders::CreateAssembly
Assembly CreateAssembly(G4String name)
Assembly of strucures, ie builders and/or other assemblies.
Definition
AssemblyCore.cc:18
i_shared_ptr.hh
DLG4::VolumeBuilders::_internals_
Definition
AssemblyCore.cc:37
Generated by
1.9.8