...
 
Commits (4)
  • Sophie Wenzel-Teuber's avatar
    Change physical and logical layout of the code · b0778ded
    Sophie Wenzel-Teuber authored
    Change the file and folder layout, adding inline namespaces so the logical
    namespaces match the physical locations of the files.
    This also improves the organization and presentation of Doxygen documentation.
    
    Change log:
    * general:
        - Change names of classes and files to Snake case, starting with a capital
          letter
        - Tidy documentation and add @briefs everywhere
        - Adding namespaces inside #ifdef __cplusplus pragmas to C-files, such that
          the members will appear at the correct location in the documentation
    * flow:
        - Move most of the classes in the flow namespace to a detail namespace
    * piol:
        - Move communicator to utils namespace and rename CommunicatorInterface.hh
          to just Communicator.hh
        - Move Read and Write classes to namespace file and rename to Input_file and
          Output_file
        - Move Object read/Write-classes to detail namespace inside namespace file
        - Move ExSeis[PIOL] to configuration namespace
        - Rename Binary_file to IO_driver and move to own namespace
        - Create metadata namespace with Trace_metadata_key (formerly Meta) and a
          rules namespace containing everything concerning the rules for SEGY files
        - Create namespace segy for utilities and Trace header offsets (formerly Tr)
        - Create sort namespace inside operations namespace for the sort operations
    * utils:
        - Move Distributed_vector classes to namespace of the same name
        - Remove mpi namespace and create mpi_utils for utilities and move
          MPI_Distributed_vector to distributed_vector namespace and MPI_types to
          types namespace
        - Create types namespace for various kinds of type definitions
    b0778ded
  • Sophie Wenzel-Teuber's avatar
    Merge devel into branch · ff7b47b8
    Sophie Wenzel-Teuber authored
    ff7b47b8
  • Sophie Wenzel-Teuber's avatar
    c5604abd
  • Sophie Wenzel-Teuber's avatar
    94a5d0d4
