pulsar-client-cpp
Loading...
Searching...
No Matches
Schema.h
1
19#pragma once
20
21#include <map>
22
23#include <iosfwd>
24#include <memory>
25#include <string>
26#include <pulsar/defines.h>
27
28namespace pulsar {
29
31{
35 NONE = 0,
36
40 STRING = 1,
41
45 JSON = 2,
46
51
55 AVRO = 4,
56
60 INT8 = 6,
61
65 INT16 = 7,
66
70 INT32 = 8,
71
75 INT64 = 9,
76
80 FLOAT = 10,
81
85 DOUBLE = 11,
86
91
95 BYTES = -1,
96
101
106};
107
108// Return string representation of result code
109PULSAR_PUBLIC const char *strSchemaType(SchemaType schemaType);
110
111class SchemaInfoImpl;
112
113typedef std::map<std::string, std::string> StringMap;
114
118class PULSAR_PUBLIC SchemaInfo {
119 public:
131
138 SchemaInfo(SchemaType schemaType, const std::string &name, const std::string &schema,
139 const StringMap &properties = StringMap());
140
145
149 const std::string &getName() const;
150
154 const std::string &getSchema() const;
155
159 const StringMap &getProperties() const;
160
161 private:
162 typedef std::shared_ptr<SchemaInfoImpl> SchemaInfoImplPtr;
163 SchemaInfoImplPtr impl_;
164};
165
166} // namespace pulsar
167
168PULSAR_PUBLIC std::ostream &operator<<(std::ostream &s, pulsar::SchemaType schemaType);
Definition: Schema.h:118
const StringMap & getProperties() const
SchemaType getSchemaType() const
SchemaInfo(SchemaType schemaType, const std::string &name, const std::string &schema, const StringMap &properties=StringMap())
const std::string & getSchema() const
const std::string & getName() const
Definition: Authentication.h:30
SchemaType
Definition: Schema.h:31
@ INT64
Definition: Schema.h:75
@ JSON
Definition: Schema.h:45
@ DOUBLE
Definition: Schema.h:85
@ INT8
Definition: Schema.h:60
@ BYTES
Definition: Schema.h:95
@ PROTOBUF
Definition: Schema.h:50
@ FLOAT
Definition: Schema.h:80
@ AUTO_CONSUME
Definition: Schema.h:100
@ INT16
Definition: Schema.h:65
@ KEY_VALUE
Definition: Schema.h:90
@ STRING
Definition: Schema.h:40
@ INT32
Definition: Schema.h:70
@ AVRO
Definition: Schema.h:55
@ AUTO_PUBLISH
Definition: Schema.h:105
@ NONE
Definition: Schema.h:35