pulsar-client-cpp
Schema.h
1 
19 #pragma once
20 
21 #include <map>
22 
23 #include <iosfwd>
24 #include <memory>
25 
26 #pragma GCC visibility push(default)
27 
28 namespace pulsar {
29 
31 {
35  NONE = 0,
36 
40  STRING = 1,
41 
45  INT8 = 2,
46 
50  INT16 = 3,
51 
55  INT32 = 4,
56 
60  INT64 = 5,
61 
65  FLOAT = 6,
66 
70  DOUBLE = 7,
71 
75  BYTES = 8,
76 
80  JSON = 9,
81 
85  PROTOBUF = 10,
86 
90  AVRO = 11,
91 
96 
101 
105  KEY_VALUE = 15,
106 };
107 
108 // Return string representation of result code
109 const char *strSchemaType(SchemaType schemaType);
110 
111 class SchemaInfoImpl;
112 
113 typedef std::map<std::string, std::string> StringMap;
114 
118 class SchemaInfo {
119  public:
120  SchemaInfo();
121 
128  SchemaInfo(SchemaType schemaType, const std::string &name, const std::string &schema,
129  const StringMap &properties = StringMap());
130 
134  SchemaType getSchemaType() const;
135 
139  const std::string &getName() const;
140 
144  const std::string &getSchema() const;
145 
149  const StringMap &getProperties() const;
150 
151  private:
152  typedef std::shared_ptr<SchemaInfoImpl> SchemaInfoImplPtr;
153  SchemaInfoImplPtr impl_;
154 };
155 
156 } // namespace pulsar
157 
158 std::ostream &operator<<(std::ostream &s, pulsar::SchemaType schemaType);
159 
160 #pragma GCC visibility pop
pulsar::KEY_VALUE
Definition: Schema.h:105
pulsar::DOUBLE
Definition: Schema.h:70
pulsar::INT32
Definition: Schema.h:55
pulsar::AVRO
Definition: Schema.h:90
pulsar::INT64
Definition: Schema.h:60
pulsar::FLOAT
Definition: Schema.h:65
pulsar::SchemaType
SchemaType
Definition: Schema.h:30
pulsar::SchemaInfo::getSchemaType
SchemaType getSchemaType() const
pulsar::SchemaInfo::getProperties
const StringMap & getProperties() const
pulsar::INT8
Definition: Schema.h:45
pulsar::INT16
Definition: Schema.h:50
pulsar::AUTO_PUBLISH
Definition: Schema.h:100
pulsar::JSON
Definition: Schema.h:80
pulsar::STRING
Definition: Schema.h:40
pulsar::SchemaInfo
Definition: Schema.h:118
pulsar::SchemaInfo::getName
const std::string & getName() const
pulsar::BYTES
Definition: Schema.h:75
pulsar::NONE
Definition: Schema.h:35
pulsar
Definition: Authentication.h:31
pulsar::PROTOBUF
Definition: Schema.h:85
pulsar::AUTO_CONSUME
Definition: Schema.h:95
pulsar::SchemaInfo::getSchema
const std::string & getSchema() const