......@@ -145,46 +145,43 @@ include(third_party/third_party.cmake)
add_library(
exseisdat
src/PIOL_C_bindings.cc
src/flow/Cache.cc
src/flow/Flow_C_bindings.cc
src/flow/RadonGatherState.cc
src/flow/Set.cc
src/piol/mpi/MPI_Binary_file.cc
src/piol/segy/utils.cc
src/CommunicatorMPI.cc
src/ExSeis.cc
src/ExSeisPIOL.cc
src/ObjectInterface.cc
src/ObjectSEGY.cc
src/ReadInterface.cc
src/ReadSEGY.cc
src/ReadSEGYModel.cc
src/Rule.cc
src/Trace_metadata.cc
src/WriteInterface.cc
src/WriteSEGY.cc
src/gather.cc
src/minmax.cc
src/sort.cc
src/temporalfilter.cc
src/utils/decomposition/block_decomposition.cc
src/utils/encoding/character_encoding.cc
src/utils/encoding/number_encoding.cc
src/utils/logging/Log.cc
src/utils/logging/Status.cc
src/utils/mpi/MPI_error_to_string.cc
src/utils/mpi/MPI_max_array_length.cc
src/utils/signal_processing/AGC.cc
src/utils/signal_processing/Gain_function.cc
src/utils/signal_processing/Taper_function.cc
src/utils/signal_processing/mute.cc
src/utils/signal_processing/taper.cc
src/exseisdat/flow/detail/Cache.cc
src/exseisdat/flow/Flow_C_bindings.cc
src/exseisdat/flow/detail/Radon_gather_state.cc
src/exseisdat/flow/Set.cc
src/exseisdat/piol/configuration/ExSeis.cc
src/exseisdat/piol/configuration/ExSeisPIOL.cc
src/exseisdat/piol/file/Input_file.cc
src/exseisdat/piol/file/Input_file_segy.cc
src/exseisdat/piol/file/detail/ObjectInterface.cc
src/exseisdat/piol/file/detail/ObjectSEGY.cc
src/exseisdat/piol/file/detail/ReadSEGYModel.cc
src/exseisdat/piol/file/Output_file.cc
src/exseisdat/piol/file/Output_file_segy.cc
src/exseisdat/piol/io_driver/IO_driver_mpi.cc
src/exseisdat/piol/metadata/rules/Rule.cc
src/exseisdat/piol/metadata/Trace_metadata.cc
src/exseisdat/piol/operations/gather.cc
src/exseisdat/piol/operations/minmax.cc
src/exseisdat/piol/operations/sort_operations/sort.cc
src/exseisdat/piol/PIOL_C_bindings.cc
src/exseisdat/piol/segy/utils.cc
src/exseisdat/utils/communicator/Communicator_mpi.cc
src/exseisdat/utils/decomposition/block_decomposition.cc
src/exseisdat/utils/encoding/character_encoding.cc
src/exseisdat/utils/encoding/number_encoding.cc
src/exseisdat/utils/logging/Log.cc
src/exseisdat/utils/logging/Status.cc
src/exseisdat/utils/mpi_utils/MPI_error_to_string.cc
src/exseisdat/utils/mpi_utils/MPI_max_array_length.cc
src/exseisdat/utils/signal_processing/AGC.cc
src/exseisdat/utils/signal_processing/Gain_function.cc
src/exseisdat/utils/signal_processing/Taper_function.cc
src/exseisdat/utils/signal_processing/mute.cc
src/exseisdat/utils/signal_processing/taper.cc
src/exseisdat/utils/signal_processing/temporalfilter.cc
)
target_compile_features(exseisdat PUBLIC cxx_std_14)
......
......@@ -8,7 +8,7 @@ configure_file(
@ONLY
)
set(INCLUDE_DOXYFILE "@INCLUDE = Doxyfile")
set(INCLUDE_DOXYFILE "@INCLUDE = ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile-man.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-man
......@@ -64,14 +64,22 @@ add_custom_command(
COMMENT "Building the documentation..."
)
add_custom_target(make_man_directory)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/man/exseis-extract-metadata.1
TARGET make_man_directory PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory man
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/man/man/exseis-extract-metadata.1
COMMAND ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-man"
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile-man.in
DEPENDS
DEPENDS
make_man_directory
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile-man.in
${EXSEISDAT_DOCUMENTED_EXAMPLES}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man
COMMENT "Building the documentation..."
)
......@@ -80,7 +88,7 @@ add_custom_target(
doc ALL
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/html/index.html
${CMAKE_CURRENT_BINARY_DIR}/man/exseis-extract-metadata.1
${CMAKE_CURRENT_BINARY_DIR}/man/man/exseis-extract-metadata.1
)
# Set install target
......
......@@ -6,6 +6,7 @@
PROJECT_NAME = ExSeisDat
GENERATE_HTML = NO
GENERATE_XML = NO
GENERATE_MAN = YES
INPUT = @CMAKE_SOURCE_DIR@/util
......
......@@ -36,7 +36,6 @@ WARN_AS_ERROR = YES
INPUT = \
@CMAKE_SOURCE_DIR@/doc/namespaces.dox \
@CMAKE_SOURCE_DIR@/include \
@CMAKE_SOURCE_DIR@/util \
@CMAKE_SOURCE_DIR@/README.md \
@CMAKE_CURRENT_BINARY_DIR@/examples/documented \
@CMAKE_SOURCE_DIR@/examples/README.md
......@@ -83,7 +82,9 @@ ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
PREDEFINED = __cplusplus
SEARCH_INCLUDES = YES
INCLUDE_PATH =
GENERATE_XML = YES
XML_NS_MEMB_FILE_SCOPE = YES
# Aliases for implicit members
ALIASES += special_member_functions="Special Member Functions"
......
......@@ -18,6 +18,63 @@
/// etc.
///
///
/// @namespace exseis::utils::communicator
///
/// @brief Interface and implementations of a communicator that is used for
/// message passing between the processes.
///
///
/// @namespace exseis::utils::decomposition
///
/// @brief Functions for splitting ranges across processes.
///
///
/// @namespace exseis::utils::distributed_vector
///
/// @brief Interface and implementations of a vector that is distributed
/// over several processes.
///
///
/// @namespace exseis::utils::encoding
///
/// @brief Functions for different kinds of encodings.
///
///
/// @namespace exseis::utils::logging
///
/// @brief Logging utilities.
///
///
/// @namespace exseis::utils::mpi_utils
///
/// @brief MPI utilities.
///
///
/// @namespace exseis::utils::signal_processing
///
/// @brief Functions for processing seismic signals.
///
///
/// @namespace exseis::utils::types
///
/// @brief Aliases for fundamental types and conversions used throughout the
/// ExSeisDat project.
///
///
/// @namespace exseis::utils::types::mpi
///
/// @brief Aliases for MPI datatypes
///
///
/// @namespace exseis::piol
///
......@@ -33,6 +90,54 @@
/// files.
///
///
/// @namespace exseis::piol::configuration
///
/// @brief Classes for storing configurations of the program.
///
///
/// @namespace exseis::piol::file
///
/// @brief Basic read and write classes.
///
///
/// @namespace exseis::piol::io_driver
///
/// @brief Interface and implementations that perform I/O operations
///
///
/// @namespace exseis::piol::metadata
///
/// @brief Seismic metadata utilities
///
///
/// @namespace exseis::piol::metadata::rules
///
/// @brief Rules associated with trace parameters
///
///
/// @namespace exseis::piol::operations
///
/// @brief Basic operations performed on the file data
///
///
/// @namespace exseis::piol::operations::sort_operations
///
/// @brief Classes and functions for sorting the data
///
///
/// @namespace exseis::piol::segy
///
/// @brief SEGY specific parameters and functions
///
///
/// @namespace exseis::flow
///
......
......@@ -44,7 +44,7 @@
///
using namespace exseis::utils;
using namespace exseis::piol;
using exseis::utils::typedefs::Floating_point;
using exseis::utils::Floating_point;
///
/// We implement a special function to compare Floating_point values to
......@@ -81,12 +81,12 @@ int main(int argc, char** argv)
/// to worry about this, but will likely need to pass it to a number of
/// classes and functions in the ExSeisDat library.
auto piol = ExSeis::make();
/// The exseis::piol::ReadSEGY class represents a SEG-Y files that we will
/// be reading from. It takes a "piol" object because it will be performing
/// some parallel I/O. It also takes the name of the file it will be
/// reading from.
ReadSEGY input_file_1(piol, input_filename_1);
ReadSEGY input_file_2(piol, input_filename_2);
/// The exseis::piol::Input_file_segy class represents a SEG-Y file that we
/// will be reading from. It takes a "piol" object because it will be
/// performing some parallel I/O. It also takes the name of the file it
/// will be reading from.
Input_file_segy input_file_1(piol, input_filename_1);
Input_file_segy input_file_2(piol, input_filename_2);
/// ### Global File Metadata
///
......@@ -208,14 +208,13 @@ int main(int argc, char** argv)
/// ### Write
///
/// The exseis::piol::WriteSEGY class represents a SEG-Y file that we
/// will be writing to. It takes a "piol" object because it will be
/// performing some parallel I/O. It also takes the name of the file it
/// will be writing to. By default, if the file doesn't exist, it will
/// create it.
/// The exseis::piol::Output_file_segy class represents a SEG-Y file that we
/// will be writing to. It takes a "piol" object because it will be
/// performing some parallel I/O. It also takes the name of the file it will
/// be writing to. By default, if the file doesn't exist, it will create it.
// Open a SEG-Y file for writing.
WriteSEGY output_file(piol, output_filename);
Output_file_segy output_file(piol, output_filename);
/// We can set the above parameters as global file information like so:
output_file.write_nt(number_of_traces[0] + number_of_traces[1]);
......
......@@ -39,7 +39,7 @@
using namespace exseis::utils;
using namespace exseis::piol;
using exseis::utils::typedefs::Floating_point;
using exseis::utils::Floating_point;
int main(int argc, char** argv)
{
......@@ -56,14 +56,14 @@ int main(int argc, char** argv)
/// to worry about this, but will likely need to pass it to a number of
/// classes and functions in the ExSeisDat library.
///
/// The exseis::piol::WriteSEGY class represents a SEG-Y file that we will
/// be writing to. It takes a "piol" object because it will be performing
/// some parallel I/O. It also takes the name of the file it will be writing
/// to. By default, if the file doesn't exist, it will create it.
/// The exseis::piol::Output_file_segy class represents a SEG-Y file that we
/// will be writing to. It takes a "piol" object because it will be
/// performing some parallel I/O. It also takes the name of the file it will
/// be writing to. By default, if the file doesn't exist, it will create it.
// Initialize ExSeisPIOL and open a SEG-Y file for writing.
auto piol = ExSeis::make();
WriteSEGY file(piol, filename);
Output_file_segy file(piol, filename);
/// ### Global File Metadata
///
......@@ -158,18 +158,18 @@ int main(int argc, char** argv)
/// Let's say we want to set the x and y source and receiver locations
/// and the in-line and cross-line locations.
/// In the ExSeisDat library, these are represented by
/// `exseis::piol::Meta` keys.
/// `exseis::piol::Trace_metadata_key` keys.
///
/// The mapping for the metadata values we're interested in here is
///
/// | Metadata | Meta key |
/// | ---------- | -------- |
/// | Source x | Meta::x_src |
/// | Source y | Meta::y_src |
/// | Receiver x | Meta::x_rcv |
/// | Receiver y | Meta::y_rcv |
/// | in-line | Meta::il |
/// | cross-line | Meta::xl |
/// | Metadata | Trace_metadata_key |
/// | ---------- | ------------------------- |
/// | Source x | Trace_metadata_key::x_src |
/// | Source y | Trace_metadata_key::y_src |
/// | Receiver x | Trace_metadata_key::x_rcv |
/// | Receiver y | Trace_metadata_key::y_rcv |
/// | in-line | Trace_metadata_key::il |
/// | cross-line | Trace_metadata_key::xl |
///
/// Some care must be taken that the types are correct. In the SEG-Y
/// format, some metadata values are integers, and some are floating
......@@ -189,13 +189,19 @@ int main(int argc, char** argv)
// Set the trace metadata
trace_metadata.set_floating_point(local_trace_index, Meta::x_src, 1.0);
trace_metadata.set_floating_point(local_trace_index, Meta::y_src, 1.0);
trace_metadata.set_floating_point(local_trace_index, Meta::x_rcv, 1.0);
trace_metadata.set_floating_point(local_trace_index, Meta::y_rcv, 1.0);
trace_metadata.set_integer(local_trace_index, Meta::il, 1);
trace_metadata.set_integer(local_trace_index, Meta::xl, 1);
trace_metadata.set_floating_point(
local_trace_index, Trace_metadata_key::x_src, 1.0);
trace_metadata.set_floating_point(
local_trace_index, Trace_metadata_key::y_src, 1.0);
trace_metadata.set_floating_point(
local_trace_index, Trace_metadata_key::x_rcv, 1.0);
trace_metadata.set_floating_point(
local_trace_index, Trace_metadata_key::y_rcv, 1.0);
trace_metadata.set_integer(
local_trace_index, Trace_metadata_key::il, 1);
trace_metadata.set_integer(
local_trace_index, Trace_metadata_key::xl, 1);
/// And while we're on `local_trace_index`, we can set some data for
/// this trace.
......
......@@ -47,14 +47,14 @@
using namespace exseis::piol;
using namespace exseis::utils; // we need block_decomposition
using exseis::utils::typedefs::Floating_point;
using exseis::utils::Floating_point;
// Header for custom min/max retrieval
void get_trace_min_max(
size_t offset,
size_t num_traces,
Meta m1,
Meta m2,
Trace_metadata_key m1,
Trace_metadata_key m2,
const Trace_metadata& prm,
CoordElem* minmax);
......@@ -75,11 +75,11 @@ int main(int argc, char** argv)
///
auto piol = ExSeis::make();
/// The exseis::piol::ReadSEGY class represents a SEG-Y file that we will
/// be reading from. It takes a "piol" object because it will be performing
/// some parallel I/O. It also takes the name of the file it will be
/// reading from.
ReadSEGY input_file(piol, input_filename);
/// The exseis::piol::Input_file_segy class represents a SEG-Y file that we
/// will be reading from. It takes a "piol" object because it will be
/// performing some parallel I/O. It also takes the name of the file it
/// will be reading from.
Input_file_segy input_file(piol, input_filename);
/// ### Global File Metadata
///
......@@ -172,11 +172,14 @@ int main(int argc, char** argv)
size_t offset = 0;
size_t sz = local_number_of_traces;
get_trace_min_max(
offset, sz, Meta::x_src, Meta::y_src, trace_metadata, &minmax[0]);
offset, sz, Trace_metadata_key::x_src, Trace_metadata_key::y_src,
trace_metadata, &minmax[0]);
get_trace_min_max(
offset, sz, Meta::x_rcv, Meta::y_rcv, trace_metadata, &minmax[4]);
offset, sz, Trace_metadata_key::x_rcv, Trace_metadata_key::y_rcv,
trace_metadata, &minmax[4]);
get_trace_min_max(
offset, sz, Meta::xCmp, Meta::yCmp, trace_metadata, &minmax[8]);
offset, sz, Trace_metadata_key::xCmp, Trace_metadata_key::yCmp,
trace_metadata, &minmax[8]);
/// ### Print results
///
......@@ -214,8 +217,8 @@ int main(int argc, char** argv)
void get_trace_min_max(
size_t offset,
size_t num_traces,
Meta m1,
Meta m2,
Trace_metadata_key m1,
Trace_metadata_key m2,
const Trace_metadata& prm,
CoordElem* minmax)
{
......
......@@ -46,7 +46,7 @@
///
using namespace exseis::utils;
using namespace exseis::piol;
using exseis::utils::typedefs::Floating_point;
using exseis::utils::Floating_point;
int main(int argc, char** argv)
{
......@@ -67,11 +67,11 @@ int main(int argc, char** argv)
/// to worry about this, but will likely need to pass it to a number of
/// classes and functions in the ExSeisDat library.
auto piol = ExSeis::make();
/// The exseis::piol::ReadSEGY class represents a SEG-Y file that we will
/// be reading from. It takes a "piol" object because it will be performing
/// some parallel I/O. It also takes the name of the file it will be
/// reading from.
ReadSEGY input_file(piol, input_filename);
/// The exseis::piol::Input_file_segy class represents a SEG-Y file that we
/// will be reading from. It takes a "piol" object because it will be
/// performing some parallel I/O. It also takes the name of the file it
/// will be reading from.
Input_file_segy input_file(piol, input_filename);
/// ### Global File Metadata
///
......@@ -180,13 +180,13 @@ int main(int argc, char** argv)
/// ### Write
///
/// The exseis::piol::WriteSEGY class represents a SEG-Y file that we will
/// be writing to. It takes a "piol" object because it will be performing
/// some parallel I/O. It also takes the name of the file it will be writing
/// to. By default, if the file doesn't exist, it will create it.
/// The exseis::piol::Output_file_segy class represents a SEG-Y file that we
/// will be writing to. It takes a "piol" object because it will be
/// performing some parallel I/O. It also takes the name of the file it will
/// be writing to. By default, if the file doesn't exist, it will create it.
// Open a SEG-Y file for writing.
WriteSEGY output_file(piol, output_filename);
Output_file_segy output_file(piol, output_filename);
/// We can set the above parameters as global file information like so:
output_file.write_nt(number_of_traces);
......
......@@ -6,7 +6,7 @@
#define EXSEISDAT_FLOW_H
#include "exseisdat/piol.h"
#include "exseisdat/piol/operations/SortType.h"
#include "exseisdat/piol/operations/sort_operations/SortType.h"
#include "exseisdat/utils/signal_processing/AGC.h"
#include "exseisdat/utils/signal_processing/Taper_function.h"
......@@ -26,26 +26,35 @@ typedef struct PIOL_Set PIOL_Set;
#ifdef __cplusplus
namespace exseis {
namespace piol {
using namespace exseis::utils;
// Everything from here on is C API functions needing C linkage.
extern "C" {
#endif
#endif // __cplusplus
/// @name PIOL Set functions
///
/// @{
/*! Initialise the set.
/*! @brief Initialise the set.
* @param[in] piol The PIOL handle
* @param[in] pattern The file-matching pattern
* @return The set handle
*/
PIOL_Set* piol_set_new(const piol_exseis* piol, const char* pattern);
/*! Free (deinit) the set.
/*! @brief Free (deinit) the set.
* @param[in,out] set The set handle
*/
void piol_set_delete(PIOL_Set* set);
/*! Get the min and the max of a set of parameters passed. This is a parallel
* operation. It is the collective min and max across all processes (which also
* must all call this file).
/*! @brief Get the min and the max of a set of parameters passed.
*
* @details This is a parallel operation. It is the collective min and max
* across all processes (which also must all call this file).
* @param[in,out] set The set handle
* @param[in] m1 The first parameter type
* @param[in] m2 The second parameter type
......@@ -55,17 +64,17 @@ void piol_set_delete(PIOL_Set* set);
*/
void piol_set_get_min_max(
PIOL_Set* set,
exseis_Meta m1,
exseis_Meta m2,
exseis_Trace_metadata_key m1,
exseis_Trace_metadata_key m2,
struct PIOL_CoordElem* minmax);
/*! Sort the set by the specified sort type.
/*! @brief Sort the set by the specified sort type.
* @param[in,out] set The set handle
* @param[in] type The sort type
*/
void piol_set_sort(PIOL_Set* set, exseis_SortType type);
/*! Sort the set using a custom comparison function
/*! @brief Sort the set using a custom comparison function
* @param[in,out] set A handle for the set.
* @param[in] func The custom comparison function to sort set
*/
......@@ -73,7 +82,7 @@ void piol_set_sort_fn(
PIOL_Set* set,
bool (*func)(const piol_file_trace_metadata* param, size_t i, size_t j));
/*! Perform tailed taper on a set of traces
/*! @brief Perform tailed taper on a set of traces
* @param[in,out] set A handle for the set
* @param[in] taper_function The type of taper to be applied to traces.
* @param[in] ntpstr The length of left-tail taper ramp.
......@@ -86,31 +95,31 @@ void piol_set_taper(
size_t ntpstr,
size_t ntpend);
/*! Output using the given output prefix
/*! @brief Output using the given output prefix
* @param[in,out] set The set handle
* @param[in] oname The output prefix
*/
void piol_set_output(PIOL_Set* set, const char* oname);
/*! Set the text-header of the output
/*! @brief Set the text-header of the output
* @param[in,out] set The set handle
* @param[in] outmsg The output message
*/
void piol_set_text(PIOL_Set* set, const char* outmsg);
/*! Summarise the current status by whatever means the PIOL instrinsically
* supports
/*! @brief Summarise the current status by whatever means the PIOL
* instrinsically supports
* @param[in] set The set handle
*/
void piol_set_summary(const PIOL_Set* set);
/*! Add a file to the set based on the name given
/*! @brief Add a file to the set based on the name given
* @param[in,out] set The set handle
* @param[in] name The input name
*/
void piol_set_add(PIOL_Set* set, const char* name);
/*! Scale traces using automatic gain control for visualization
/*! @brief Scale traces using automatic gain control for visualization
* @param[in,out] set The set handle
* @param[in] type They type of agc scaling function used
* @param[in] window Length of the agc window
......@@ -122,8 +131,12 @@ void piol_set_agc(
size_t window,
exseis_Trace_value target_amplitude);
/// @} PIOL Set functions
#ifdef __cplusplus
} // extern "C"
#endif
} // namespace piol
} // namespace exseis
#endif // __cplusplus
#endif // EXSEISDAT_FLOW_H
////////////////////////////////////////////////////////////////////////////////
/// @file
/// @brief Flow API header
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_FLOW_HH
#define EXSEISDAT_FLOW_HH
#include "exseisdat/piol.hh"
#include "exseisdat/flow/Cache.hh"
#include "exseisdat/flow/CacheElem.hh"
#include "exseisdat/flow/FileDesc.hh"
#include "exseisdat/flow/FuncOpt.hh"
#include "exseisdat/flow/GatherState.hh"
#include "exseisdat/flow/Op.hh"
#include "exseisdat/flow/OpOpt.hh"
#include "exseisdat/flow/OpParent.hh"
#include "exseisdat/flow/RadonGatherState.hh"
#include "exseisdat/flow/Set.hh"
#include "exseisdat/flow/TraceBlock.hh"
#include "exseisdat/flow/detail/Cache.hh"
#include "exseisdat/flow/detail/Cache_elem.hh"
#include "exseisdat/flow/detail/File_descriptor.hh"
#include "exseisdat/flow/detail/Function_options.hh"
#include "exseisdat/flow/detail/Gather_state.hh"
#include "exseisdat/flow/detail/Operation.hh"
#include "exseisdat/flow/detail/Operation_options.hh"
#include "exseisdat/flow/detail/Operation_parent.hh"
#include "exseisdat/flow/detail/Radon_gather_state.hh"
#include "exseisdat/flow/detail/Trace_block.hh"
#endif // EXSEISDAT_FLOW_HH
This diff is collapsed.
......@@ -2,12 +2,12 @@
/// @file
/// @brief
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_FLOW_CACHE_HH
#define EXSEISDAT_FLOW_CACHE_HH
#ifndef EXSEISDAT_FLOW_DETAIL_CACHE_HH
#define EXSEISDAT_FLOW_DETAIL_CACHE_HH
#include "exseisdat/flow/CacheElem.hh"
#include "exseisdat/flow/FileDesc.hh"
#include "exseisdat/flow/TraceBlock.hh"
#include "exseisdat/flow/detail/Cache_elem.hh"
#include "exseisdat/flow/detail/File_descriptor.hh"
#include "exseisdat/flow/detail/Trace_block.hh"
#include <algorithm>
#include <deque>
......@@ -21,11 +21,11 @@ namespace detail {
class Cache {
public:
/// Typedef for passing in a list of FileDesc objects.
typedef std::deque<std::shared_ptr<FileDesc>> FileDeque;
typedef std::deque<std::shared_ptr<File_descriptor>> FileDeque;
private:
/// A vector of cache elements
std::vector<CacheElem> m_cache;
std::vector<Cache_elem> m_cache;
/// The PIOL object
std::shared_ptr<exseis::piol::ExSeisPIOL> m_piol;
......@@ -44,7 +44,7 @@ class Cache {
* @param[in] c_trc if True, get the traces.
* @return Return a block with the traces and/or parameters.
*/
std::shared_ptr<TraceBlock> get_cache(
std::shared_ptr<Trace_block> get_cache(
std::shared_ptr<exseis::piol::Rule> rule,
FileDeque& desc,
bool c_prm,
......@@ -56,7 +56,7 @@ class Cache {
* @param[in] desc A deque of unique pointers to file descriptors.
* @return Return a block with the parameters.
*/
std::shared_ptr<TraceBlock> cache_prm(
std::shared_ptr<Trace_block> cache_prm(
std::shared_ptr<exseis::piol::Rule> rule, FileDeque& desc)
{
return get_cache(rule, desc, true, false);
......@@ -67,7 +67,7 @@ class Cache {
* @param[in] desc A deque of unique pointers to file descriptors.
* @return Return a block with the traces.
*/
std::shared_ptr<TraceBlock> cache_trc(FileDeque& desc)
std::shared_ptr<Trace_block> cache_trc(FileDeque& desc)
{
return get_cache(nullptr, desc, false, true);
}
......@@ -80,7 +80,7 @@ class Cache {
{
auto it = std::find_if(
m_cache.begin(), m_cache.end(),
[desc](const CacheElem& elem) -> bool {
[desc](const Cache_elem& elem) -> bool {
return elem.check_prm(desc);
});
return it != m_cache.end();
......@@ -94,7 +94,7 @@ class Cache {
{
auto it = std::find_if(
m_cache.begin(), m_cache.end(),
[desc](const CacheElem& elem) -> bool {
[desc](const Cache_elem& elem) -> bool {
return elem.check_trc(desc);
});
return it != m_cache.end();
......@@ -107,7 +107,7 @@ class Cache {
{
auto it = std::find_if(
m_cache.begin(), m_cache.end(),
[desc](const CacheElem& elem) -> bool {
[desc](const Cache_elem& elem) -> bool {
return elem.desc == desc;
});
m_cache.erase(it);
......@@ -131,4 +131,4 @@ class Cache {
} // namespace flow
} // namespace exseis
#endif // EXSEISDAT_FLOW_CACHE_HH
#endif // EXSEISDAT_FLOW_DETAIL_CACHE_HH
////////////////////////////////////////////////////////////////////////////////
/// @file
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_FLOW_CACHEELEM_HH
#define EXSEISDAT_FLOW_CACHEELEM_HH
#ifndef EXSEISDAT_FLOW_DETAIL_CACHE_ELEM_HH
#define EXSEISDAT_FLOW_DETAIL_CACHE_ELEM_HH
#include "exseisdat/flow/FileDesc.hh"
#include "exseisdat/flow/TraceBlock.hh"
#include "exseisdat/flow/detail/File_descriptor.hh"
#include "exseisdat/flow/detail/Trace_block.hh"
#include <deque>
#include <memory>
......@@ -18,22 +18,22 @@ namespace detail {
/*! A structure to store cache elements of traces and parameters corresponding
* to a collection of files
*/
struct CacheElem {
struct Cache_elem {
/// Typedef for passing in a list of FileDesc objects.
typedef std::deque<std::shared_ptr<FileDesc>> FileDeque;
typedef std::deque<std::shared_ptr<File_descriptor>> FileDeque;
/// A deque of unique pointers to file descriptors
FileDeque desc;
/// The cached data
std::shared_ptr<TraceBlock> block = std::make_shared<TraceBlock>();
std::shared_ptr<Trace_block> block = std::make_shared<Trace_block>();
/*! Construct the cache element with the given parameter structure.
* @param[in] desc A deque of unique pointers to file descriptors
* @param[in,out] prm A unique_ptr to the parameter structure. The cache
* element takes ownership.
*/
CacheElem(
Cache_elem(
FileDeque& desc, std::unique_ptr<exseis::piol::Trace_metadata> prm) :
desc(desc)
{
......@@ -46,7 +46,7 @@ struct CacheElem {
* @param[in,out] prm A unique_ptr to the parameter structure. The cache
* element takes ownership if it exists.
*/
CacheElem(
Cache_elem(
FileDeque& desc,
std::vector<exseis::utils::Trace_value>& trc,
std::unique_ptr<exseis::piol::Trace_metadata> prm = nullptr) :
......@@ -79,4 +79,4 @@ struct CacheElem {
} // namespace flow
} // namespace exseis
#endif // EXSEISDAT_FLOW_CACHEELEM_HH
#endif // EXSEISDAT_FLOW_DETAIL_CACHE_ELEM_HH
////////////////////////////////////////////////////////////////////////////////
/// @file
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_FLOW_FILEDESC_HH
#define EXSEISDAT_FLOW_FILEDESC_HH
#ifndef EXSEISDAT_FLOW_DETAIL_FILE_DESCRIPTOR_HH
#define EXSEISDAT_FLOW_DETAIL_FILE_DESCRIPTOR_HH
#include "exseisdat/piol/ReadInterface.hh"
#include "exseisdat/piol/file/Input_file.hh"
#include <cstddef>
#include <memory>
......@@ -17,9 +17,9 @@ namespace detail {
/*! A file-descriptor structure which describes an input file and the
* decomposition for the set layer
*/
struct FileDesc {
struct File_descriptor {
/// The file interface
std::unique_ptr<exseis::piol::ReadInterface> ifc;
std::unique_ptr<exseis::piol::Input_file> ifc;
/// The size of this corresponds to the local decomposition
std::vector<size_t> ilst;
......@@ -32,4 +32,4 @@ struct FileDesc {
} // namespace flow
} // namespace exseis
#endif // EXSEISDAT_FLOW_FILEDESC_HH
#endif // EXSEISDAT_FLOW_DETAIL_FILE_DESCRIPTOR_HH
////////////////////////////////////////////////////////////////////////////////
/// @file
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_FLOW_FUNCOPT_HH
#define EXSEISDAT_FLOW_FUNCOPT_HH
#ifndef EXSEISDAT_FLOW_DETAIL_FUNCTION_OPTIONS_HH
#define EXSEISDAT_FLOW_DETAIL_FUNCTION_OPTIONS_HH
#include <cstddef>
......@@ -12,7 +12,7 @@ namespace detail {
/*! Enum class for the various function options.
*/
enum class FuncOpt : size_t {
enum class Function_options : size_t {
// Data type dependencies
/// Metadata required to be read.
......@@ -77,4 +77,4 @@ enum class FuncOpt : size_t {
} // namespace flow
} // namespace exseis
#endif // EXSEISDAT_FLOW_FUNCOPT_HH
#endif // EXSEISDAT_FLOW_DETAIL_FUNCTION_OPTIONS_HH
////////////////////////////////////////////////////////////////////////////////
/// @file
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_FLOW_GATHERSTATE_HH
#define EXSEISDAT_FLOW_GATHERSTATE_HH
#ifndef EXSEISDAT_FLOW_DETAIL_GATHER_STATE_HH
#define EXSEISDAT_FLOW_DETAIL_GATHER_STATE_HH
#include "exseisdat/piol/operations/gather.hh"
#include "exseisdat/utils/Distributed_vector.hh"
#include "exseisdat/utils/distributed_vector/Distributed_vector.hh"
#include <cstddef>
#include <vector>
......@@ -16,9 +16,9 @@ namespace detail {
/*! A parent class to allow gather operations to maintain a state.
*/
struct GatherState {
struct Gather_state {
/// Virtual destructor
virtual ~GatherState() = default;
virtual ~Gather_state() = default;
/*! A virtual function which can be overridden to create the
* gather-operation state.
......@@ -36,4 +36,4 @@ struct GatherState {
} // namespace flow
} // namespace exseis
#endif // EXSEISDAT_FLOW_GATHERSTATE_HH
#endif // EXSEISDAT_FLOW_DETAIL_GATHER_STATE_HH
////////////////////////////////////////////////////////////////////////////////
/// @file
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_FLOW_OP_HH
#define EXSEISDAT_FLOW_OP_HH
#ifndef EXSEISDAT_FLOW_DETAIL_OPERATION_HH
#define EXSEISDAT_FLOW_DETAIL_OPERATION_HH
#include "exseisdat/flow/OpParent.hh"
#include "exseisdat/flow/detail/Operation_parent.hh"
#include "exseisdat/flow/GatherState.hh"
#include "exseisdat/flow/OpOpt.hh"
#include "exseisdat/piol/Rule.hh"
#include "exseisdat/flow/detail/Gather_state.hh"
#include "exseisdat/flow/detail/Operation_options.hh"
#include "exseisdat/piol/metadata/rules/Rule.hh"
#include <memory>
......@@ -19,7 +19,7 @@ namespace detail {
/*! Template for creating a structure for a particular operation type.
*/
template<typename T>
struct Op : public OpParent {
struct Operation : public Operation_parent {
/// The particular std::function object for the operaton
T func;
......@@ -29,11 +29,12 @@ struct Op : public OpParent {
* @param[in] state Gather state object if applicable.
* @param[in] func The particular std::function implementation.
*/
Op(OpOpt& opt,
std::shared_ptr<exseis::piol::Rule> rule,
std::shared_ptr<GatherState> state,
T func) :
OpParent(opt, rule, state),
Operation(
Operation_options& opt,
std::shared_ptr<exseis::piol::Rule> rule,
std::shared_ptr<Gather_state> state,
T func) :
Operation_parent(opt, rule, state),
func(func)
{
}
......@@ -43,4 +44,4 @@ struct Op : public OpParent {
} // namespace flow
} // namespace exseis
#endif // EXSEISDAT_FLOW_OP_HH
#endif // EXSEISDAT_FLOW_DETAIL_OPERATION_HH
////////////////////////////////////////////////////////////////////////////////
/// @file
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_FLOW_OPOPT_HH
#define EXSEISDAT_FLOW_OPOPT_HH
#ifndef EXSEISDAT_FLOW_DETAIL_OPERATION_OPTIONS_HH
#define EXSEISDAT_FLOW_DETAIL_OPERATION_OPTIONS_HH
#include "exseisdat/flow/FuncOpt.hh"
#include "exseisdat/flow/detail/Function_options.hh"
#include <algorithm>
#include <initializer_list>
......@@ -16,26 +16,29 @@ namespace detail {
/*! A structure to hold operation options.
*/
class OpOpt {
class Operation_options {
private:
/// A list of the function options.
std::vector<FuncOpt> m_option_list;
std::vector<Function_options> m_option_list;
public:
/*! Empty constructor.
*/
OpOpt() {}
Operation_options() {}
/*! Initialise the options list with an initialiser list.
* @param[in] list An initialiser list of options.
*/
OpOpt(std::initializer_list<FuncOpt> list) : m_option_list(list) {}
Operation_options(std::initializer_list<Function_options> list) :
m_option_list(list)
{
}
/*! Check if an option is present in the list.
* @param[in] opt The function option.
* @return Return true if the option is present in the list.
*/
bool check(FuncOpt opt)
bool check(Function_options opt)
{
auto it = std::find(m_option_list.begin(), m_option_list.end(), opt);
return it != m_option_list.end();
......@@ -44,11 +47,11 @@ class OpOpt {
/*! Add an option to the list.
* @param[in] opt The function option.
*/
void add(FuncOpt opt) { m_option_list.push_back(opt); }
void add(Function_options opt) { m_option_list.push_back(opt); }
};
} // namespace detail
} // namespace flow
} // namespace exseis
#endif // EXSEISDAT_FLOW_OPOPT_HH
#endif // EXSEISDAT_FLOW_DETAIL_OPERATION_OPTIONS_HH
////////////////////////////////////////////////////////////////////////////////
/// @file
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_FLOW_OPPARENT_HH
#define EXSEISDAT_FLOW_OPPARENT_HH
#ifndef EXSEISDAT_FLOW_DETAIL_OPERATION_PARENT_HH
#define EXSEISDAT_FLOW_DETAIL_OPERATION_PARENT_HH
#include "exseisdat/flow/GatherState.hh"
#include "exseisdat/flow/OpOpt.hh"
#include "exseisdat/piol/Rule.hh"
#include "exseisdat/flow/detail/Gather_state.hh"
#include "exseisdat/flow/detail/Operation_options.hh"
#include "exseisdat/piol/metadata/rules/Rule.hh"
#include <memory>
......@@ -16,25 +16,25 @@ namespace detail {
/*! Operations parents. Specific classes of operations inherit from this parent
*/
struct OpParent {
struct Operation_parent {
/// Operation options.
OpOpt opt;
Operation_options opt;
/// Relevant parameter rules for the operation.
std::shared_ptr<exseis::piol::Rule> rule;
/// Gather state if applicable.
std::shared_ptr<GatherState> state;
std::shared_ptr<Gather_state> state;
/*! Construct.
* @param[in] opt Operation options.
* @param[in] rule Rules parameter rules for the operation
* @param[in] state Gather state object if applicable.
*/
OpParent(
OpOpt& opt,
Operation_parent(
Operation_options& opt,
std::shared_ptr<exseis::piol::Rule> rule,
std::shared_ptr<GatherState> state) :
std::shared_ptr<Gather_state> state) :
opt(opt),
rule(rule),
state(state)
......@@ -43,11 +43,11 @@ struct OpParent {
/*! Virtual destructor for unique_ptr polymorphism.
*/
virtual ~OpParent() = default;
virtual ~Operation_parent() = default;
};
} // namespace detail
} // namespace flow
} // namespace exseis
#endif // EXSEISDAT_FLOW_OPPARENT_HH
#endif // EXSEISDAT_FLOW_DETAIL_OPERATION_PARENT_HH
////////////////////////////////////////////////////////////////////////////////
/// @file
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_FLOW_RADONGATHERSTATE_HH
#define EXSEISDAT_FLOW_RADONGATHERSTATE_HH
#ifndef EXSEISDAT_FLOW_DETAIL_RADON_GATHER_STATE_HH
#define EXSEISDAT_FLOW_DETAIL_RADON_GATHER_STATE_HH
#include "exseisdat/flow/GatherState.hh"
#include "exseisdat/flow/detail/Gather_state.hh"
#include "exseisdat/piol/ExSeisPIOL.hh"
#include "exseisdat/piol/configuration/ExSeisPIOL.hh"
#include "exseisdat/piol/operations/gather.hh"
#include "exseisdat/utils/Distributed_vector.hh"
#include "exseisdat/utils/typedefs.hh"
#include "exseisdat/utils/distributed_vector/Distributed_vector.hh"
#include "exseisdat/utils/types/typedefs.hh"
#include <cstddef>
#include <memory>
......@@ -20,11 +20,11 @@ namespace exseis {
namespace flow {
namespace detail {
using namespace exseis::utils::typedefs;
using namespace exseis::utils::types;
/*! The radon state structure.
*/
struct RadonGatherState : public GatherState {
struct Radon_gather_state : public Gather_state {
/// The piol object.
std::shared_ptr<exseis::piol::ExSeisPIOL> piol;
......@@ -62,7 +62,7 @@ struct RadonGatherState : public GatherState {
* @param[in] output_traces_per_gather The number of traces in the angle output.
* @param[in] output_sample_interval The number of increments.
*/
RadonGatherState(
Radon_gather_state(
std::shared_ptr<exseis::piol::ExSeisPIOL> piol,
std::string vmname,
const size_t v_bin,
......@@ -88,4 +88,4 @@ struct RadonGatherState : public GatherState {
} // namespace flow
} // namespace exseis
#endif // EXSEISDAT_FLOW_RADONGATHERSTATE_HH
#endif // EXSEISDAT_FLOW_DETAIL_RADON_GATHER_STATE_HH
////////////////////////////////////////////////////////////////////////////////
/// @file
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_FLOW_TRACEBLOCK_HH
#define EXSEISDAT_FLOW_TRACEBLOCK_HH
#ifndef EXSEISDAT_FLOW_DETAIL_TRACE_BLOCK_HH
#define EXSEISDAT_FLOW_DETAIL_TRACE_BLOCK_HH
#include "exseisdat/piol/Trace_metadata.hh"
#include "exseisdat/utils/typedefs.hh"
#include "exseisdat/piol/metadata/Trace_metadata.hh"
#include "exseisdat/utils/types/typedefs.hh"
#include <cstddef>
#include <memory>
......@@ -15,11 +15,11 @@ namespace exseis {
namespace flow {
namespace detail {
using namespace exseis::utils::typedefs;
using namespace exseis::utils::types;
/*! The structure for holding all trace data.
*/
struct TraceBlock {
struct Trace_block {
/// Number of traces
size_t nt;
......@@ -46,4 +46,4 @@ struct TraceBlock {
} // namespace flow
} // namespace exseis
#endif // EXSEISDAT_FLOW_TRACEBLOCK_HH
#endif // EXSEISDAT_FLOW_DETAIL_TRACE_BLOCK_HH
This diff is collapsed.
......@@ -5,43 +5,43 @@
#ifndef EXSEISDAT_PIOL_HH
#define EXSEISDAT_PIOL_HH
#include "exseisdat/piol/Binary_file.hh"
#include "exseisdat/piol/CommunicatorInterface.hh"
#include "exseisdat/piol/CommunicatorMPI.hh"
#include "exseisdat/piol/ExSeis.hh"
#include "exseisdat/piol/ExSeisPIOL.hh"
#include "exseisdat/piol/Meta.hh"
#include "exseisdat/piol/Model3dInterface.hh"
#include "exseisdat/piol/ObjectInterface.hh"
#include "exseisdat/piol/ObjectSEGY.hh"
#include "exseisdat/piol/ReadInterface.hh"
#include "exseisdat/piol/ReadSEGY.hh"
#include "exseisdat/piol/ReadSEGYModel.hh"
#include "exseisdat/piol/Rule.hh"
#include "exseisdat/piol/RuleEntry.hh"
#include "exseisdat/piol/SEGYRuleEntry.hh"
#include "exseisdat/piol/Tr.hh"
#include "exseisdat/piol/Trace_metadata.hh"
#include "exseisdat/piol/WriteInterface.hh"
#include "exseisdat/piol/WriteSEGY.hh"
#include "exseisdat/piol/configuration/ExSeis.hh"
#include "exseisdat/piol/configuration/ExSeisPIOL.hh"
#include "exseisdat/piol/file/Input_file.hh"
#include "exseisdat/piol/file/Input_file_segy.hh"
#include "exseisdat/piol/file/Output_file.hh"
#include "exseisdat/piol/file/Output_file_segy.hh"
#include "exseisdat/piol/file/detail/Model3dInterface.hh"
#include "exseisdat/piol/file/detail/ObjectInterface.hh"
#include "exseisdat/piol/file/detail/ObjectSEGY.hh"
#include "exseisdat/piol/file/detail/ReadSEGYModel.hh"
#include "exseisdat/piol/io_driver/IO_driver.hh"
#include "exseisdat/piol/io_driver/IO_driver_mpi.hh"
#include "exseisdat/piol/makeFile.hh"
#include "exseisdat/piol/mpi/MPI_Binary_file.hh"
#include "exseisdat/piol/operations/SortType.hh"
#include "exseisdat/piol/metadata/Trace_metadata.hh"
#include "exseisdat/piol/metadata/Trace_metadata_key.hh"
#include "exseisdat/piol/metadata/rules/Rule.hh"
#include "exseisdat/piol/metadata/rules/Rule_entry.hh"
#include "exseisdat/piol/metadata/rules/Segy_rule_entry.hh"
#include "exseisdat/piol/operations/gather.hh"
#include "exseisdat/piol/operations/minmax.hh"
#include "exseisdat/piol/operations/sort.hh"
#include "exseisdat/piol/operations/temporalfilter.hh"
#include "exseisdat/piol/operations/sort_operations/Sort_type.hh"
#include "exseisdat/piol/operations/sort_operations/sort.hh"
#include "exseisdat/piol/segy/Trace_header_offsets.hh"
#include "exseisdat/piol/segy/utils.hh"
#include "exseisdat/utils/Distributed_vector.hh"
#include "exseisdat/utils/communicator/Communicator.hh"
#include "exseisdat/utils/communicator/Communicator_mpi.hh"
#include "exseisdat/utils/decomposition/block_decomposition.hh"
#include "exseisdat/utils/distributed_vector/Distributed_vector.hh"
#include "exseisdat/utils/encoding/character_encoding.hh"
#include "exseisdat/utils/encoding/number_encoding.hh"
#include "exseisdat/utils/logging/Log.hh"
#include "exseisdat/utils/logging/Verbosity.hh"
#include "exseisdat/utils/mpi/MPI_error_to_string.hh"
#include "exseisdat/utils/mpi_utils/MPI_error_to_string.hh"
#include "exseisdat/utils/signal_processing/AGC.hh"
#include "exseisdat/utils/signal_processing/mute.hh"
#include "exseisdat/utils/signal_processing/taper.hh"
#include "exseisdat/utils/typedefs.hh"
#include "exseisdat/utils/signal_processing/temporalfilter.hh"
#include "exseisdat/utils/types/typedefs.hh"
#endif // EXSEISDAT_PIOL_HH
////////////////////////////////////////////////////////////////////////////////
/// @file
/// @brief Instances of the \c RuleEntry class necessary for reading/writing
/// SEGY trace parameters.
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_PIOL_SEGYRULEENTRY_HH
#define EXSEISDAT_PIOL_SEGYRULEENTRY_HH
#include "exseisdat/piol/RuleEntry.hh"
#include "exseisdat/piol/segy/utils.hh"
#include <algorithm>
namespace exseis {
namespace piol {
/*! The Long rule entry structure for the SEG-Y format.
*/
struct SEGYLongRuleEntry : public RuleEntry {
/*! The constructor.
* @param[in] loc The location of the primary data
*/
SEGYLongRuleEntry(Tr loc) : RuleEntry(size_t(loc)) {}
/*! Return the minimum location stored, i.e loc just loc
* @return the minimum location
*/
size_t min() const override { return loc; }
/*! Return the maximum location stored up to, including the size of the data
* stored
* @return the maximum location plus 4 bytes to store an int32_t
*/
size_t max() const override { return loc + 4U; }
/*! Return the datatype associated with the entry.
* @return \c MdType::Long
*/
MdType type() const override { return MdType::Long; }
/// @copydoc RuleEntry::clone
std::unique_ptr<RuleEntry> clone() const override
{
return std::make_unique<SEGYLongRuleEntry>(static_cast<Tr>(loc));
}
/// @copydoc RuleEntry::memory_usage()
size_t memory_usage() const override { return sizeof *this; }
};
/*! The Copy rule entry structure for the SEG-Y format.
*/
struct SEGYCopyRuleEntry : public RuleEntry {
/*! The constructor (empty).
*/
SEGYCopyRuleEntry() : RuleEntry(0U) {}
/*! Return the minimum location stored, i.e 0
* @return 0U
*/
size_t min() const override { return 0U; }
/*! Return the size of the trace header
* @return the size of the trace header
*/
size_t max() const override { return segy::segy_trace_header_size(); }
/*! Return the datatype associated with the entry.
* @return \c MdType::Copy
*/
MdType type() const override { return MdType::Copy; }
/// @copydoc RuleEntry::clone
std::unique_ptr<RuleEntry> clone() const override
{
return std::make_unique<SEGYCopyRuleEntry>();
}
/// @copydoc RuleEntry::memory_usage()
size_t memory_usage() const override { return sizeof *this; }
};
/*! The Index rule entry structure. For indexing without modifying what
* will be stored.
*/
struct SEGYIndexRuleEntry : public RuleEntry {
/*! The constructor.
*/
SEGYIndexRuleEntry() : RuleEntry(0U) {}
/*! Return 0. nothing stored
* @return Return 0
*/
size_t min() const override { return 0; }
/*! Return 0. nothing stored
* @return Return 0
*/
size_t max() const override { return 0; }
/*! Return the datatype associated with the entry.
* @return \c MdType::Index
*/
MdType type() const override { return MdType::Index; }
/// @copydoc RuleEntry::clone
std::unique_ptr<RuleEntry> clone() const override
{
return std::make_unique<SEGYIndexRuleEntry>();
}
/// @copydoc RuleEntry::memory_usage()
size_t memory_usage() const override { return sizeof *this; }
};
/*! The Short rule entry structure for the SEG-Y format.
*/
struct SEGYShortRuleEntry : public RuleEntry {
/*! The constructor.
* @param[in] loc The location of the primary data
*/
SEGYShortRuleEntry(Tr loc) : RuleEntry(size_t(loc)) {}
/*! Return the minimum location stored, i.e loc
* @return the minimum location
*/
size_t min() const override { return loc; }
/*! Return the maximum location stored up to, including the size of the data
* stored
* @return the maximum location plus 2 bytes to store an int16_t
*/
size_t max() const override { return loc + 2U; }
/*! Return the datatype associated with the entry.
* @return \c MdType::Short
*/
MdType type() const override { return MdType::Short; }
/// @copydoc RuleEntry::clone
std::unique_ptr<RuleEntry> clone() const override
{
return std::make_unique<SEGYShortRuleEntry>(static_cast<Tr>(loc));
}
/// @copydoc RuleEntry::memory_usage()
size_t memory_usage() const override { return sizeof *this; }
};
/*! The Float rule entry structure for the SEG-Y format.
*/
struct SEGYFloatRuleEntry : public RuleEntry {
/// The location of the scaler field.
size_t scalar_location;
/*! The constructor.
* @param[in] loc The location of the primary data
* @param[in] scalar_location The location of the scaler field.
*/
SEGYFloatRuleEntry(Tr loc, Tr scalar_location) :
RuleEntry(size_t(loc)),
scalar_location(size_t(scalar_location))
{
}
/*! Return the minimum location stored
* @return the minimum location
*/
size_t min() const override { return std::min(scalar_location, loc); }
/*! Return the maximum location stored up to, including the size of the data
* stored
* @return the maximum location. If the scaler is in a location higher than
* the the primary data store then the location + 2U is returned,
* otherwise the primary location + 4U is returned.
*/
size_t max() const override
{
return std::max(scalar_location + 2U, loc + 4U);
}
/*! Return the datatype associated with the entry.
* @return \c MdType::Float
*/
MdType type() const override { return MdType::Float; }
/// @copydoc RuleEntry::clone
std::unique_ptr<RuleEntry> clone() const override
{
return std::make_unique<SEGYFloatRuleEntry>(
static_cast<Tr>(loc), static_cast<Tr>(scalar_location));
}
/// @copydoc RuleEntry::memory_usage()
size_t memory_usage() const override { return sizeof *this; }
};
} // namespace piol
} // namespace exseis
#endif // EXSEISDAT_PIOL_SEGYRULEENTRY_HH
......@@ -3,26 +3,30 @@
/// @brief
/// @details The \c ExSeis class
////////////////////////////////////////////////////////////////////////////////
#ifndef EXSEISDAT_PIOL_EXSEIS_HH
#define EXSEISDAT_PIOL_EXSEIS_HH