The Gaudi Framework
master (34daa81a)
Loading...
Searching...
No Matches
GraphDumper.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#pragma once
12
13
#include <fstream>
14
#include <string>
15
#include <string_view>
16
17
namespace
Gaudi::Hive
{
18
19
enum class
FileType
:
short
{
UNKNOWN
,
DOT
,
MD
,
ML
};
20
30
class
Graph
{
31
32
public
:
40
Graph
( std::string_view
fileName
,
FileType
type =
FileType::UNKNOWN
);
41
42
~Graph
();
43
44
std::string
const
&
fileName
();
45
46
void
addNode
( std::string_view
id
, std::string_view name );
47
48
void
addEdge
( std::string_view srcId, std::string_view tgtId, std::string_view label =
""
);
49
50
private
:
51
// Utilities to write file headers and trailers in case a format needs them
52
void
writeHeader
();
53
void
writeTrailer
();
54
56
std::string
m_fileName
;
58
std::ofstream
m_stream
;
60
FileType
m_type
{
FileType::UNKNOWN
};
61
};
62
63
}
// end namespace Gaudi::Hive
Gaudi::Hive::Graph::addNode
void addNode(std::string_view id, std::string_view name)
Definition
GraphDumper.cpp:72
Gaudi::Hive::Graph::~Graph
~Graph()
Definition
GraphDumper.cpp:65
Gaudi::Hive::Graph::m_type
FileType m_type
type of file used
Definition
GraphDumper.h:60
Gaudi::Hive::Graph::addEdge
void addEdge(std::string_view srcId, std::string_view tgtId, std::string_view label="")
Definition
GraphDumper.cpp:93
Gaudi::Hive::Graph::m_fileName
std::string m_fileName
name of the filed used for storing the graph
Definition
GraphDumper.h:56
Gaudi::Hive::Graph::fileName
std::string const & fileName()
Definition
GraphDumper.cpp:70
Gaudi::Hive::Graph::writeHeader
void writeHeader()
Definition
GraphDumper.cpp:124
Gaudi::Hive::Graph::Graph
Graph(std::string_view fileName, FileType type=FileType::UNKNOWN)
Creates a graph with given type and given file name.
Definition
GraphDumper.cpp:45
Gaudi::Hive::Graph::writeTrailer
void writeTrailer()
Definition
GraphDumper.cpp:147
Gaudi::Hive::Graph::m_stream
std::ofstream m_stream
stream to the graph file
Definition
GraphDumper.h:58
Gaudi::Hive
Definition
FetchDataFromFile.cpp:14
Gaudi::Hive::FileType
FileType
Definition
GraphDumper.h:19
Gaudi::Hive::FileType::DOT
@ DOT
Definition
GraphDumper.h:19
Gaudi::Hive::FileType::UNKNOWN
@ UNKNOWN
Definition
GraphDumper.h:19
Gaudi::Hive::FileType::MD
@ MD
Definition
GraphDumper.h:19
Gaudi::Hive::FileType::ML
@ ML
Definition
GraphDumper.h:19
GaudiHive
src
GraphDumper.h
Generated on Fri Apr 17 2026 10:44:45 for The Gaudi Framework by
1.13.1