EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Coding Examples
File List
File Members
egs++
egs_ausgab_object.cpp
Go to the documentation of this file.
1
/*
2
###############################################################################
3
#
4
# EGSnrc egs++ ausgab object
5
# Copyright (C) 2015 National Research Council Canada
6
#
7
# This file is part of EGSnrc.
8
#
9
# EGSnrc is free software: you can redistribute it and/or modify it under
10
# the terms of the GNU Affero General Public License as published by the
11
# Free Software Foundation, either version 3 of the License, or (at your
12
# option) any later version.
13
#
14
# EGSnrc is distributed in the hope that it will be useful, but WITHOUT ANY
15
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
17
# more details.
18
#
19
# You should have received a copy of the GNU Affero General Public License
20
# along with EGSnrc. If not, see <http://www.gnu.org/licenses/>.
21
#
22
###############################################################################
23
#
24
# Author: Iwan Kawrakow, 2009
25
#
26
# Contributors:
27
#
28
###############################################################################
29
*/
30
31
40
#include "
egs_ausgab_object.h
"
41
#include "
egs_input.h
"
42
43
static
EGS_LOCAL
EGS_TypedObjectFactory<EGS_AusgabObject>
44
ausgab_object_creator(
string
(
"egs++/dso/"
)+CONFIG_NAME,
"EGS_AusgabObject"
);
45
46
void
EGS_AusgabObject::createAusgabObjects
(
EGS_Input
*i) {
47
ausgab_object_creator.createObjects(i,
"ausgab object definition"
,
48
"ausgab object"
,
"__no__key__"
,
"createAusgabObject"
,
true
);
49
}
50
51
EGS_AusgabObject
*
EGS_AusgabObject::getAusgabObject
(
const
string
&Name) {
52
EGS_Object
*o = ausgab_object_creator.getObject(Name);
53
if
(!o) {
54
return
0;
55
}
56
EGS_AusgabObject
*s =
dynamic_cast<
EGS_AusgabObject
*
>
(o);
57
if
(s) {
58
return
s;
59
}
60
egsWarning
(
"EGS_AusgabObject::getAusgabObject(): dynamic cast failed?\n"
61
" Object named %s is of type %s. Trying simple cast\n"
,
62
Name.c_str(),o->
getObjectType
().c_str());
63
return
(
EGS_AusgabObject
*)o;
64
}
65
66
void
EGS_AusgabObject::addKnownAusgabObject
(
EGS_AusgabObject
*o) {
67
if
(o)
egsInformation
(
"Adding known ausgab object of type %s\n"
,
68
o->
getObjectType
().c_str());
69
ausgab_object_creator.addKnownObject(o);
70
}
71
72
void
EGS_AusgabObject::addKnownTypeId
(
const
char
*tid) {
73
ausgab_object_creator.addKnownTypeId(tid);
74
}
75
76
int
EGS_AusgabObject::nObjects
() {
77
return
ausgab_object_creator.nObjects();
78
}
79
80
EGS_AusgabObject
*
EGS_AusgabObject::getObject
(
int
j) {
81
return
(
EGS_AusgabObject
*) ausgab_object_creator.getObject(j);
82
}
EGS_Object
Base egspp object.
Definition:
egs_object_factory.h:81
EGS_AusgabObject
Definition:
egs_ausgab_object.h:64
EGS_AusgabObject::nObjects
static int nObjects()
Returns the number of ausgab objects in the internal list.
Definition:
egs_ausgab_object.cpp:76
egs_ausgab_object.h
EGS_AusgabObject interface class header file.
EGS_AusgabObject::getObject
static EGS_AusgabObject * getObject(int j)
Returns the j'th ausgab object in the internal list.
Definition:
egs_ausgab_object.cpp:80
egs_input.h
EGS_Input class header file.
EGS_TypedObjectFactory
A typed object factory.
Definition:
egs_object_factory.h:381
EGS_AusgabObject::getAusgabObject
static EGS_AusgabObject * getAusgabObject(const string &Name)
Get a pointer to the ausgab object named Name.
Definition:
egs_ausgab_object.cpp:51
egsInformation
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
Definition:
egs_functions.cpp:134
EGS_AusgabObject::createAusgabObjects
static void createAusgabObjects(EGS_Input *)
Create ausgab objects from the information pointed to by input.
Definition:
egs_ausgab_object.cpp:46
EGS_Object::getObjectType
const string & getObjectType() const
Get the object type.
Definition:
egs_object_factory.h:114
EGS_Input
A class for storing information in a tree-like structure of key-value pairs. This class is used throu...
Definition:
egs_input.h:182
EGS_AusgabObject::addKnownTypeId
static void addKnownTypeId(const char *name)
Add a known ausgab object typeid to the ausgab object factory.
Definition:
egs_ausgab_object.cpp:72
EGS_AusgabObject::addKnownAusgabObject
static void addKnownAusgabObject(EGS_AusgabObject *o)
Add a known ausgab object to the ausgab object factory.
Definition:
egs_ausgab_object.cpp:66
egsWarning
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.
Definition:
egs_functions.cpp:135
Generated by
1.8.5