Home | History | Annotate | Download | only in base

Lines Matching refs:protobuf

19 // of MCS protobuf is contained within a google::protobuf::MessageLite object.
107 // Utility method to build a google::protobuf::MessageLite object from a MCS
109 scoped_ptr<google::protobuf::MessageLite> BuildProtobufFromTag(uint8 tag) {
112 return scoped_ptr<google::protobuf::MessageLite>(
115 return scoped_ptr<google::protobuf::MessageLite>(
118 return scoped_ptr<google::protobuf::MessageLite>(
121 return scoped_ptr<google::protobuf::MessageLite>(
124 return scoped_ptr<google::protobuf::MessageLite>(
127 return scoped_ptr<google::protobuf::MessageLite>(
130 return scoped_ptr<google::protobuf::MessageLite>(
133 return scoped_ptr<google::protobuf::MessageLite>(
136 return scoped_ptr<google::protobuf::MessageLite>();
140 // Utility method to extract a MCS tag from a google::protobuf::MessageLite
142 int GetMCSProtoTag(const google::protobuf::MessageLite& message) {
164 std::string GetPersistentId(const google::protobuf::MessageLite& protobuf) {
165 if (protobuf.GetTypeName() == kProtoNames[kIqStanzaTag]) {
166 return reinterpret_cast<const mcs_proto::IqStanza*>(&protobuf)->
168 } else if (protobuf.GetTypeName() == kProtoNames[kDataMessageStanzaTag]) {
169 return reinterpret_cast<const mcs_proto::DataMessageStanza*>(&protobuf)->
177 google::protobuf::MessageLite* protobuf) {
178 if (protobuf->GetTypeName() == kProtoNames[kIqStanzaTag]) {
179 reinterpret_cast<mcs_proto::IqStanza*>(protobuf)->
182 } else if (protobuf->GetTypeName() == kProtoNames[kDataMessageStanzaTag]) {
183 reinterpret_cast<mcs_proto::DataMessageStanza*>(protobuf)->
190 uint32 GetLastStreamIdReceived(const google::protobuf::MessageLite& protobuf) {
191 if (protobuf.GetTypeName() == kProtoNames[kIqStanzaTag]) {
192 return reinterpret_cast<const mcs_proto::IqStanza*>(&protobuf)->
194 } else if (protobuf.GetTypeName() == kProtoNames[kDataMessageStanzaTag]) {
195 return reinterpret_cast<const mcs_proto::DataMessageStanza*>(&protobuf)->
197 } else if (protobuf.GetTypeName() == kProtoNames[kHeartbeatPingTag]) {
198 return reinterpret_cast<const mcs_proto::HeartbeatPing*>(&protobuf)->
200 } else if (protobuf.GetTypeName() == kProtoNames[kHeartbeatAckTag]) {
201 return reinterpret_cast<const mcs_proto::HeartbeatAck*>(&protobuf)->
203 } else if (protobuf.GetTypeName() == kProtoNames[kLoginResponseTag]) {
204 return reinterpret_cast<const mcs_proto::LoginResponse*>(&protobuf)->
212 google::protobuf::MessageLite* protobuf) {
213 if (protobuf->GetTypeName() == kProtoNames[kIqStanzaTag]) {
214 reinterpret_cast<mcs_proto::IqStanza*>(protobuf)->
217 } else if (protobuf->GetTypeName() == kProtoNames[kHeartbeatPingTag]) {
218 reinterpret_cast<mcs_proto::HeartbeatPing*>(protobuf)->
221 } else if (protobuf->GetTypeName() == kProtoNames[kHeartbeatAckTag]) {
222 reinterpret_cast<mcs_proto::HeartbeatAck*>(protobuf)->
225 } else if (protobuf->GetTypeName() == kProtoNames[kDataMessageStanzaTag]) {
226 reinterpret_cast<mcs_proto::DataMessageStanza*>(protobuf)->
229 } else if (protobuf->GetTypeName() == kProtoNames[kLoginResponseTag]) {
230 reinterpret_cast<mcs_proto::LoginResponse*>(protobuf)->
237 bool HasTTLExpired(const google::protobuf::MessageLite& protobuf,
239 if (protobuf.GetTypeName() != kProtoNames[kDataMessageStanzaTag])
241 uint64 ttl = GetTTL(protobuf);
243 reinterpret_cast<const mcs_proto::DataMessageStanza*>(&protobuf)->sent();
251 int GetTTL(const google::protobuf::MessageLite& protobuf) {
252 if (protobuf.GetTypeName() != kProtoNames[kDataMessageStanzaTag])
255 reinterpret_cast<const mcs_proto::DataMessageStanza*>(&protobuf);