Logo ROOT  
Reference Guide
RDrawableRequest.hxx
Go to the documentation of this file.
1 /*************************************************************************
2  * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers. *
3  * All rights reserved. *
4  * *
5  * For the licensing terms see $ROOTSYS/LICENSE. *
6  * For the list of contributors see $ROOTSYS/README/CREDITS. *
7  *************************************************************************/
8 
9 #ifndef ROOT7_RDrawableRequest
10 #define ROOT7_RDrawableRequest
11 
12 #include <string>
13 #include <cstdint>
14 #include <memory>
15 
16 #include <ROOT/RDrawable.hxx>
17 
18 namespace ROOT {
19 namespace Experimental {
20 
21 
22 /** \class RDrawableReply
23 \ingroup GpadROOT7
24 \brief Base class for replies on RDrawableRequest
25 \author Sergey Linev <s.linev@gsi.de>
26 \date 2020-04-14
27 \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
28 */
29 
30 class RDrawableReply {
31  uint64_t reqid{0}; ///< request id
32 
33 public:
34 
35  void SetRequestId(uint64_t _reqid) { reqid = _reqid; }
36  uint64_t GetRequestId() const { return reqid; }
37 
38  virtual ~RDrawableReply();
39 };
40 
41 
42 /** \class RDrawableRequest
43 \ingroup GpadROOT7
44 \brief Base class for requests which can be submitted from the clients
45 \author Sergey Linev <s.linev@gsi.de>
46 \date 2020-04-14
47 \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
48 */
49 
50 class RDrawableRequest {
51  std::string id; ///< drawable id
52  uint64_t reqid{0}; ///< request id
53 
54  RDrawable::RDisplayContext fContext; ///<! display context
55 
56  //const RCanvas *fCanvas{nullptr}; ///<! pointer on canvas, can be used in Process
57  //const RPadBase *fPad{nullptr}; ///<! pointer on pad with drawable, can be used in Process
58  //RDrawable *fDrawable{nullptr}; ///<! pointer on drawable, can be used in Process
59 
60 public:
61  const std::string &GetId() const { return id; }
62  uint64_t GetRequestId() const { return reqid; }
63 
64  const RDrawable::RDisplayContext &GetContext() const { return fContext; }
66 
67  //void SetCanvas(const RCanvas *canv) { fCanvas = canv; }
68  //void SetPad(const RPadBase *pad) { fPad = pad; }
69  //void SetDrawable(RDrawable *dr) { fDrawable = dr; }
70 
71  virtual ~RDrawableRequest();
72 
73  bool ShouldBeReplyed() const { return GetRequestId() > 0; }
74 
75  virtual std::unique_ptr<RDrawableReply> Process() { return nullptr; }
76 
77  virtual bool NeedCanvasUpdate() const { return false; }
78 };
79 
80 
81 /** \class RDrawableExecRequest
82 \ingroup GpadROOT7
83 \brief Request execution of method of referenced drawable, no reply
84 \author Sergey Linev <s.linev@gsi.de>
85 \date 2020-04-14
86 \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
87 */
88 
90  std::string exec; ///< that to execute
91 public:
92  std::unique_ptr<RDrawableReply> Process() override;
93 };
94 
95 } // namespace Experimental
96 } // namespace ROOT
97 
98 
99 #endif
ROOT::Experimental::RDrawableRequest::GetRequestId
uint64_t GetRequestId() const
Definition: RDrawableRequest.hxx:74
ROOT::Experimental::RDrawableRequest::id
std::string id
drawable id
Definition: RDrawableRequest.hxx:63
ROOT::Experimental::RDrawableRequest::~RDrawableRequest
virtual ~RDrawableRequest()
destructor, pin vtable
ROOT::Experimental::RDrawableReply::reqid
uint64_t reqid
request id
Definition: RDrawableRequest.hxx:43
ROOT::Experimental::RDrawableRequest::NeedCanvasUpdate
virtual bool NeedCanvasUpdate() const
Definition: RDrawableRequest.hxx:89
ROOT::Experimental::RDrawableRequest::reqid
uint64_t reqid
request id
Definition: RDrawableRequest.hxx:64
ROOT::Experimental::RDrawableRequest::fContext
RDrawable::RDisplayContext fContext
! display context
Definition: RDrawableRequest.hxx:66
ROOT::Experimental::RDrawableRequest::Process
virtual std::unique_ptr< RDrawableReply > Process()
Definition: RDrawableRequest.hxx:87
ROOT::Experimental::RDrawableReply::SetRequestId
void SetRequestId(uint64_t _reqid)
Definition: RDrawableRequest.hxx:47
ROOT::Experimental::RDrawableExecRequest
Request execution of method of referenced drawable, no reply.
Definition: RDrawableRequest.hxx:101
ROOT::Experimental::RDrawableRequest
Base class for requests which can be submitted from the clients.
Definition: RDrawableRequest.hxx:62
ROOT::Experimental::RDrawableRequest::ShouldBeReplyed
bool ShouldBeReplyed() const
Definition: RDrawableRequest.hxx:85
ROOT::Experimental::RDrawableReply::~RDrawableReply
virtual ~RDrawableReply()
destructor, pin vtable
ROOT::Experimental::RDrawable::RDisplayContext
Definition: RDrawable.hxx:137
ROOT::Experimental::RDrawableExecRequest::exec
std::string exec
that to execute
Definition: RDrawableRequest.hxx:102
ROOT::Experimental::RDrawableReply::GetRequestId
uint64_t GetRequestId() const
Definition: RDrawableRequest.hxx:48
ROOT::Experimental::RDrawableRequest::GetContext
const RDrawable::RDisplayContext & GetContext() const
Definition: RDrawableRequest.hxx:76
ROOT::Experimental::RDrawableExecRequest::Process
std::unique_ptr< RDrawableReply > Process() override
Execute method of the drawable.
Definition: RDrawableRequest.cxx:31
RDrawable.hxx
ROOT::Experimental::RDrawableRequest::GetId
const std::string & GetId() const
Definition: RDrawableRequest.hxx:73
ROOT
VSD Structures.
Definition: StringConv.hxx:21