Skip to content

Commit 92d1380

Browse files
committed
add pipeline result
1 parent f0288cd commit 92d1380

File tree

5 files changed

+82
-2
lines changed

5 files changed

+82
-2
lines changed

Firestore/core/swift/include/pipeline.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,31 @@
66
#define FIREBASE_PIPELINE_H
77

88
#include <memory>
9+
#include <vector>
910
#include "stage.h"
1011

1112
namespace firebase {
1213
namespace firestore {
1314

15+
namespace core {
16+
template <typename T>
17+
class EventListener;
18+
} // namespace core
19+
1420
namespace api {
1521

1622
class Firestore;
23+
class PipelineResult;
24+
25+
using PipelineSnapshotListener =
26+
std::unique_ptr<core::EventListener<std::vector<PipelineResult>>>;
1727

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

32+
std::shared_ptr<PipelineSnapshotListener> GetPipelineResult();
33+
2234
private:
2335
std::shared_ptr<Firestore> firestore_;
2436
Stage stage_;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//
2+
// Created by Cheryl Lin on 2024-12-16.
3+
//
4+
5+
#ifndef FIREBASE_PIPELINE_RESULT_H
6+
#define FIREBASE_PIPELINE_RESULT_H
7+
8+
#include <memory>
9+
#include "Firestore/core/include/firebase/firestore/timestamp.h"
10+
11+
namespace firebase {
12+
namespace firestore {
13+
14+
namespace api {
15+
16+
class Firestore;
17+
class DocumentReference;
18+
19+
class PipelineResult {
20+
public:
21+
PipelineResult(std::shared_ptr<Firestore> firestore,
22+
std::shared_ptr<DocumentReference> doc_ref_ptr,
23+
Timestamp execution_time,
24+
Timestamp update_time,
25+
Timestamp create_time);
26+
27+
private:
28+
std::shared_ptr<Firestore> firestore_;
29+
std::shared_ptr<DocumentReference> doc_ref_ptr_;
30+
Timestamp execution_time_;
31+
Timestamp update_time_;
32+
Timestamp create_time_;
33+
};
34+
35+
} // namespace api
36+
37+
} // namespace firestore
38+
} // namespace firebase
39+
#endif // FIREBASE_PIPELINE_RESULT_H

Firestore/core/swift/src/pipeline.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "Firestore/core/swift/include/pipeline.h"
2-
#include <memory>
32
#include "Firestore/core/src/api/firestore.h"
3+
#include "Firestore/core/src/core/event_listener.h"
44

55
namespace firebase {
66
namespace firestore {
@@ -11,6 +11,10 @@ Pipeline::Pipeline(std::shared_ptr<Firestore> firestore, Stage stage)
1111
: firestore_(firestore), stage_(stage) {
1212
}
1313

14+
std::shared_ptr<PipelineSnapshotListener> Pipeline::GetPipelineResult() {
15+
return {};
16+
}
17+
1418
} // namespace api
1519

1620
} // namespace firestore
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
#include "Firestore/core/swift/include/pipeline_result.h"
3+
4+
namespace firebase {
5+
namespace firestore {
6+
7+
namespace api {
8+
9+
PipelineResult::PipelineResult(std::shared_ptr<Firestore> firestore,
10+
std::shared_ptr<DocumentReference> doc_ref_ptr,
11+
Timestamp execution_time,
12+
Timestamp update_time,
13+
Timestamp create_time)
14+
: firestore_(firestore),
15+
doc_ref_ptr_(doc_ref_ptr),
16+
execution_time_(execution_time),
17+
update_time_(update_time),
18+
create_time_(create_time) {
19+
}
20+
21+
} // namespace api
22+
23+
} // namespace firestore
24+
} // namespace firebase

Firestore/core/swift/src/pipeline_source.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace api {
1111

1212
PipelineSource::PipelineSource(std::shared_ptr<Firestore> firestore)
1313
: firestore_(firestore) {
14+
std::cout << "PipelineSource constructs" << std::endl;
1415
}
1516

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

2223
} // namespace firestore
23-
} // namespace firebase
24+
} // namespace firebase

0 commit comments

Comments
 (0)