Skip to content

Commit

Permalink
add pipeline result
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylEnkidu committed Dec 17, 2024
1 parent f0288cd commit 92d1380
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 2 deletions.
12 changes: 12 additions & 0 deletions Firestore/core/swift/include/pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,31 @@
#define FIREBASE_PIPELINE_H

#include <memory>
#include <vector>
#include "stage.h"

namespace firebase {
namespace firestore {

namespace core {
template <typename T>
class EventListener;
} // namespace core

namespace api {

class Firestore;
class PipelineResult;

using PipelineSnapshotListener =
std::unique_ptr<core::EventListener<std::vector<PipelineResult>>>;

class Pipeline {
public:
Pipeline(std::shared_ptr<Firestore> firestore, Stage stage);

std::shared_ptr<PipelineSnapshotListener> GetPipelineResult();

private:
std::shared_ptr<Firestore> firestore_;
Stage stage_;
Expand Down
39 changes: 39 additions & 0 deletions Firestore/core/swift/include/pipeline_result.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// Created by Cheryl Lin on 2024-12-16.
//

#ifndef FIREBASE_PIPELINE_RESULT_H
#define FIREBASE_PIPELINE_RESULT_H

#include <memory>
#include "Firestore/core/include/firebase/firestore/timestamp.h"

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / client-app-cocoapods (ClientApp-CocoaPods)

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / client-app-cocoapods (ClientApp-CocoaPods)

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / client-app-cocoapods (ClientApp-CocoaPods)

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / client-app-cocoapods (ClientApp-CocoaPods)

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / installation-test

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / installation-test

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / installation-test

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / installation-test

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / storage-combine-integration

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / storage-combine-integration

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / storage-combine-integration

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / storage-combine-integration

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / xcodebuild (iOS)

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / xcodebuild (iOS)

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / xcodebuild (iOS)

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

Check failure on line 9 in Firestore/core/swift/include/pipeline_result.h

View workflow job for this annotation

GitHub Actions / xcodebuild (iOS)

'Firestore/core/include/firebase/firestore/timestamp.h' file not found

namespace firebase {
namespace firestore {

namespace api {

class Firestore;
class DocumentReference;

class PipelineResult {
public:
PipelineResult(std::shared_ptr<Firestore> firestore,
std::shared_ptr<DocumentReference> doc_ref_ptr,
Timestamp execution_time,
Timestamp update_time,
Timestamp create_time);

private:
std::shared_ptr<Firestore> firestore_;
std::shared_ptr<DocumentReference> doc_ref_ptr_;
Timestamp execution_time_;
Timestamp update_time_;
Timestamp create_time_;
};

} // namespace api

} // namespace firestore
} // namespace firebase
#endif // FIREBASE_PIPELINE_RESULT_H
6 changes: 5 additions & 1 deletion Firestore/core/swift/src/pipeline.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Firestore/core/swift/include/pipeline.h"
#include <memory>
#include "Firestore/core/src/api/firestore.h"
#include "Firestore/core/src/core/event_listener.h"

namespace firebase {
namespace firestore {
Expand All @@ -11,6 +11,10 @@ Pipeline::Pipeline(std::shared_ptr<Firestore> firestore, Stage stage)
: firestore_(firestore), stage_(stage) {
}

std::shared_ptr<PipelineSnapshotListener> Pipeline::GetPipelineResult() {
return {};
}

} // namespace api

} // namespace firestore
Expand Down
24 changes: 24 additions & 0 deletions Firestore/core/swift/src/pipeline_result.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

#include "Firestore/core/swift/include/pipeline_result.h"

namespace firebase {
namespace firestore {

namespace api {

PipelineResult::PipelineResult(std::shared_ptr<Firestore> firestore,
std::shared_ptr<DocumentReference> 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
3 changes: 2 additions & 1 deletion Firestore/core/swift/src/pipeline_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace api {

PipelineSource::PipelineSource(std::shared_ptr<Firestore> firestore)
: firestore_(firestore) {
std::cout << "PipelineSource constructs" << std::endl;
}

Pipeline PipelineSource::GetCollection(std::string collection_path) {
Expand All @@ -20,4 +21,4 @@ Pipeline PipelineSource::GetCollection(std::string collection_path) {
} // namespace api

} // namespace firestore
} // namespace firebase
} // namespace firebase

0 comments on commit 92d1380

Please sign in to comment.