diff --git a/Firestore/core/swift/include/pipeline.h b/Firestore/core/swift/include/pipeline.h index 4519d5371e1..85da6206c03 100644 --- a/Firestore/core/swift/include/pipeline.h +++ b/Firestore/core/swift/include/pipeline.h @@ -6,19 +6,31 @@ #define FIREBASE_PIPELINE_H #include +#include #include "stage.h" namespace firebase { namespace firestore { +namespace core { +template +class EventListener; +} // namespace core + namespace api { class Firestore; +class PipelineResult; + +using PipelineSnapshotListener = + std::unique_ptr>>; class Pipeline { public: Pipeline(std::shared_ptr firestore, Stage stage); + std::shared_ptr GetPipelineResult(); + private: std::shared_ptr firestore_; Stage stage_; diff --git a/Firestore/core/swift/include/pipeline_result.h b/Firestore/core/swift/include/pipeline_result.h new file mode 100644 index 00000000000..c71a4200622 --- /dev/null +++ b/Firestore/core/swift/include/pipeline_result.h @@ -0,0 +1,39 @@ +// +// Created by Cheryl Lin on 2024-12-16. +// + +#ifndef FIREBASE_PIPELINE_RESULT_H +#define FIREBASE_PIPELINE_RESULT_H + +#include +#include "Firestore/core/include/firebase/firestore/timestamp.h" + +namespace firebase { +namespace firestore { + +namespace api { + +class Firestore; +class DocumentReference; + +class PipelineResult { + public: + PipelineResult(std::shared_ptr firestore, + std::shared_ptr doc_ref_ptr, + Timestamp execution_time, + Timestamp update_time, + Timestamp create_time); + + private: + std::shared_ptr firestore_; + std::shared_ptr doc_ref_ptr_; + Timestamp execution_time_; + Timestamp update_time_; + Timestamp create_time_; +}; + +} // namespace api + +} // namespace firestore +} // namespace firebase +#endif // FIREBASE_PIPELINE_RESULT_H diff --git a/Firestore/core/swift/src/pipeline.cc b/Firestore/core/swift/src/pipeline.cc index 070cb635d3a..762888f2e1c 100644 --- a/Firestore/core/swift/src/pipeline.cc +++ b/Firestore/core/swift/src/pipeline.cc @@ -1,6 +1,6 @@ #include "Firestore/core/swift/include/pipeline.h" -#include #include "Firestore/core/src/api/firestore.h" +#include "Firestore/core/src/core/event_listener.h" namespace firebase { namespace firestore { @@ -11,6 +11,10 @@ Pipeline::Pipeline(std::shared_ptr firestore, Stage stage) : firestore_(firestore), stage_(stage) { } +std::shared_ptr Pipeline::GetPipelineResult() { + return {}; +} + } // namespace api } // namespace firestore diff --git a/Firestore/core/swift/src/pipeline_result.cc b/Firestore/core/swift/src/pipeline_result.cc new file mode 100644 index 00000000000..6640d29f310 --- /dev/null +++ b/Firestore/core/swift/src/pipeline_result.cc @@ -0,0 +1,24 @@ + +#include "Firestore/core/swift/include/pipeline_result.h" + +namespace firebase { +namespace firestore { + +namespace api { + +PipelineResult::PipelineResult(std::shared_ptr firestore, + std::shared_ptr doc_ref_ptr, + Timestamp execution_time, + Timestamp update_time, + Timestamp create_time) + : firestore_(firestore), + doc_ref_ptr_(doc_ref_ptr), + execution_time_(execution_time), + update_time_(update_time), + create_time_(create_time) { +} + +} // namespace api + +} // namespace firestore +} // namespace firebase \ No newline at end of file diff --git a/Firestore/core/swift/src/pipeline_source.cc b/Firestore/core/swift/src/pipeline_source.cc index 2157b001132..addec222b09 100644 --- a/Firestore/core/swift/src/pipeline_source.cc +++ b/Firestore/core/swift/src/pipeline_source.cc @@ -11,6 +11,7 @@ namespace api { PipelineSource::PipelineSource(std::shared_ptr firestore) : firestore_(firestore) { + std::cout << "PipelineSource constructs" << std::endl; } Pipeline PipelineSource::GetCollection(std::string collection_path) { @@ -20,4 +21,4 @@ Pipeline PipelineSource::GetCollection(std::string collection_path) { } // namespace api } // namespace firestore -} // namespace firebase \ No newline at end of file +} // namespace firebase