Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GUPI_entry.cc
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# Copyright 2019, Lawrence Livermore National Security, LLC.
4# This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
5# gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
6# SPDX-License-Identifier: MIT
7# <<END-copyright>>
8*/
9
10#include <fstream>
11
12#include "GUPI.hpp"
13
14namespace GUPI {
15
16/*! \class Entry
17 * This is a base class inherit by other classes that are enties in a **Suite**.
18 */
19
20/* *********************************************************************************************************//**
21 * @param a_moniker [in] The **GNDS** node's name (i.e., moniker).
22 * @param a_attribute [in] Currently not used.
23 ***********************************************************************************************************/
24
25Entry::Entry( std::string const &a_moniker, std::string const &a_keyName, std::string const &a_keyValue ) :
26 Ancestry( a_moniker ),
27 m_keyName( a_keyName ),
28 m_keyValue( a_keyValue ) {
29
30}
31
32/* *********************************************************************************************************//**
33 * @param a_moniker [in] The **GNDS** node's name (i.e., moniker).
34 * @param a_attribute [in] Currently not used.
35 ***********************************************************************************************************/
36
37Entry::Entry( HAPI::Node const &a_node, std::string const &a_keyName ) :
38 Ancestry( a_node.name( ) ),
39 m_keyName( a_keyName ),
40 m_keyValue( a_node.attribute_as_string( a_keyName.c_str( ) ) ) {
41
42}
43
44/* *********************************************************************************************************//**
45 ***********************************************************************************************************/
46
48
49}
50
51/* *********************************************************************************************************//**
52 * This method serializes *this* for broadcasting as needed for MPI and GPUs. The method can count the number of required
53 * bytes, pack *this* or unpack *this* depending on *a_mode*.
54 *
55 * @param a_buffer [in] The buffer to read or write data to depending on *a_mode*.
56 * @param a_mode [in] Specifies the action of this method.
57 ***********************************************************************************************************/
58
60
61 Ancestry::serialize( a_buffer, a_mode );
62 DATA_MEMBER_STD_STRING( m_keyName, a_buffer, a_mode );
63 DATA_MEMBER_STD_STRING( m_keyValue, a_buffer, a_mode );
64}
65
66}
#define DATA_MEMBER_STD_STRING(member, buf, mode)
#define LUPI_HOST
virtual LUPI_HOST void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
Ancestry(std::string const &a_moniker, std::string const &a_attribute="")
LUPI_HOST void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
Definition GUPI_entry.cc:59
Entry(std::string const &a_moniker, std::string const &a_keyName, std::string const &a_keyValue)
Definition GUPI_entry.cc:25
Definition GUPI.hpp:20