1    	// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
2    	// vim: ts=8 sw=2 smarttab
3    	/*
4    	 * Ceph - scalable distributed file system
5    	 *
6    	 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7    	 *
8    	 * This is free software; you can redistribute it and/or
9    	 * modify it under the terms of the GNU Lesser General Public
10   	 * License version 2.1, as published by the Free Software 
11   	 * Foundation.  See file COPYING.
12   	 * 
13   	 */
14   	
15   	
16   	
17   	#ifndef CEPH_MROUTE_H
18   	#define CEPH_MROUTE_H
19   	
20   	#include "msg/Message.h"
21   	#include "include/encoding.h"
22   	
23   	class MRoute : public Message {
24   	public:
25   	  static constexpr int HEAD_VERSION = 3;
26   	  static constexpr int COMPAT_VERSION = 3;
27   	
28   	  uint64_t session_mon_tid;
29   	  Message *msg;
30   	  epoch_t send_osdmap_first;
31   	  
32   	  MRoute() : Message{MSG_ROUTE, HEAD_VERSION, COMPAT_VERSION},
33   		     session_mon_tid(0),
34   		     msg(NULL),
35   		     send_osdmap_first(0) {}
36   	  MRoute(uint64_t t, Message *m)
37   	    : Message{MSG_ROUTE, HEAD_VERSION, COMPAT_VERSION},
38   	      session_mon_tid(t),
39   	      msg(m),
40   	      send_osdmap_first(0) {}
41   	private:
(1) Event exn_spec_violation: An exception of type "std::length_error" is thrown but the throw list "throw()" doesn't allow it to be thrown. This will cause a call to unexpected() which usually calls terminate().
Also see events: [fun_call_w_exception]
42   	  ~MRoute() override {
43   	    if (msg)
(2) Event fun_call_w_exception: Called function throws an exception of type "std::length_error". [details]
Also see events: [exn_spec_violation]
44   	      msg->put();
45   	  }
46   	
47   	public:
48   	  void decode_payload() override {
49   	    auto p = payload.cbegin();
50   	    decode(session_mon_tid, p);
51   	    entity_inst_t dest_unused;
52   	    decode(dest_unused, p);
53   	    bool m;
54   	    decode(m, p);
55   	    if (m)
56   	      msg = decode_message(NULL, 0, p);
57   	    decode(send_osdmap_first, p);
58   	  }
59   	  void encode_payload(uint64_t features) override {
60   	    using ceph::encode;
61   	    encode(session_mon_tid, payload);
62   	    entity_inst_t dest_unused;
63   	    encode(dest_unused, payload, features);
64   	    bool m = msg ? true : false;
65   	    encode(m, payload);
66   	    if (msg)
67   	      encode_message(msg, features, payload);
68   	    encode(send_osdmap_first, payload);
69   	  }
70   	
71   	  std::string_view get_type_name() const override { return "route"; }
72   	  void print(ostream& o) const override {
73   	    if (msg)
74   	      o << "route(" << *msg;
75   	    else
76   	      o << "route(no-reply";
77   	    if (send_osdmap_first)
78   	      o << " send_osdmap_first " << send_osdmap_first;
79   	    if (session_mon_tid)
80   	      o << " tid " << session_mon_tid << ")";
81   	    else
82   	      o << " tid (none)";
83   	  }
84   	private:
85   	  template<class T, typename... Args>
86   	  friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
87   	};
88   	
89   	#endif
90