Skip to content

Commit

Permalink
Use IWYU to add new headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Sep 8, 2024
1 parent 5618179 commit fa120f9
Show file tree
Hide file tree
Showing 79 changed files with 312 additions and 124 deletions.
10 changes: 5 additions & 5 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 4
- Regex: '.*'
Priority: 3
- Regex: '<[[:alnum:]._]+>'
Priority: 5
- Regex: '^(<"podio/)'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: BeforeHash
Expand Down
1 change: 1 addition & 0 deletions include/podio/CollectionBufferFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <functional>
#include <optional>
#include <string>
#include <unordered_map>
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions include/podio/DatamodelRegistry.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef PODIO_DATAMODELREGISTRY_H
#define PODIO_DATAMODELREGISTRY_H

#include <stddef.h>
#include <string>
#include <string_view>
#include <tuple>
Expand Down
5 changes: 5 additions & 0 deletions include/podio/GenericParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@
#include "podio/utilities/TypeHelpers.h"

#include <algorithm>
#include <initializer_list>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <mutex>
#include <optional>
#include <stddef.h>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>

#if PODIO_ENABLE_SIO
Expand Down
13 changes: 7 additions & 6 deletions include/podio/RNTupleReader.h
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
#ifndef PODIO_RNTUPLEREADER_H
#define PODIO_RNTUPLEREADER_H

#include "podio/GenericParameters.h"
#include "podio/ROOTFrameData.h"
#include "podio/SchemaEvolution.h"
#include "podio/podioVersion.h"
#include "podio/utilities/DatamodelRegistryIOHelpers.h"
#include <ROOT/RVersion.hxx>
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 31, 0)
#include <ROOT/RNTupleReader.hxx>
#endif

#include <memory>
#include <string>
#include <string_view>
#include <unordered_map>
#include <vector>

#include <ROOT/RNTuple.hxx>
#include <RVersion.h>
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 31, 0)
#include <ROOT/RNTupleReader.hxx>
#endif

