Skip to content

Commit

Permalink
feat: use 'pragma once' as include guards instead of 'ifndef...'
Browse files Browse the repository at this point in the history
  • Loading branch information
Taepper committed Aug 31, 2023
1 parent 7305854 commit bc49aa5
Show file tree
Hide file tree
Showing 112 changed files with 112 additions and 447 deletions.
5 changes: 1 addition & 4 deletions include/silo/common/aa_symbols.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_SymbolS_H
#define SILO_SymbolS_H
#pragma once

#include <array>
#include <iostream>
Expand Down Expand Up @@ -64,5 +63,3 @@ class AminoAcid {
};
} // namespace silo
// namespace silo

#endif // SILO_SymbolS_H
5 changes: 1 addition & 4 deletions include/silo/common/bidirectional_map.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_BIDIRECTIONAL_MAP_H
#define SILO_BIDIRECTIONAL_MAP_H
#pragma once

#include <cstdint>
#include <optional>
Expand Down Expand Up @@ -45,5 +44,3 @@ class BidirectionalMap {
};

} // namespace silo::common

#endif // SILO_BIDIRECTIONAL_MAP_H
5 changes: 1 addition & 4 deletions include/silo/common/block_timer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_BLOCK_TIMER_H
#define SILO_BLOCK_TIMER_H
#pragma once

#include <chrono>

Expand All @@ -22,5 +21,3 @@ struct [[nodiscard]] BlockTimer {

output_t untilNow() { return std::chrono::duration_cast<Unit>(Clock::now() - start).count(); }
};

#endif // SILO_BLOCK_TIMER_H
5 changes: 1 addition & 4 deletions include/silo/common/data_version.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_INCLUDE_SILO_COMMON_DATAVERSION_H_
#define SILO_INCLUDE_SILO_COMMON_DATAVERSION_H_
#pragma once

#include <optional>
#include <string>
Expand Down Expand Up @@ -30,5 +29,3 @@ class DataVersion {
};

} // namespace silo

#endif // SILO_INCLUDE_SILO_COMMON_DATAVERSION_H_
5 changes: 1 addition & 4 deletions include/silo/common/date.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_DATE_H
#define SILO_DATE_H
#pragma once

#include <cstdint>
#include <optional>
Expand All @@ -14,5 +13,3 @@ silo::common::Date stringToDate(const std::string& value);
std::optional<std::string> dateToString(silo::common::Date date);

} // namespace silo::common

#endif // SILO_DATE_H
5 changes: 1 addition & 4 deletions include/silo/common/date_format_exception.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_DATE_FORMAT_EXCEPTION_H
#define SILO_DATE_FORMAT_EXCEPTION_H
#pragma once

#include <stdexcept>
#include <string>
Expand All @@ -12,5 +11,3 @@ class DateFormatException : public std::runtime_error {
};

} // namespace silo::common

#endif // SILO_DATE_FORMAT_EXCEPTION_H
5 changes: 1 addition & 4 deletions include/silo/common/fasta_format_exception.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_FASTA_FORMAT_EXCEPTION_H
#define SILO_FASTA_FORMAT_EXCEPTION_H
#pragma once

#include <stdexcept>
#include <string>
Expand All @@ -12,5 +11,3 @@ class FastaFormatException : public std::runtime_error {
};

} // namespace silo

#endif // SILO_FASTA_FORMAT_EXCEPTION_H
5 changes: 1 addition & 4 deletions include/silo/common/fasta_reader.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_FASTA_READER_H
#define SILO_FASTA_READER_H
#pragma once

#include <filesystem>
#include <iostream>
Expand All @@ -25,5 +24,3 @@ class FastaReader {
void reset();
};
} // namespace silo

#endif // SILO_FASTA_READER_H
5 changes: 1 addition & 4 deletions include/silo/common/format_number.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_FORMAT_NUMBER_H
#define SILO_FORMAT_NUMBER_H
#pragma once

#include <cstdint>
#include <string>
Expand All @@ -9,5 +8,3 @@ namespace silo {
std::string formatNumber(uint64_t number);

}

#endif // SILO_FORMAT_NUMBER_H
5 changes: 1 addition & 4 deletions include/silo/common/input_stream_wrapper.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_ISTREAM_WRAPPER_H
#define SILO_ISTREAM_WRAPPER_H
#pragma once

#include <filesystem>
#include <fstream>
Expand All @@ -20,5 +19,3 @@ struct InputStreamWrapper {
[[nodiscard]] std::istream& getInputStream() const;
};
} // namespace silo

