aboutsummaryrefslogtreecommitdiff
path: root/include/perfetto/protozero/proto_decoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/perfetto/protozero/proto_decoder.h')
-rw-r--r--include/perfetto/protozero/proto_decoder.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/perfetto/protozero/proto_decoder.h b/include/perfetto/protozero/proto_decoder.h
index b58e64ebb..d23af33c4 100644
--- a/include/perfetto/protozero/proto_decoder.h
+++ b/include/perfetto/protozero/proto_decoder.h
@@ -40,7 +40,7 @@ namespace protozero {
// (see proto_decoder_fuzzer.cc).
// This class serves also as a building block for TypedProtoDecoder, used when
// the schema is known at compile time.
-class ProtoDecoder {
+class PERFETTO_EXPORT ProtoDecoder {
public:
// Creates a ProtoDecoder using the given |buffer| with size |length| bytes.
ProtoDecoder(const void* buffer, size_t length)
@@ -108,6 +108,10 @@ class RepeatedFieldIterator {
FindNextMatchingId();
}
+ // Constructs an invalid iterator.
+ RepeatedFieldIterator()
+ : field_id_(0u), iter_(nullptr), end_(nullptr), last_(nullptr) {}
+
explicit operator bool() const { return iter_ != end_; }
const Field& field() const { return *iter_; }
@@ -273,7 +277,7 @@ class PackedRepeatedFieldIterator {
// [ field 0 (invalid) ] [ fields 1 .. N ] [ repeated fields ]
// ^ ^
// num_fields_ size_
-class TypedProtoDecoderBase : public ProtoDecoder {
+class PERFETTO_EXPORT TypedProtoDecoderBase : public ProtoDecoder {
public:
// If the field |id| is known at compile time, prefer the templated
// specialization at<kFieldNumber>().