namespace podio {
class CollectionIDTable;

/**
This class has the function to read available data from disk
Expand Down
18 changes: 14 additions & 4 deletions include/podio/RNTupleWriter.h
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
#ifndef PODIO_RNTUPLEWRITER_H
#define PODIO_RNTUPLEWRITER_H

#include "podio/Frame.h"
#include "TFile.h"
#include "podio/SchemaEvolution.h"
#include "podio/utilities/DatamodelRegistryIOHelpers.h"
#include "podio/utilities/RootHelpers.h"

#include "TFile.h"
#include <ROOT/RNTuple.hxx>
#include <ROOT/RNTupleModel.hxx>
#include <ROOT/RVersion.hxx>

#include <stdint.h>

namespace ROOT {
namespace Experimental {
class REntry;
} // namespace Experimental
} // namespace ROOT
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 31, 0)
#include <ROOT/RNTupleWriter.hxx>
#endif

#include <memory>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>

namespace podio {
class Frame;
class GenericParameters;

/// The RNTupleWriter writes podio files into ROOT files using the new RNTuple
/// format.
Expand Down
1 change: 1 addition & 0 deletions include/podio/ROOTFrameData.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <optional>
#include <string>
#include <unordered_map>
#include <vector>

namespace podio {

Expand Down
3 changes: 1 addition & 2 deletions include/podio/ROOTLegacyReader.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#ifndef PODIO_ROOTLEGACYREADER_H
#define PODIO_ROOTLEGACYREADER_H

#include "TChain.h"
#include "podio/ROOTFrameData.h"
#include "podio/podioVersion.h"
#include "podio/utilities/RootHelpers.h"

#include "TChain.h"

#include <memory>
#include <string>
#include <tuple>
Expand Down
12 changes: 4 additions & 8 deletions include/podio/ROOTReader.h
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
#ifndef PODIO_ROOTREADER_H
#define PODIO_ROOTREADER_H

#include "TChain.h"
#include "podio/ROOTFrameData.h"
#include "podio/SchemaEvolution.h"
#include "podio/podioVersion.h"
#include "podio/utilities/DatamodelRegistryIOHelpers.h"
#include "podio/utilities/RootHelpers.h"

#include "TChain.h"

#include <memory>
#include <stddef.h>
#include <string>
#include <string_view>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>

// forward declarations
class TClass;
class TFile;
class TTree;

namespace podio {

namespace detail {
Expand All @@ -30,7 +27,6 @@ namespace detail {

} // namespace detail

class CollectionBase;
class CollectionIDTable;
class GenericParameters;
struct CollectionReadBuffers;
Expand Down
4 changes: 1 addition & 3 deletions include/podio/ROOTWriter.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#ifndef PODIO_ROOTWRITER_H
#define PODIO_ROOTWRITER_H

#include "TFile.h"
#include "podio/CollectionIDTable.h"
#include "podio/utilities/DatamodelRegistryIOHelpers.h"
#include "podio/utilities/RootHelpers.h"

#include "TFile.h"

#include <memory>
#include <string>
#include <tuple>
Expand All @@ -18,7 +17,6 @@ class TTree;

namespace podio {
class Frame;
class CollectionBase;
class GenericParameters;

/// The ROOTWriter writes podio files into ROOT files using TTrees.
Expand Down
8 changes: 8 additions & 0 deletions include/podio/Reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
#define PODIO_READER_H

#include "podio/Frame.h"
#include "podio/FrameCategories.h"
#include "podio/podioVersion.h"

#include <memory>
#include <cstddef>
#include <stdexcept>
#include <string>
#include <string_view>
#include <vector>

namespace podio {

/// Generic (type erased) reader class that can handle different I/O backends
Expand Down
1 change: 0 additions & 1 deletion include/podio/SIOBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <podio/GenericParameters.h>
#include <podio/podioVersion.h>
#include <podio/utilities/TypeHelpers.h>

#include <sio/block.h>
#include <sio/io_device.h>
#include <sio/version.h>
Expand Down
1 change: 0 additions & 1 deletion include/podio/SIOBlockUserData.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "podio/CollectionBuffers.h"
#include "podio/SIOBlock.h"
#include "podio/UserDataCollection.h"

#include <sio/api.h>
#include <sio/io_device.h>
#include <sio/version.h>
Expand Down
1 change: 0 additions & 1 deletion include/podio/SIOFrameData.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "podio/CollectionIDTable.h"
#include "podio/GenericParameters.h"
#include "podio/SIOBlock.h"

#include <sio/buffer.h>
#include <sio/definitions.h>

Expand Down
1 change: 0 additions & 1 deletion include/podio/SIOLegacyReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "podio/SIOBlock.h"
#include "podio/SIOFrameData.h"
#include "podio/podioVersion.h"

#include <sio/definitions.h>

#include <memory>
Expand Down
1 change: 0 additions & 1 deletion include/podio/SIOReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "podio/SIOFrameData.h"
#include "podio/podioVersion.h"
#include "podio/utilities/DatamodelRegistryIOHelpers.h"

#include <sio/definitions.h>

#include <memory>
Expand Down
1 change: 0 additions & 1 deletion include/podio/SIOWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "podio/SIOBlock.h"
#include "podio/utilities/DatamodelRegistryIOHelpers.h"

#include <sio/definitions.h>

#include <string>
Expand Down
1 change: 1 addition & 0 deletions include/podio/SchemaEvolution.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <cstdint>
#include <functional>
#include <stddef.h>
#include <string>
#include <unordered_map>
#include <vector>
Expand Down
12 changes: 12 additions & 0 deletions include/podio/UserDataCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
#include "podio/SchemaEvolution.h"
#include "podio/utilities/TypeHelpers.h"

#include <iostream>
#include <stddef.h>
#include <stdint.h>
#include <string_view>
#include <tuple>
#include <type_traits>
#include <vector>

namespace podio {
class ICollectionProvider;
} // namespace podio

#define PODIO_ADD_USER_TYPE(type) \
template <> \
constexpr const char* userDataTypeName<type>() { \
Expand Down
5 changes: 5 additions & 0 deletions include/podio/Writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
#define PODIO_WRITER_H

#include "podio/Frame.h"
#include "podio/FrameCategories.h"

#include <memory>
#include <string>
#include <vector>

namespace podio {

Expand Down
7 changes: 4 additions & 3 deletions include/podio/utilities/DatamodelRegistryIOHelpers.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#ifndef PODIO_UTILITIES_DATAMODELREGISTRYIOHELPERS_H
#define PODIO_UTILITIES_DATAMODELREGISTRYIOHELPERS_H

#include "podio/CollectionBase.h"
#include "podio/DatamodelRegistry.h"

#include <set>
#include <stddef.h>
#include <string>
#include <string_view>
#include <tuple>
#include <utility>
#include <vector>

namespace podio {
class CollectionBase;

/// Helper class to collect the datamodel (JSON) definitions that should be
/// written.
Expand Down
12 changes: 9 additions & 3 deletions include/podio/utilities/RootHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@

#include "podio/GenericParameters.h"

#include "ROOT/RVec.hxx"
#include "TBranch.h"

#include <stdint.h>
#include <string>
#include <tuple>
#include <vector>

class TBranch;
namespace ROOT {
namespace VecOps {
template <typename T>
class RVec;
} // namespace VecOps
} // namespace ROOT

namespace podio {
class CollectionBase;

Expand Down
4 changes: 4 additions & 0 deletions src/CollectionBufferFactory.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include "podio/CollectionBufferFactory.h"

#include "podio/CollectionBuffers.h"

#include <stddef.h>
#include <utility>

namespace podio {
CollectionBufferFactory& CollectionBufferFactory::mutInstance() {
static CollectionBufferFactory factory;
Expand Down
3 changes: 3 additions & 0 deletions src/CollectionIDTable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

#include <algorithm>
#include <iostream>
#include <iterator>
#include <stddef.h>
#include <utility>

namespace podio {

Expand Down
1 change: 1 addition & 0 deletions src/DataSource.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "podio/DataSource.h"

#include "podio/Reader.h"

// podio
Expand Down
5 changes: 5 additions & 0 deletions src/DatamodelRegistryIOHelpers.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#include "podio/utilities/DatamodelRegistryIOHelpers.h"

#include "podio/CollectionBase.h"
#include "podio/DatamodelRegistry.h"

#include <algorithm>
#include <iostream>
#include <iterator>

namespace podio {
Expand Down
Loading

0 comments on commit fa120f9

Please sign in to comment.