diff --git a/include/iact_data/acada_data_source.hpp b/include/iact_data/acada_data_source.hpp index d8f3288d..cc5d9382 100644 --- a/include/iact_data/acada_data_source.hpp +++ b/include/iact_data/acada_data_source.hpp @@ -154,6 +154,7 @@ CALIN_TYPEALIAS(ACADA_HeaderMessage_R1v0, ProtoR1::CameraConfiguration); CALIN_TYPEALIAS(ACADA_EventMessage_R1v1, R1v1::Event); CALIN_TYPEALIAS(ACADA_HeaderMessage_R1v1, R1v1::CameraConfiguration); +CALIN_TYPEALIAS(ACADA_DataStreamMessage_R1v1, R1v1::TelescopeDataStream); } } } // namespace calin::iact_data::zfits_actl_data_source diff --git a/include/iact_data/zfits_acada_data_source.hpp b/include/iact_data/zfits_acada_data_source.hpp index 6724d0c2..e97d9c4b 100644 --- a/include/iact_data/zfits_acada_data_source.hpp +++ b/include/iact_data/zfits_acada_data_source.hpp @@ -36,6 +36,29 @@ std::vector get_zfits_table_column_names(std::string filename, std: std::vector get_zfits_table_keys(std::string filename, std::string tablename); std::map get_zfits_table_key_values(std::string filename, std::string tablename); +template +class ZFITSSingleFileSingleMessageDataSource: + public virtual calin::io::data_source::RandomAccessDataSource +{ +public: + CALIN_TYPEALIAS(message_type, Message); + + ZFITSSingleFileSingleMessageDataSource(const std::string& filename, const std::string& tablename = {}); + virtual ~ZFITSSingleFileSingleMessageDataSource(); + + message_type* get_next(uint64_t& seq_index_out, + google::protobuf::Arena** arena = nullptr) override; + uint64_t size() override; + void set_next_index(uint64_t next_index) override; + +private: + std::string filename_; + std::string tablename_; + ADH::IO::ProtobufIFits* zfits_ = nullptr; + calin::ix::provenance::chronicle::FileIORecord* file_record_ = nullptr; + uint64_t next_message_index_ = 0; +}; + template class ZFITSSingleFileACADACameraEventDataSource: public calin::iact_data::acada_data_source:: diff --git a/src/iact_data/zfits_acada_data_source.cpp b/src/iact_data/zfits_acada_data_source.cpp index e0612e85..37dc5da2 100644 --- a/src/iact_data/zfits_acada_data_source.cpp +++ b/src/iact_data/zfits_acada_data_source.cpp @@ -59,6 +59,7 @@ namespace { template<> std::string default_message_table_name() { return "Events"; } template<> std::string default_message_table_name() { return "CameraConfiguration"; } template<> std::string default_message_table_name() { return "Events"; } + template<> std::string default_message_table_name() { return "DataStream"; } } // anonymous namespace std::vector calin::iact_data::zfits_acada_data_source:: @@ -135,6 +136,84 @@ get_zfits_table_key_values(std::string filename, std::string tablename) return key_values; } +// ============================================================================= +// ============================================================================= +// ============================================================================= +// +// ZFITSSingleFileSingleMessageDataSource - single ZFits file source of +// single message type (for debugging purposes) +// +// ============================================================================= +// ============================================================================= +// ============================================================================= + +template ZFITSSingleFileSingleMessageDataSource:: +ZFITSSingleFileSingleMessageDataSource( + const std::string& filename, const std::string& tablename): + calin::io::data_source::RandomAccessDataSource(), + filename_(expand_filename(filename)), + tablename_(tablename.empty() ? default_message_table_name() : tablename) +{ + if(!is_file(filename_)) + throw std::runtime_error(std::string("No such file: ")+filename_); + if(!is_readable(filename_)) + throw std::runtime_error(std::string("File not readable: ")+filename_); + + zfits_ = new ADH::IO::ProtobufIFits(filename_, tablename_, Message::descriptor()); + if(zfits_->eof() && !zfits_->bad()) + throw std::runtime_error("ZFits file " + filename_ + " has no table: " + tablename_); + + file_record_ = calin::provenance::chronicle::register_file_open(filename_, + calin::ix::provenance::chronicle::AT_READ, __PRETTY_FUNCTION__); +} + +template ZFITSSingleFileSingleMessageDataSource:: +~ZFITSSingleFileSingleMessageDataSource() +{ + delete zfits_; + calin::provenance::chronicle::register_file_close(file_record_); +} + +template Message* +ZFITSSingleFileSingleMessageDataSource::get_next(uint64_t& seq_index_out, + google::protobuf::Arena** arena) +{ + if(arena)*arena = nullptr; + + uint64_t max_seq_index = zfits_->getNumMessagesInTable(); + if(next_message_index_ >= max_seq_index)return nullptr; + + seq_index_out = next_message_index_; + const Message* message { + zfits_->borrowTypedMessage(++next_message_index_) }; + if(message == nullptr)throw std::runtime_error("ZFits reader returned NULL"); + + Message* message_copy = nullptr; + if(arena && *arena) + throw std::runtime_error("ZFITSSingleFileSingleMessageDataSource::get_next: " + " pre-allocated arena not supported."); // ADH library does not support arenas + + message_copy = new Message; + message_copy->CopyFrom(*message); + + zfits_->returnBorrowedMessage(message); + + return message_copy; +} + +template uint64_t +ZFITSSingleFileSingleMessageDataSource::size() +{ + return zfits_->getNumMessagesInTable(); +} + +template void +ZFITSSingleFileSingleMessageDataSource:: +set_next_index(uint64_t next_index) +{ + uint64_t max_seq_index = zfits_->getNumMessagesInTable(); + next_message_index_ = std::min(next_index, max_seq_index); +} // ============================================================================= // ============================================================================= @@ -574,14 +653,21 @@ ZFITSACADACameraEventDataSourceOpener::default_confi namespace calin { namespace iact_data { namespace zfits_acada_data_source { +template class ZFITSSingleFileSingleMessageDataSource; +template class ZFITSSingleFileSingleMessageDataSource; template class ZFITSSingleFileACADACameraEventDataSource; template class ZFITSACADACameraEventDataSource; template class ZFITSACADACameraEventDataSourceOpener; +template class ZFITSSingleFileSingleMessageDataSource; +template class ZFITSSingleFileSingleMessageDataSource; template class ZFITSSingleFileACADACameraEventDataSource; template class ZFITSACADACameraEventDataSource; template class ZFITSACADACameraEventDataSourceOpener; +template class ZFITSSingleFileSingleMessageDataSource; +template class ZFITSSingleFileSingleMessageDataSource; +template class ZFITSSingleFileSingleMessageDataSource; template class ZFITSSingleFileACADACameraEventDataSource; template class ZFITSACADACameraEventDataSource; template class ZFITSACADACameraEventDataSourceOpener; diff --git a/swig/iact_data/CMakeLists.txt b/swig/iact_data/CMakeLists.txt index e66d47ef..ac8d9c11 100644 --- a/swig/iact_data/CMakeLists.txt +++ b/swig/iact_data/CMakeLists.txt @@ -17,8 +17,7 @@ set(CALIN_SWIG_FILES algorithms.i # telescope_data_source.i event_visitor.i event_dispatcher.i instrument_layout.i nectarcam_layout.i lstcam_layout.i waveform_treatment_event_visitor.i nectarcam_ancillary_data.i - raw_acada_event_data_source_l0.i raw_acada_event_data_source_r1v0.i - raw_acada_event_data_source_r1v1.i) + raw_acada_event_data_source.i) set(CALIN_SWIG_TARGET iact_data) include_directories(${CTA_ADH_APIS_INCLUDE_DIRS}) diff --git a/swig/iact_data/raw_acada_event_data_source.i b/swig/iact_data/raw_acada_event_data_source.i new file mode 100644 index 00000000..63f19a2e --- /dev/null +++ b/swig/iact_data/raw_acada_event_data_source.i @@ -0,0 +1,449 @@ +/* + + calin/iact_data/raw_actl_r1_event_data_source.i -- Stephen Fegan -- 2024-09-09 + + SWIG interface file for calin.io.raw_acada_event_data_source + + Copyright 2024, Stephen Fegan + Laboratoire Leprince-Ringuet, CNRS/IN2P3, Ecole Polytechnique, Institut Polytechnique de Paris + + This file is part of "calin" + + "calin" is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License version 2 or + later, as published by the Free Software Foundation. + + "calin" is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +*/ + +%module (package="calin.iact_data") raw_acada_event_data_source +%feature(autodoc,2); + +%{ +#include +#include +#define SWIG_FILE_WITH_INIT + %} + +%init %{ + import_array(); +%} + +%include "calin_typemaps.i" +%include "calin_global_config.hpp" +%import "calin_global_definitions.i" + +%import "google_protobuf.i" +%import "io/data_source.i" +%import "iact_data/zfits_data_source.pb.i" + +%ignore get_next(uint64_t& seq_index_out); +%ignore get_next(uint64_t& seq_index_out, google::protobuf::Arena** arena); + +%newobject simple_get_next(); +%newobject get_run_header(); + +%include "io/chained_data_source.hpp" +%include "iact_data/acada_data_source.hpp" +%include "iact_data/zfits_acada_data_source.hpp" + +%apply uint64_t& OUTPUT { uint64_t& seq_index_out }; +%apply google::protobuf::Arena** CALIN_ARENA_OUTPUT { + google::protobuf::Arena** arena_out }; + +/* + + LLLLLLLLLLL 000000000 + L:::::::::L 00:::::::::00 + L:::::::::L 00:::::::::::::00 + LL:::::::LL 0:::::::000:::::::0 + L:::::L 0::::::0 0::::::0 + L:::::L 0:::::0 0:::::0 + L:::::L 0:::::0 0:::::0 + L:::::L 0:::::0 000 0:::::0 + L:::::L 0:::::0 000 0:::::0 + L:::::L 0:::::0 0:::::0 + L:::::L 0:::::0 0:::::0 + L:::::L LLLLLL 0::::::0 0::::::0 + LL:::::::LLLLLLLLL:::::L 0:::::::000:::::::0 + L::::::::::::::::::::::L 00:::::::::::::00 + L::::::::::::::::::::::L 00:::::::::00 + LLLLLLLLLLLLLLLLLLLLLLLL 000000000 + +*/ + +namespace calin::iact_data::acada_data_source { + class ACADA_EventMessage_L0: public google::protobuf::Message { }; + class ACADA_HeaderMessage_L0: public google::protobuf::Message { }; +} + +%typemap(in, numinputs=0) calin::iact_data::acada_data_source::ACADA_EventMessage_L0** CALIN_PROTOBUF_OUTPUT + (calin::iact_data::acada_data_source::ACADA_EventMessage_L0* temp = nullptr) { + // typemap(in) calin::iact_data::acada_data_source::ACADA_EventMessage_L0** CALIN_PROTOBUF_OUTPUT - raw_acada_event_data_source.i + $1 = &temp; +} + +%typemap(argout) calin::iact_data::acada_data_source::ACADA_EventMessage_L0** CALIN_PROTOBUF_OUTPUT { + // typemap(argout) calin::iact_data::acada_data_source::ACADA_EventMessage_L0** CALIN_PROTOBUF_OUTPUT - raw_acada_event_data_source.i + %append_output(SWIG_NewPointerObj(SWIG_as_voidptr(*$1), $*1_descriptor, SWIG_POINTER_OWN)); +} + +%apply calin::iact_data::acada_data_source::ACADA_EventMessage_L0** CALIN_PROTOBUF_OUTPUT { + calin::iact_data::acada_data_source::ACADA_EventMessage_L0** event_out }; + +%template(DataSource_L0) + calin::io::data_source::DataSource; +%template(RandomAccessDataSource_L0) + calin::io::data_source::RandomAccessDataSource; + +%extend calin::io::data_source::DataSource { + calin::iact_data::acada_data_source::ACADA_EventMessage_L0* simple_get_next() + { + uint64_t unused_seq_index = 0; + return $self->get_next(unused_seq_index); + } + + void get_next(uint64_t& seq_index_out, calin::iact_data::acada_data_source::ACADA_EventMessage_L0** event_out) + { + seq_index_out = 0; + *event_out = $self->get_next(seq_index_out); + } +} + +%template(ACADACameraEventDataSource_L0) + calin::iact_data::acada_data_source::ACADACameraEventDataSource; +%template(ACADACameraEventDataSourceWithRunHeader_L0) + calin::iact_data::acada_data_source::ACADACameraEventDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_L0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_L0>; +%template(ACADACameraEventRandomAccessDataSourceWithRunHeader_L0) + calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_L0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_L0>; + +%template(DataSourceOpener_L0) + calin::io::data_source::DataSourceOpener< + calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_L0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_L0> >; + +%template(BasicChainedDataSource_ACADACameraEventRandomAccessDataSourceWithRunHeader_L0) + calin::io::data_source::BasicChainedDataSource< + calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_L0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_L0> >; + +%template(BasicChainedRandomAccessDataSource_ACADACameraEventRandomAccessDataSourceWithRunHeader_L0) + calin::io::data_source::BasicChainedRandomAccessDataSource< + calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_L0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_L0> >; + +%template(ZFITSACADACameraEventDataSourceOpener_L0) + calin::iact_data::zfits_acada_data_source::ZFITSACADACameraEventDataSourceOpener< + calin::iact_data::acada_data_source::ACADA_EventMessage_L0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_L0>; + +%template(ZFITSSingleFileACADACameraEventDataSource_L0) + calin::iact_data::zfits_acada_data_source::ZFITSSingleFileACADACameraEventDataSource< + calin::iact_data::acada_data_source::ACADA_EventMessage_L0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_L0>; +%template(ZFITSACADACameraEventDataSource_L0) + calin::iact_data::zfits_acada_data_source::ZFITSACADACameraEventDataSource< + calin::iact_data::acada_data_source::ACADA_EventMessage_L0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_L0>; + +/* + + RRRRRRRRRRRRRRRRR 1111111 000000000 + R::::::::::::::::R 1::::::1 00:::::::::00 + R::::::RRRRRR:::::R 1:::::::1 00:::::::::::::00 + RR:::::R R:::::R111:::::1 0:::::::000:::::::0 + R::::R R:::::R 1::::1vvvvvvv vvvvvvv0::::::0 0::::::0 + R::::R R:::::R 1::::1 v:::::v v:::::v 0:::::0 0:::::0 + R::::RRRRRR:::::R 1::::1 v:::::v v:::::v 0:::::0 0:::::0 + R:::::::::::::RR 1::::l v:::::v v:::::v 0:::::0 000 0:::::0 + R::::RRRRRR:::::R 1::::l v:::::v v:::::v 0:::::0 000 0:::::0 + R::::R R:::::R 1::::l v:::::v v:::::v 0:::::0 0:::::0 + R::::R R:::::R 1::::l v:::::v:::::v 0:::::0 0:::::0 + R::::R R:::::R 1::::l v:::::::::v 0::::::0 0::::::0 + RR:::::R R:::::R111::::::111 v:::::::v 0:::::::000:::::::0 + R::::::R R:::::R1::::::::::1 v:::::v 00:::::::::::::00 + R::::::R R:::::R1::::::::::1 v:::v 00:::::::::00 + RRRRRRRR RRRRRRR111111111111 vvv 000000000 + +*/ + +namespace calin::iact_data::acada_data_source { + class ACADA_EventMessage_R1v0: public google::protobuf::Message { }; + class ACADA_HeaderMessage_R1v0: public google::protobuf::Message { }; +} + +%typemap(in, numinputs=0) calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0** CALIN_PROTOBUF_OUTPUT + (calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0* temp = nullptr) { + // typemap(in) calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i + $1 = &temp; +} + +%typemap(argout) calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0** CALIN_PROTOBUF_OUTPUT { + // typemap(argout) calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i + %append_output(SWIG_NewPointerObj(SWIG_as_voidptr(*$1), $*1_descriptor, SWIG_POINTER_OWN)); +} + +%typemap(in, numinputs=0) calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0** CALIN_PROTOBUF_OUTPUT + (calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0* temp = nullptr) { + // typemap(in) calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i + $1 = &temp; +} + +%typemap(argout) calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0** CALIN_PROTOBUF_OUTPUT { + // typemap(argout) calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i + %append_output(SWIG_NewPointerObj(SWIG_as_voidptr(*$1), $*1_descriptor, SWIG_POINTER_OWN)); +} + +%apply calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0** CALIN_PROTOBUF_OUTPUT { + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0** message_out }; +%apply calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0** CALIN_PROTOBUF_OUTPUT { + calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0** message_out }; + + +%template(DataSource_ACADAEventMessage_R1v0) + calin::io::data_source::DataSource; +%template(DataSource_ACADAHeaderMessage_R1v0) + calin::io::data_source::DataSource; + +%template(RandomAccessDataSource_ACADAEventMessage_R1v0) + calin::io::data_source::RandomAccessDataSource; +%template(RandomAccessDataSource_ACADAHeaderMessage_R1v0) + calin::io::data_source::RandomAccessDataSource; + +%extend calin::io::data_source::DataSource { + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0* simple_get_next() + { + uint64_t unused_seq_index = 0; + return $self->get_next(unused_seq_index); + } + + void get_next(uint64_t& seq_index_out, calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0** message_out) + { + seq_index_out = 0; + *message_out = $self->get_next(seq_index_out); + } +} + +%extend calin::io::data_source::DataSource { + calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0* simple_get_next() + { + uint64_t unused_seq_index = 0; + return $self->get_next(unused_seq_index); + } + + void get_next(uint64_t& seq_index_out, calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0** message_out) + { + seq_index_out = 0; + *message_out = $self->get_next(seq_index_out); + } +} + +%template(ACADACameraEventDataSource_R1v0) + calin::iact_data::acada_data_source::ACADACameraEventDataSource; +%template(ACADACameraEventDataSourceWithRunHeader_R1v0) + calin::iact_data::acada_data_source::ACADACameraEventDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0>; +%template(ACADACameraEventRandomAccessDataSourceWithRunHeader_R1v0) + calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0>; + +%template(DataSourceOpener_R1v0) + calin::io::data_source::DataSourceOpener< + calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0> >; + +%template(BasicChainedDataSource_ACADACameraEventRandomAccessDataSourceWithRunHeader_R1v0) + calin::io::data_source::BasicChainedDataSource< + calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0> >; + +%template(BasicChainedRandomAccessDataSource_ACADACameraEventRandomAccessDataSourceWithRunHeader_R1v0) + calin::io::data_source::BasicChainedRandomAccessDataSource< + calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0> >; + +%template(ZFITSACADACameraEventDataSourceOpener_R1v0) + calin::iact_data::zfits_acada_data_source::ZFITSACADACameraEventDataSourceOpener< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0>; + +%template(ZFITSSingleFileACADACameraEventDataSource_R1v0) + calin::iact_data::zfits_acada_data_source::ZFITSSingleFileACADACameraEventDataSource< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v0,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v0>; + +%template(ZFITSSingleFileSingleMessageDataSource_ACADAEventMessage_R1v0) + calin::iact_data::zfits_acada_data_source:: + ZFITSSingleFileSingleMessageDataSource; +%template(ZFITSSingleFileSingleMessageDataSource_ACADAHeaderMessage_R1v0) + calin::iact_data::zfits_acada_data_source:: + ZFITSSingleFileSingleMessageDataSource; + +/* + + RRRRRRRRRRRRRRRRR 1111111 1111111 + R::::::::::::::::R 1::::::1 1::::::1 + R::::::RRRRRR:::::R 1:::::::1 1:::::::1 + RR:::::R R:::::R111:::::1 111:::::1 + R::::R R:::::R 1::::1vvvvvvv vvvvvvv1::::1 + R::::R R:::::R 1::::1 v:::::v v:::::v 1::::1 + R::::RRRRRR:::::R 1::::1 v:::::v v:::::v 1::::1 + R:::::::::::::RR 1::::l v:::::v v:::::v 1::::l + R::::RRRRRR:::::R 1::::l v:::::v v:::::v 1::::l + R::::R R:::::R 1::::l v:::::v v:::::v 1::::l + R::::R R:::::R 1::::l v:::::v:::::v 1::::l + R::::R R:::::R 1::::l v:::::::::v 1::::l + RR:::::R R:::::R111::::::111 v:::::::v 111::::::111 + R::::::R R:::::R1::::::::::1 v:::::v 1::::::::::1 + R::::::R R:::::R1::::::::::1 v:::v 1::::::::::1 + RRRRRRRR RRRRRRR111111111111 vvv 111111111111 + +*/ + +namespace calin::iact_data::acada_data_source { + class ACADA_EventMessage_R1v1: public google::protobuf::Message { }; + class ACADA_HeaderMessage_R1v1: public google::protobuf::Message { }; + class ACADA_DataStreamMessage_R1v1: public google::protobuf::Message { }; +} + +%typemap(in, numinputs=0) calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1** CALIN_PROTOBUF_OUTPUT + (calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1* temp = nullptr) { + // typemap(in) calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i + $1 = &temp; +} + +%typemap(argout) calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1** CALIN_PROTOBUF_OUTPUT { + // typemap(argout) calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i + %append_output(SWIG_NewPointerObj(SWIG_as_voidptr(*$1), $*1_descriptor, SWIG_POINTER_OWN)); +} + +%typemap(in, numinputs=0) calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1** CALIN_PROTOBUF_OUTPUT + (calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1* temp = nullptr) { + // typemap(in) calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i + $1 = &temp; +} + +%typemap(argout) calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1** CALIN_PROTOBUF_OUTPUT { + // typemap(argout) calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i + %append_output(SWIG_NewPointerObj(SWIG_as_voidptr(*$1), $*1_descriptor, SWIG_POINTER_OWN)); +} + +%typemap(in, numinputs=0) calin::iact_data::acada_data_source::ACADA_DataStreamMessage_R1v1** CALIN_PROTOBUF_OUTPUT + (calin::iact_data::acada_data_source::ACADA_DataStreamMessage_R1v1* temp = nullptr) { + // typemap(in) calin::iact_data::acada_data_source::ACADA_DataStreamMessage_R1v1** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i + $1 = &temp; +} + +%typemap(argout) calin::iact_data::acada_data_source::ACADA_DataStreamMessage_R1v1** CALIN_PROTOBUF_OUTPUT { + // typemap(argout) calin::iact_data::acada_data_source::ACADA_DataStreamMessage_R1v1** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i + %append_output(SWIG_NewPointerObj(SWIG_as_voidptr(*$1), $*1_descriptor, SWIG_POINTER_OWN)); +} + +%apply calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1** CALIN_PROTOBUF_OUTPUT { + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1** message_out }; +%apply calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1** CALIN_PROTOBUF_OUTPUT { + calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1** message_out }; +%apply calin::iact_data::acada_data_source::ACADA_DataStreamMessage_R1v1** CALIN_PROTOBUF_OUTPUT { + calin::iact_data::acada_data_source::ACADA_DataStreamMessage_R1v1** message_out }; + +%template(DataSource_ACADAEventMessage_R1v1) + calin::io::data_source::DataSource; +%template(DataSource_ACADAHeaderMessage_R1v1) + calin::io::data_source::DataSource; +%template(DataSource_ACADADataStreamMessage_R1v1) + calin::io::data_source::DataSource; + +%template(RandomAccessDataSource_ACADAEventMessage_R1v1) + calin::io::data_source::RandomAccessDataSource; +%template(RandomAccessDataSource_ACADAHeaderMessage_R1v1) + calin::io::data_source::RandomAccessDataSource; +%template(RandomAccessDataSource_ACADADataStreamMessage_R1v1) + calin::io::data_source::RandomAccessDataSource; + +%extend calin::io::data_source::DataSource { + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1* simple_get_next() + { + uint64_t unused_seq_index = 0; + return $self->get_next(unused_seq_index); + } + + void get_next(uint64_t& seq_index_out, calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1** message_out) + { + seq_index_out = 0; + *message_out = $self->get_next(seq_index_out); + } +} + +%extend calin::io::data_source::DataSource { + calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1* simple_get_next() + { + uint64_t unused_seq_index = 0; + return $self->get_next(unused_seq_index); + } + + void get_next(uint64_t& seq_index_out, calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1** message_out) + { + seq_index_out = 0; + *message_out = $self->get_next(seq_index_out); + } +} + +%extend calin::io::data_source::DataSource { + calin::iact_data::acada_data_source::ACADA_DataStreamMessage_R1v1* simple_get_next() + { + uint64_t unused_seq_index = 0; + return $self->get_next(unused_seq_index); + } + + void get_next(uint64_t& seq_index_out, calin::iact_data::acada_data_source::ACADA_DataStreamMessage_R1v1** message_out) + { + seq_index_out = 0; + *message_out = $self->get_next(seq_index_out); + } +} + +%template(ACADACameraEventDataSource_R1v1) + calin::iact_data::acada_data_source::ACADACameraEventDataSource; +%template(ACADACameraEventDataSourceWithRunHeader_R1v1) + calin::iact_data::acada_data_source::ACADACameraEventDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1>; +%template(ACADACameraEventRandomAccessDataSourceWithRunHeader_R1v1) + calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1>; + +%template(DataSourceOpener_R1v1) + calin::io::data_source::DataSourceOpener< + calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1> >; + +%template(BasicChainedDataSource_ACADACameraEventRandomAccessDataSourceWithRunHeader_R1v1) + calin::io::data_source::BasicChainedDataSource< + calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1> >; + +%template(BasicChainedRandomAccessDataSource_ACADACameraEventRandomAccessDataSourceWithRunHeader_R1v1) + calin::io::data_source::BasicChainedRandomAccessDataSource< + calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1> >; + +%template(ZFITSACADACameraEventDataSourceOpener_R1v1) + calin::iact_data::zfits_acada_data_source::ZFITSACADACameraEventDataSourceOpener< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1>; + +%template(ZFITSSingleFileACADACameraEventDataSource_R1v1) + calin::iact_data::zfits_acada_data_source::ZFITSSingleFileACADACameraEventDataSource< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1>; +%template(ZFITSACADACameraEventDataSource_R1v1) + calin::iact_data::zfits_acada_data_source::ZFITSACADACameraEventDataSource< + calin::iact_data::acada_data_source::ACADA_EventMessage_R1v1,calin::iact_data::acada_data_source::ACADA_HeaderMessage_R1v1>; + +%template(ZFITSSingleFileSingleMessageDataSource_ACADAEventMessage_R1v1) + calin::iact_data::zfits_acada_data_source:: + ZFITSSingleFileSingleMessageDataSource; +%template(ZFITSSingleFileSingleMessageDataSource_ACADAHeaderMessage_R1v1) + calin::iact_data::zfits_acada_data_source:: + ZFITSSingleFileSingleMessageDataSource; +%template(ZFITSSingleFileSingleMessageDataSource_ACADADataStreamMessage_R1v1) + calin::iact_data::zfits_acada_data_source:: + ZFITSSingleFileSingleMessageDataSource; diff --git a/swig/iact_data/raw_acada_event_data_source_l0.i b/swig/iact_data/raw_acada_event_data_source_l0.i deleted file mode 100644 index ea118aa4..00000000 --- a/swig/iact_data/raw_acada_event_data_source_l0.i +++ /dev/null @@ -1,150 +0,0 @@ -/* - - calin/iact_data/raw_actl_r1_event_data_source.i -- Stephen Fegan -- 2024-09-09 - - SWIG interface file for calin.io.raw_acada_event_data_source - - Copyright 2024, Stephen Fegan - Laboratoire Leprince-Ringuet, CNRS/IN2P3, Ecole Polytechnique, Institut Polytechnique de Paris - - This file is part of "calin" - - "calin" is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License version 2 or - later, as published by the Free Software Foundation. - - "calin" is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - -*/ - -%module (package="calin.iact_data") raw_acada_event_data_source_l0 -%feature(autodoc,2); - -%{ -#include -#include -#define SWIG_FILE_WITH_INIT - %} - -%init %{ - import_array(); -%} - -%include "calin_typemaps.i" -%include "calin_global_config.hpp" -%import "calin_global_definitions.i" - -%import "google_protobuf.i" -%import "io/data_source.i" -%import "iact_data/zfits_data_source.pb.i" - -%ignore get_next(uint64_t& seq_index_out); -%ignore get_next(uint64_t& seq_index_out, google::protobuf::Arena** arena); - -%newobject simple_get_next(); -%newobject get_run_header(); - -%include "io/chained_data_source.hpp" -%include "iact_data/acada_data_source.hpp" -%include "iact_data/zfits_acada_data_source.hpp" - -%apply uint64_t& OUTPUT { uint64_t& seq_index_out }; -%apply google::protobuf::Arena** CALIN_ARENA_OUTPUT { - google::protobuf::Arena** arena_out }; - -/* - - LLLLLLLLLLL 000000000 - L:::::::::L 00:::::::::00 - L:::::::::L 00:::::::::::::00 - LL:::::::LL 0:::::::000:::::::0 - L:::::L 0::::::0 0::::::0 - L:::::L 0:::::0 0:::::0 - L:::::L 0:::::0 0:::::0 - L:::::L 0:::::0 000 0:::::0 - L:::::L 0:::::0 000 0:::::0 - L:::::L 0:::::0 0:::::0 - L:::::L 0:::::0 0:::::0 - L:::::L LLLLLL 0::::::0 0::::::0 - LL:::::::LLLLLLLLL:::::L 0:::::::000:::::::0 - L::::::::::::::::::::::L 00:::::::::::::00 - L::::::::::::::::::::::L 00:::::::::00 - LLLLLLLLLLLLLLLLLLLLLLLL 000000000 - -*/ - -namespace ProtoDataModel { - class CameraEvent: public google::protobuf::Message { }; - class CameraRunHeader: public google::protobuf::Message { }; -} - -%typemap(in, numinputs=0) ProtoDataModel::CameraEvent** CALIN_PROTOBUF_OUTPUT - (ProtoDataModel::CameraEvent* temp = nullptr) { - // typemap(in) ProtoDataModel::CameraEvent** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i - $1 = &temp; -} - -%typemap(argout) ProtoDataModel::CameraEvent** CALIN_PROTOBUF_OUTPUT { - // typemap(argout) ProtoDataModel::CameraEvent** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i - %append_output(SWIG_NewPointerObj(SWIG_as_voidptr(*$1), $*1_descriptor, SWIG_POINTER_OWN)); -} - -%apply ProtoDataModel::CameraEvent** CALIN_PROTOBUF_OUTPUT { - ProtoDataModel::CameraEvent** event_out }; - -%template(DataSource_L0) - calin::io::data_source::DataSource; -%template(RandomAccessDataSource_L0) - calin::io::data_source::RandomAccessDataSource; - -%extend calin::io::data_source::DataSource { - ProtoDataModel::CameraEvent* simple_get_next() - { - uint64_t unused_seq_index = 0; - return $self->get_next(unused_seq_index); - } - - void get_next(uint64_t& seq_index_out, ProtoDataModel::CameraEvent** event_out) - { - seq_index_out = 0; - *event_out = $self->get_next(seq_index_out); - } -} - -%template(ACADACameraEventDataSource_L0) - calin::iact_data::acada_data_source::ACADACameraEventDataSource; -%template(ACADACameraEventDataSourceWithRunHeader_L0) - calin::iact_data::acada_data_source::ACADACameraEventDataSourceWithRunHeader< - ProtoDataModel::CameraEvent,ProtoDataModel::CameraRunHeader>; -%template(ACADACameraEventRandomAccessDataSourceWithRunHeader_L0) - calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< - ProtoDataModel::CameraEvent,ProtoDataModel::CameraRunHeader>; - -%template(DataSourceOpener_L0) - calin::io::data_source::DataSourceOpener< - calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< - ProtoDataModel::CameraEvent,ProtoDataModel::CameraRunHeader> >; - -%template(BasicChainedDataSource_ACADACameraEventRandomAccessDataSourceWithRunHeader_L0) - calin::io::data_source::BasicChainedDataSource< - calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< - ProtoDataModel::CameraEvent,ProtoDataModel::CameraRunHeader> >; - -%template(BasicChainedRandomAccessDataSource_ACADACameraEventRandomAccessDataSourceWithRunHeader_L0) - calin::io::data_source::BasicChainedRandomAccessDataSource< - calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< - ProtoDataModel::CameraEvent,ProtoDataModel::CameraRunHeader> >; - -%template(ZFITSACADACameraEventDataSourceOpener_L0) - calin::iact_data::zfits_acada_data_source::ZFITSACADACameraEventDataSourceOpener< - ProtoDataModel::CameraEvent,ProtoDataModel::CameraRunHeader>; - -%template(ZFITSSingleFileACADACameraEventDataSource_L0) - calin::iact_data::zfits_acada_data_source::ZFITSSingleFileACADACameraEventDataSource< - ProtoDataModel::CameraEvent,ProtoDataModel::CameraRunHeader>; -%template(ZFITSACADACameraEventDataSource_L0) - calin::iact_data::zfits_acada_data_source::ZFITSACADACameraEventDataSource< - ProtoDataModel::CameraEvent,ProtoDataModel::CameraRunHeader>; diff --git a/swig/iact_data/raw_acada_event_data_source_r1v0.i b/swig/iact_data/raw_acada_event_data_source_r1v0.i deleted file mode 100644 index e27a07fe..00000000 --- a/swig/iact_data/raw_acada_event_data_source_r1v0.i +++ /dev/null @@ -1,150 +0,0 @@ -/* - - calin/iact_data/raw_actl_r1_event_data_source.i -- Stephen Fegan -- 2024-09-09 - - SWIG interface file for calin.io.raw_acada_event_data_source - - Copyright 2024, Stephen Fegan - Laboratoire Leprince-Ringuet, CNRS/IN2P3, Ecole Polytechnique, Institut Polytechnique de Paris - - This file is part of "calin" - - "calin" is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License version 2 or - later, as published by the Free Software Foundation. - - "calin" is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - -*/ - -%module (package="calin.iact_data") raw_acada_event_data_source_r1v0 -%feature(autodoc,2); - -%{ -#include -#include -#define SWIG_FILE_WITH_INIT - %} - -%init %{ - import_array(); -%} - -%include "calin_typemaps.i" -%include "calin_global_config.hpp" -%import "calin_global_definitions.i" - -%import "google_protobuf.i" -%import "io/data_source.i" -%import "iact_data/zfits_data_source.pb.i" - -%ignore get_next(uint64_t& seq_index_out); -%ignore get_next(uint64_t& seq_index_out, google::protobuf::Arena** arena); - -%newobject simple_get_next(); -%newobject get_run_header(); - -%include "io/chained_data_source.hpp" -%include "iact_data/acada_data_source.hpp" -%include "iact_data/zfits_acada_data_source.hpp" - -%apply uint64_t& OUTPUT { uint64_t& seq_index_out }; -%apply google::protobuf::Arena** CALIN_ARENA_OUTPUT { - google::protobuf::Arena** arena_out }; - -/* - - RRRRRRRRRRRRRRRRR 1111111 000000000 - R::::::::::::::::R 1::::::1 00:::::::::00 - R::::::RRRRRR:::::R 1:::::::1 00:::::::::::::00 - RR:::::R R:::::R111:::::1 0:::::::000:::::::0 - R::::R R:::::R 1::::1vvvvvvv vvvvvvv0::::::0 0::::::0 - R::::R R:::::R 1::::1 v:::::v v:::::v 0:::::0 0:::::0 - R::::RRRRRR:::::R 1::::1 v:::::v v:::::v 0:::::0 0:::::0 - R:::::::::::::RR 1::::l v:::::v v:::::v 0:::::0 000 0:::::0 - R::::RRRRRR:::::R 1::::l v:::::v v:::::v 0:::::0 000 0:::::0 - R::::R R:::::R 1::::l v:::::v v:::::v 0:::::0 0:::::0 - R::::R R:::::R 1::::l v:::::v:::::v 0:::::0 0:::::0 - R::::R R:::::R 1::::l v:::::::::v 0::::::0 0::::::0 - RR:::::R R:::::R111::::::111 v:::::::v 0:::::::000:::::::0 - R::::::R R:::::R1::::::::::1 v:::::v 00:::::::::::::00 - R::::::R R:::::R1::::::::::1 v:::v 00:::::::::00 - RRRRRRRR RRRRRRR111111111111 vvv 000000000 - -*/ - -namespace ProtoR1 { - class CameraEvent: public google::protobuf::Message { }; - class CameraConfiguration: public google::protobuf::Message { }; -} - -%typemap(in, numinputs=0) ProtoR1::CameraEvent** CALIN_PROTOBUF_OUTPUT - (ProtoR1::CameraEvent* temp = nullptr) { - // typemap(in) ProtoR1::CameraEvent** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i - $1 = &temp; -} - -%typemap(argout) ProtoR1::CameraEvent** CALIN_PROTOBUF_OUTPUT { - // typemap(argout) ProtoR1::CameraEvent** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i - %append_output(SWIG_NewPointerObj(SWIG_as_voidptr(*$1), $*1_descriptor, SWIG_POINTER_OWN)); -} - -%apply ProtoR1::CameraEvent** CALIN_PROTOBUF_OUTPUT { - ProtoR1::CameraEvent** event_out }; - -%template(DataSource_R1v0) - calin::io::data_source::DataSource; -%template(RandomAccessDataSource_R1v0) - calin::io::data_source::RandomAccessDataSource; - -%extend calin::io::data_source::DataSource { - ProtoR1::CameraEvent* simple_get_next() - { - uint64_t unused_seq_index = 0; - return $self->get_next(unused_seq_index); - } - - void get_next(uint64_t& seq_index_out, ProtoR1::CameraEvent** event_out) - { - seq_index_out = 0; - *event_out = $self->get_next(seq_index_out); - } -} - -%template(ACADACameraEventDataSource_R1v0) - calin::iact_data::acada_data_source::ACADACameraEventDataSource; -%template(ACADACameraEventDataSourceWithRunHeader_R1v0) - calin::iact_data::acada_data_source::ACADACameraEventDataSourceWithRunHeader< - ProtoR1::CameraEvent,ProtoR1::CameraConfiguration>; -%template(ACADACameraEventRandomAccessDataSourceWithRunHeader_R1v0) - calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< - ProtoR1::CameraEvent,ProtoR1::CameraConfiguration>; - -%template(DataSourceOpener_R1v0) - calin::io::data_source::DataSourceOpener< - calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< - ProtoR1::CameraEvent,ProtoR1::CameraConfiguration> >; - -%template(BasicChainedDataSource_ACADACameraEventRandomAccessDataSourceWithRunHeader_R1v0) - calin::io::data_source::BasicChainedDataSource< - calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< - ProtoR1::CameraEvent,ProtoR1::CameraConfiguration> >; - -%template(BasicChainedRandomAccessDataSource_ACADACameraEventRandomAccessDataSourceWithRunHeader_R1v0) - calin::io::data_source::BasicChainedRandomAccessDataSource< - calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< - ProtoR1::CameraEvent,ProtoR1::CameraConfiguration> >; - -%template(ZFITSACADACameraEventDataSourceOpener_R1v0) - calin::iact_data::zfits_acada_data_source::ZFITSACADACameraEventDataSourceOpener< - ProtoR1::CameraEvent,ProtoR1::CameraConfiguration>; - -%template(ZFITSSingleFileACADACameraEventDataSource_R1v0) - calin::iact_data::zfits_acada_data_source::ZFITSSingleFileACADACameraEventDataSource< - ProtoR1::CameraEvent,ProtoR1::CameraConfiguration>; -%template(ZFITSACADACameraEventDataSource_R1v0) - calin::iact_data::zfits_acada_data_source::ZFITSACADACameraEventDataSource< - ProtoR1::CameraEvent,ProtoR1::CameraConfiguration>; diff --git a/swig/iact_data/raw_acada_event_data_source_r1v1.i b/swig/iact_data/raw_acada_event_data_source_r1v1.i deleted file mode 100644 index b2bc397b..00000000 --- a/swig/iact_data/raw_acada_event_data_source_r1v1.i +++ /dev/null @@ -1,150 +0,0 @@ -/* - - calin/iact_data/raw_actl_r1_event_data_source.i -- Stephen Fegan -- 2024-09-09 - - SWIG interface file for calin.io.raw_acada_event_data_source - - Copyright 2024, Stephen Fegan - Laboratoire Leprince-Ringuet, CNRS/IN2P3, Ecole Polytechnique, Institut Polytechnique de Paris - - This file is part of "calin" - - "calin" is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License version 2 or - later, as published by the Free Software Foundation. - - "calin" is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - -*/ - -%module (package="calin.iact_data") raw_acada_event_data_source_r1v1 -%feature(autodoc,2); - -%{ -#include -#include -#define SWIG_FILE_WITH_INIT - %} - -%init %{ - import_array(); -%} - -%include "calin_typemaps.i" -%include "calin_global_config.hpp" -%import "calin_global_definitions.i" - -%import "google_protobuf.i" -%import "io/data_source.i" -%import "iact_data/zfits_data_source.pb.i" - -%ignore get_next(uint64_t& seq_index_out); -%ignore get_next(uint64_t& seq_index_out, google::protobuf::Arena** arena); - -%newobject simple_get_next(); -%newobject get_run_header(); - -%include "io/chained_data_source.hpp" -%include "iact_data/acada_data_source.hpp" -%include "iact_data/zfits_acada_data_source.hpp" - -%apply uint64_t& OUTPUT { uint64_t& seq_index_out }; -%apply google::protobuf::Arena** CALIN_ARENA_OUTPUT { - google::protobuf::Arena** arena_out }; - -/* - - RRRRRRRRRRRRRRRRR 1111111 1111111 - R::::::::::::::::R 1::::::1 1::::::1 - R::::::RRRRRR:::::R 1:::::::1 1:::::::1 - RR:::::R R:::::R111:::::1 111:::::1 - R::::R R:::::R 1::::1vvvvvvv vvvvvvv1::::1 - R::::R R:::::R 1::::1 v:::::v v:::::v 1::::1 - R::::RRRRRR:::::R 1::::1 v:::::v v:::::v 1::::1 - R:::::::::::::RR 1::::l v:::::v v:::::v 1::::l - R::::RRRRRR:::::R 1::::l v:::::v v:::::v 1::::l - R::::R R:::::R 1::::l v:::::v v:::::v 1::::l - R::::R R:::::R 1::::l v:::::v:::::v 1::::l - R::::R R:::::R 1::::l v:::::::::v 1::::l - RR:::::R R:::::R111::::::111 v:::::::v 111::::::111 - R::::::R R:::::R1::::::::::1 v:::::v 1::::::::::1 - R::::::R R:::::R1::::::::::1 v:::v 1::::::::::1 - RRRRRRRR RRRRRRR111111111111 vvv 111111111111 - -*/ - -namespace R1v1 { - class Event: public google::protobuf::Message { }; - class CameraConfiguration: public google::protobuf::Message { }; -} - -%typemap(in, numinputs=0) R1v1::Event** CALIN_PROTOBUF_OUTPUT - (R1v1::Event* temp = nullptr) { - // typemap(in) R1v1::Event** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i - $1 = &temp; -} - -%typemap(argout) R1v1::Event** CALIN_PROTOBUF_OUTPUT { - // typemap(argout) R1v1::Event** CALIN_PROTOBUF_OUTPUT - raw_actl_event_data_source.i - %append_output(SWIG_NewPointerObj(SWIG_as_voidptr(*$1), $*1_descriptor, SWIG_POINTER_OWN)); -} - -%apply R1v1::Event** CALIN_PROTOBUF_OUTPUT { - R1v1::Event** event_out }; - -%template(DataSource_R1v1) - calin::io::data_source::DataSource; -%template(RandomAccessDataSource_R1v1) - calin::io::data_source::RandomAccessDataSource; - -%extend calin::io::data_source::DataSource { - R1v1::Event* simple_get_next() - { - uint64_t unused_seq_index = 0; - return $self->get_next(unused_seq_index); - } - - void get_next(uint64_t& seq_index_out, R1v1::Event** event_out) - { - seq_index_out = 0; - *event_out = $self->get_next(seq_index_out); - } -} - -%template(ACADACameraEventDataSource_R1v1) - calin::iact_data::acada_data_source::ACADACameraEventDataSource; -%template(ACADACameraEventDataSourceWithRunHeader_R1v1) - calin::iact_data::acada_data_source::ACADACameraEventDataSourceWithRunHeader< - R1v1::Event,R1v1::CameraConfiguration>; -%template(ACADACameraEventRandomAccessDataSourceWithRunHeader_R1v1) - calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< - R1v1::Event,R1v1::CameraConfiguration>; - -%template(DataSourceOpener_R1v1) - calin::io::data_source::DataSourceOpener< - calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< - R1v1::Event,R1v1::CameraConfiguration> >; - -%template(BasicChainedDataSource_ACADACameraEventRandomAccessDataSourceWithRunHeader_R1v1) - calin::io::data_source::BasicChainedDataSource< - calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< - R1v1::Event,R1v1::CameraConfiguration> >; - -%template(BasicChainedRandomAccessDataSource_ACADACameraEventRandomAccessDataSourceWithRunHeader_R1v1) - calin::io::data_source::BasicChainedRandomAccessDataSource< - calin::iact_data::acada_data_source::ACADACameraEventRandomAccessDataSourceWithRunHeader< - R1v1::Event,R1v1::CameraConfiguration> >; - -%template(ZFITSACADACameraEventDataSourceOpener_R1v1) - calin::iact_data::zfits_acada_data_source::ZFITSACADACameraEventDataSourceOpener< - R1v1::Event,R1v1::CameraConfiguration>; - -%template(ZFITSSingleFileACADACameraEventDataSource_R1v1) - calin::iact_data::zfits_acada_data_source::ZFITSSingleFileACADACameraEventDataSource< - R1v1::Event,R1v1::CameraConfiguration>; -%template(ZFITSACADACameraEventDataSource_R1v1) - calin::iact_data::zfits_acada_data_source::ZFITSACADACameraEventDataSource< - R1v1::Event,R1v1::CameraConfiguration>;