#endif // SILO_ISTREAM_WRAPPER_H
5 changes: 1 addition & 4 deletions include/silo/common/log.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_LOG_H
#define SILO_LOG_H
#pragma once

#include <string>

Expand All @@ -10,5 +9,3 @@ static const std::string PERFORMANCE_LOGGER_NAME = "performance_logger";
}

#define LOG_PERFORMANCE(...) SPDLOG_LOGGER_INFO(spdlog::get(PERFORMANCE_LOGGER_NAME), __VA_ARGS__)

#endif // SILO_LOG_H
5 changes: 1 addition & 4 deletions include/silo/common/nucleotide_symbols.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_NUCLEOTIDE_SYMBOLS_H
#define SILO_NUCLEOTIDE_SYMBOLS_H
#pragma once

#include <algorithm>
#include <array>
Expand Down Expand Up @@ -71,5 +70,3 @@ class Nucleotide {
};

} // namespace silo

#endif // SILO_NUCLEOTIDE_SYMBOLS_H
5 changes: 1 addition & 4 deletions include/silo/common/pango_lineage.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_PANGO_LINEAGE_H
#define SILO_PANGO_LINEAGE_H
#pragma once

#include <cstddef>
#include <cstdint>
Expand Down Expand Up @@ -38,5 +37,3 @@ template <>
struct std::hash<silo::common::UnaliasedPangoLineage> {
std::size_t operator()(const silo::common::UnaliasedPangoLineage& pango_lineage) const;
};

#endif // SILO_PANGO_LINEAGE_H
5 changes: 1 addition & 4 deletions include/silo/common/string.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_STRING_H
#define SILO_STRING_H
#pragma once

#include <array>
#include <compare>
Expand Down Expand Up @@ -69,5 +68,3 @@ template <size_t I>
struct std::hash<silo::common::String<I>> {
std::size_t operator()(const silo::common::String<I>& str) const;
};

#endif // SILO_STRING_H
5 changes: 1 addition & 4 deletions include/silo/common/string_utils.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_STRING_UTILS_H
#define SILO_STRING_UTILS_H
#pragma once

#include <string>
#include <string_view>
Expand All @@ -10,5 +9,3 @@ namespace silo {
std::vector<std::string> splitBy(const std::string& value, const std::string_view delimiter);

} // namespace silo

#endif // SILO_STRING_UTILS_H
5 changes: 1 addition & 4 deletions include/silo/common/symbol_map.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_SYMBOL_MAP_H
#define SILO_SYMBOL_MAP_H
#pragma once

#include <vector>

Expand Down Expand Up @@ -35,5 +34,3 @@ class SymbolMap {
};

} // namespace silo

#endif // SILO_SYMBOL_MAP_H
5 changes: 1 addition & 4 deletions include/silo/common/template_utils.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_TEMPLATE_UTILS_H
#define SILO_TEMPLATE_UTILS_H
#pragma once

#include <cstddef>

Expand All @@ -22,5 +21,3 @@ struct NestedContainer<1, Container, ContainerArg, Base> {
};

} // namespace silo

#endif // SILO_TEMPLATE_UTILS_H
5 changes: 1 addition & 4 deletions include/silo/common/types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_TYPES_H
#define SILO_TYPES_H
#pragma once

#include <cstddef>
#include <cstdint>
Expand All @@ -8,5 +7,3 @@ namespace silo {
// Referencing to silo internal pointers
typedef uint32_t Idx;
} // namespace silo

#endif // SILO_TYPES_H
5 changes: 1 addition & 4 deletions include/silo/common/zstd_compressor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_ZSTD_COMPRESSOR_H
#define SILO_ZSTD_COMPRESSOR_H
#pragma once

#include <cstddef>
#include <string>
Expand Down Expand Up @@ -28,5 +27,3 @@ class ZstdCompressor {
};

} // namespace silo

#endif // SILO_ZSTD_COMPRESSOR_H
5 changes: 1 addition & 4 deletions include/silo/common/zstd_decompressor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_ZSTD_DECOMPRESSOR_H
#define SILO_ZSTD_DECOMPRESSOR_H
#pragma once

#include <string>

Expand All @@ -24,5 +23,3 @@ class ZstdDecompressor {
};

} // namespace silo

#endif // SILO_ZSTD_DECOMPRESSOR_H
5 changes: 1 addition & 4 deletions include/silo/common/zstdfasta_reader.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_ZSTDFASTA_READER_H
#define SILO_ZSTDFASTA_READER_H
#pragma once

