Skip to content
Commits on Source (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
......@@ -5,16 +5,16 @@
#ifndef EXSEISDAT_FLOW_SET_HH
#define EXSEISDAT_FLOW_SET_HH
#include "exseisdat/flow/Cache.hh"
#include "exseisdat/flow/FileDesc.hh"
#include "exseisdat/flow/OpParent.hh"
#include "exseisdat/flow/detail/Cache.hh"
#include "exseisdat/flow/detail/File_descriptor.hh"
#include "exseisdat/flow/detail/Operation_parent.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.hh"
#include "exseisdat/utils/signal_processing/Gain_function.hh"
#include "exseisdat/utils/signal_processing/mute.hh"
#include "exseisdat/utils/signal_processing/taper.hh"
#include "exseisdat/utils/signal_processing/temporalfilter.hh"
#include <deque>
#include <list>
......@@ -26,17 +26,17 @@
namespace exseis {
namespace flow {
using namespace exseis::utils::typedefs;
using namespace exseis::utils::types;
/*! The internal set class
/*! @brief The internal set class
*/
class Set {
public:
/// Typedef for passing in a list of FileDesc objects.
typedef std::deque<std::shared_ptr<detail::FileDesc>> FileDeque;
/// @brief Typedef for passing in a list of FileDesc objects.
typedef std::deque<std::shared_ptr<detail::File_descriptor>> FileDeque;
/// The function list type for the set layer
typedef std::list<std::shared_ptr<detail::OpParent>> FuncLst;
/// @brief The function list type for the set layer
typedef std::list<std::shared_ptr<detail::Operation_parent>> FuncLst;
protected:
/// The PIOL object.
......@@ -74,7 +74,7 @@ class Set {
/// The number of ranks
size_t m_num_rank;
/*! Drop all file descriptors without output.
/*! @brief Drop all file descriptors without output.
*/
void drop()
{
......@@ -83,8 +83,9 @@ class Set {
m_offmap.clear();
}
/*! Start unwinding the function list for subset-only operations based on
* the given iterators.
/*! @brief Start unwinding the function list for subset-only operations
* based on the given iterators.
*
* @param[in] f_curr The iterator for the current function to process.
* @param[in] f_end The iterator which indicates the end of the list has
* been reached.
......@@ -93,8 +94,9 @@ class Set {
FuncLst::iterator start_subset(
FuncLst::iterator f_curr, FuncLst::iterator f_end);
/*! Start unwinding the function list for gather operations on the given
* iterators.
/*! @brief Start unwinding the function list for gather operations on the
* given iterators.
*
* @param[in] f_curr The iterator for the current function to process.
* @param[in] f_end The iterator which indicates the end of the list has
* been reached.
......@@ -103,8 +105,9 @@ class Set {
*/
std::string start_gather(FuncLst::iterator f_curr, FuncLst::iterator f_end);
/*! Start unwinding the function list for single-trace operations on the
* given iterators.
/*! @brief Start unwinding the function list for single-trace operations on
* the given iterators.
*
* @param[in] f_curr The iterator for the current function to process.
* @param[in] f_end The iterator which indicates the end of the list has
* been reached.
......@@ -114,7 +117,8 @@ class Set {
std::vector<std::string> start_single(
FuncLst::iterator f_curr, FuncLst::iterator f_end);
/*! The entry point for unwinding the function list for all use-cases.
/*! @brief The entry point for unwinding the function list for all
* use-cases.
* @param[in] f_curr The iterator for the current function to process.
* @param[in] f_end The iterator which indicates the end of the list has
* been reached.
......@@ -123,8 +127,9 @@ class Set {
std::vector<std::string> calc_func(
FuncLst::iterator f_curr, FuncLst::iterator f_end);
/*! The entry point for unwinding the function list for single-traces and
* gathers only.
/*! @brief The entry point for unwinding the function list for single-traces
* and gathers only.
*
* @param[in] f_curr The iterator for the current function to process.
* @param[in] f_end The iterator which indicates the end of the list has
* been reached.
......@@ -137,13 +142,14 @@ class Set {
*
* Transitions from gather to single trace are allowed but not the inverse.
*/
std::unique_ptr<detail::TraceBlock> calc_func(
std::unique_ptr<detail::Trace_block> calc_func(
FuncLst::iterator f_curr,
FuncLst::iterator f_end,
detail::FuncOpt type,
std::unique_ptr<detail::TraceBlock> b_in);
detail::Function_options type,
std::unique_ptr<detail::Trace_block> b_in);
/*! The entry point for unwinding the function list for subsets.
/*! @brief The entry point for unwinding the function list for subsets.
*
* @param[in] f_curr The iterator for the current function to process.
* @param[in] f_end The iterator which indicates the end of the list has
* been reached.
......@@ -154,7 +160,8 @@ class Set {
FuncLst::iterator f_curr, FuncLst::iterator f_end, FileDeque& f_que);
public:
/*! Constructor
/*! @brief Constructor
*
* @param[in] piol The PIOL object.
* @param[in] pattern The file-matching pattern
* @param[in] outfix The output file-name prefix
......@@ -166,9 +173,11 @@ class Set {
std::string outfix,
std::shared_ptr<exseis::piol::Rule> rule =
std::make_shared<exseis::piol::Rule>(
std::initializer_list<exseis::piol::Meta>{piol::Meta::Copy}));
std::initializer_list<exseis::piol::Trace_metadata_key>{
piol::Trace_metadata_key::Copy}));
/*! Constructor
/*! @brief Constructor
*
* @param[in] piol The PIOL object.
* @param[in] pattern The file-matching pattern
* @param[in] rule Contains a pointer to the rules to use for trace
......@@ -178,12 +187,14 @@ class Set {
std::string pattern,
std::shared_ptr<exseis::piol::Rule> rule =
std::make_shared<exseis::piol::Rule>(
std::initializer_list<exseis::piol::Meta>{piol::Meta::Copy})) :
std::initializer_list<exseis::piol::Trace_metadata_key>{
piol::Trace_metadata_key::Copy})) :
Set(piol, pattern, "", rule)
{
}
/*! Constructor overload
/*! @brief Constructor overload
*
* @param[in] piol The PIOL object.
* @param[in] rule Contains a pointer to the rules to use for trace
* parameters.
......@@ -191,18 +202,21 @@ class Set {
Set(std::shared_ptr<exseis::piol::ExSeisPIOL> piol,
std::shared_ptr<exseis::piol::Rule> rule =
std::make_shared<exseis::piol::Rule>(
std::initializer_list<exseis::piol::Meta>{piol::Meta::Copy}));
std::initializer_list<exseis::piol::Trace_metadata_key>{
piol::Trace_metadata_key::Copy}));
/*! Destructor
/*! @brief Destructor
*/
~Set();
/*! Sort the set using the given comparison function
/*! @brief Sort the set using the given comparison function
*
* @param[in] sort_func The comparison function
*/
void sort(exseis::piol::CompareP sort_func);
/*! Sort the set using the given comparison function
/*! @brief Sort the set using the given comparison function
*
* @param[in] r The rules necessary for the sort.
* @param[in] sort_func The comparison function.
*/
......@@ -210,20 +224,23 @@ class Set {
std::shared_ptr<exseis::piol::Rule> r,
exseis::piol::CompareP sort_func);
/*! Output using the given output prefix
/*! @brief Output using the given output prefix
*
* @param[in] oname The output prefix
* @return Return a vector of the actual output names.
*/
std::vector<std::string> output(std::string oname);
/*! Output using the output prefix stored as member variable
/*! @brief Output using the output prefix stored as member variable
*
* @return Return a vector of the actual output names.
*/
void output();
/*! Find the min and max of two given parameters (e.g x and y source
* coordinates) and return the associated values and trace numbers in the
* given structure
/*! @brief Find the min and max of two given parameters (e.g x and y source
* coordinates) and return the associated values and trace numbers
* int the given structure
*
* @param[in] xlam The function for returning the first parameter
* @param[in] ylam The function for returning the second parameter
* @param[out] minmax The array of structures to hold the ouput
......@@ -233,8 +250,9 @@ class Set {
exseis::piol::MinMaxFunc<exseis::piol::Trace_metadata> ylam,
exseis::piol::CoordElem* minmax);
/*! Function to add to modify function that applies a 2 tailed taper to a
* set of traces
/*! @brief Function to add to modify function that applies a 2 tailed taper
* to a set of traces
*
* @param[in] taper_function Weight function for the taper ramp
* @param[in] taper_size_at_begin Length of taper at beginning of trace
* @param[in] taper_size_at_end Length of taper at end of trace
......@@ -244,8 +262,9 @@ class Set {
size_t taper_size_at_begin,
size_t taper_size_at_end = 0);
/*! Function to modify function that applies both a mute region at the
* start and end of a series of traces and a 2 tailed taper
/*! @brief Function to modify function that applies both a mute region at
* the start and end of a series of traces and a 2 tailed taper
*
* @param[in] taper_function Weight function for the taper ramp
* @param[in] taper_size_at_begin Length of taper at beginning of trace
* @param[in] taper_size_at_end Length of taper at end of trace
......@@ -260,8 +279,9 @@ class Set {
size_t taper_size_at_end,
size_t mute_size_at_end);
/*! Function to add to modify function that applies automatic gain control
* to a set of traces
/*! @brief Function to add to modify function that applies automatic gain
* control to a set of traces
*
* @param[in] agc_func Staistical function used to scale traces
* @param[in] window Length of the agc window
* @param[in] target_amplitude Value to which traces are normalized
......@@ -271,28 +291,32 @@ class Set {
size_t window,
exseis::utils::Trace_value target_amplitude);
/*! Set the text-header of the output
/*! @brief Set the text-header of the output
*
* @param[in] outmsg The output message
*/
void text(std::string outmsg);
/*! Summarise the current status by whatever means the PIOL intrinsically
* supports
/*! @brief Summarise the current status by whatever means the PIOL
* intrinsically supports
*/
void summary() const;
/*! Add a file to the set based on the ReadInterface
/*! @brief Add a file to the set based on the ReadInterface
*
* @param[in] in The file interface
*/
void add(std::unique_ptr<exseis::piol::ReadInterface> in);
void add(std::unique_ptr<exseis::piol::Input_file> in);
/*! Add a file to the set based on the pattern/name given
/*! @brief Add a file to the set based on the pattern/name given
*
* @param[in] name The input name or pattern
*/
void add(std::string name);
/*! Perform the radon to angle conversion. This assumes the input set is a
* radon transform file.
/*! @brief Perform the radon to angle conversion. This assumes the input set
* is a radon transform file.
*
* @param[in] vm_name The name of the velocity model file.
* @param[in] v_bin The velocity model bin value.
* @param[in] output_traces_per_gather The number of traces in the output
......@@ -311,14 +335,21 @@ class Set {
* 4.0 / 180);
/******************************** Non-Core ********************************/
/*! Sort the set by the specified sort type.
/// @name Non-Core
/// @{
/*! @brief Sort the set by the specified sort type.
*
* @param[in] type The sort type
*/
void sort(exseis::piol::SortType type);
void sort(exseis::piol::Sort_type type);
/*! 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] m1 The first parameter type
* @param[in] m2 The second parameter type
* @param[out] minmax An array of structures containing the minimum
......@@ -326,12 +357,13 @@ class Set {
* item.y and their respective trace numbers.
*/
void get_min_max(
exseis::piol::Meta m1,
exseis::piol::Meta m2,
exseis::piol::Trace_metadata_key m1,
exseis::piol::Trace_metadata_key m2,
exseis::piol::CoordElem* minmax);
/*! Filter traces or part of traces using a IIR Butterworth filter
/*! @brief Filter traces or part of traces using a IIR Butterworth filter
*
* @param[in] type Type of filter (i.e. lowpass, highpass, bandpass)
* @param[in] domain Filtering domaini
* @param[in] pad Padding pattern
......@@ -341,15 +373,16 @@ class Set {
* @param[in] win_cntr Center of trace filtering window
*/
void temporal_filter(
exseis::piol::FltrType type,
exseis::piol::FltrDmn domain,
exseis::piol::PadType pad,
exseis::utils::FltrType type,
exseis::utils::FltrDmn domain,
exseis::utils::PadType pad,
exseis::utils::Trace_value fs,
std::vector<exseis::utils::Trace_value> corners,
size_t nw = 0U,
size_t win_cntr = 0U);
/*! Filter traces or part of traces using a IIR Butterworth filter
/*! @brief Filter traces or part of traces using a IIR Butterworth filter
*
* @param[in] type Type of filter (i.e. lowpass, highpass, bandpass)
* @param[in] domain Filtering domain
* @param[in] pad Padding pattern
......@@ -360,16 +393,17 @@ class Set {
* @param[in] win_cntr Center of trace filtering window
*/
void temporal_filter(
exseis::piol::FltrType type,
exseis::piol::FltrDmn domain,
exseis::piol::PadType pad,
exseis::utils::FltrType type,
exseis::utils::FltrDmn domain,
exseis::utils::PadType pad,
exseis::utils::Trace_value fs,
size_t n,
std::vector<exseis::utils::Trace_value> corners,
size_t nw = 0U,
size_t win_cntr = 0U);
/*! Filter traces or part of traces using a IIR Butterworth filter
/*! @brief Filter traces or part of traces using a IIR Butterworth filter
*
* @param[in] type Type of filter (i.e. lowpass, highpass, bandpass)
* @param[in] domain Filtering domain
* @param[in] pad Padding pattern
......@@ -380,9 +414,9 @@ class Set {
* @param[in] win_cntr Center of trace filtering window
*/
void temporal_filter(
exseis::piol::FltrType type,
exseis::piol::FltrDmn domain,
exseis::piol::PadType pad,
exseis::utils::FltrType type,
exseis::utils::FltrDmn domain,
exseis::utils::PadType pad,
exseis::utils::Trace_value fs,
size_t n,
exseis::utils::Trace_value corners,
......@@ -393,6 +427,8 @@ class Set {
type, domain, pad, fs, n,
std::vector<exseis::utils::Trace_value>{corners, 0}, nw, win_cntr);
}
/// @} Non-Core
};
} // namespace flow
......
......@@ -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