#include <filesystem>
#include <iostream>
Expand Down Expand Up @@ -34,5 +33,3 @@ class ZstdFastaReader {
void reset();
};
} // namespace silo

#endif // SILO_ZSTDFASTA_READER_H
5 changes: 1 addition & 4 deletions include/silo/common/zstdfasta_writer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_ZSTDFASTA_WRITER_H
#define SILO_ZSTDFASTA_WRITER_H
#pragma once

#include <filesystem>
#include <iostream>
Expand Down Expand Up @@ -39,5 +38,3 @@ class ZstdFastaWriter {
void writeDefault(const std::string& key);
};
} // namespace silo

#endif // SILO_ZSTDFASTA_WRITER_H
5 changes: 1 addition & 4 deletions include/silo/config/config_exception.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_INCLUDE_SILO_CONFIG_CONFIG_EXCEPTION_H_
#define SILO_INCLUDE_SILO_CONFIG_CONFIG_EXCEPTION_H_
#pragma once

#include <iostream>
#include <stdexcept>
Expand All @@ -13,5 +12,3 @@ class ConfigException : public std::runtime_error {
};

} // namespace silo::config

#endif // SILO_INCLUDE_SILO_CONFIG_CONFIG_EXCEPTION_H_
5 changes: 1 addition & 4 deletions include/silo/config/config_repository.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_INCLUDE_SILO_CONFIG_CONFIG_REPOSITORY_H_
#define SILO_INCLUDE_SILO_CONFIG_CONFIG_REPOSITORY_H_
#pragma once

#include <filesystem>

Expand All @@ -19,5 +18,3 @@ class ConfigRepository {
};

} // namespace silo::config

#endif // SILO_INCLUDE_SILO_CONFIG_CONFIG_REPOSITORY_H_
5 changes: 1 addition & 4 deletions include/silo/config/database_config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_INCLUDE_SILO_CONFIG_DATABASECONFIG_H_
#define SILO_INCLUDE_SILO_CONFIG_DATABASECONFIG_H_
#pragma once

#include <filesystem>
#include <optional>
Expand Down Expand Up @@ -88,5 +87,3 @@ struct [[maybe_unused]] fmt::formatter<silo::config::ValueType> : fmt::formatter
format_context& ctx
) -> decltype(ctx.out());
};

#endif // SILO_INCLUDE_SILO_CONFIG_DATABASECONFIG_H_
5 changes: 1 addition & 4 deletions include/silo/database.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_DATABASE_H
#define SILO_DATABASE_H
#pragma once

#include <cstddef>
#include <cstdint>
Expand Down Expand Up @@ -108,5 +107,3 @@ class Database {
};

} // namespace silo

#endif // SILO_DATABASE_H
5 changes: 1 addition & 4 deletions include/silo/database_info.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_INCLUDE_SILO_API_DATABASE_INFO_H_
#define SILO_INCLUDE_SILO_API_DATABASE_INFO_H_
#pragma once

#include <cinttypes>
#include <map>
Expand Down Expand Up @@ -59,5 +58,3 @@ struct DetailedDatabaseInfo {
};

} // namespace silo

#endif // SILO_INCLUDE_SILO_API_DATABASE_INFO_H_
5 changes: 1 addition & 4 deletions include/silo/persistence/exception.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_LOADDATABASEEXCEPTION_H
#define SILO_LOADDATABASEEXCEPTION_H
#pragma once

#include <iostream>
#include <stdexcept>
Expand All @@ -18,5 +17,3 @@ class SaveDatabaseException : public std::runtime_error {
};

} // namespace silo::persistence

#endif // SILO_LOADDATABASEEXCEPTION_H
5 changes: 1 addition & 4 deletions include/silo/prepare_dataset.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_PREPARE_DATASET_H
#define SILO_PREPARE_DATASET_H
#pragma once

#include <filesystem>
#include <iostream>
Expand Down Expand Up @@ -50,5 +49,3 @@ void sortChunks(
);

} // namespace silo

#endif // SILO_PREPARE_DATASET_H
5 changes: 1 addition & 4 deletions include/silo/preprocessing/metadata.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SILO_SRC_SILO_STORAGE_CSV_READER_H_
#define SILO_SRC_SILO_STORAGE_CSV_READER_H_
#pragma once

#include <filesystem>
#include <iosfwd>
Expand Down Expand Up @@ -32,5 +31,3 @@ class MetadataWriter {
};

} // namespace silo::preprocessing

#endif // SILO_SRC_SILO_STORAGE_CSV_READER_H_
Loading

0 comments on commit bc49aa5

Please sign in to comment.