Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
18namespace ROOT {
19namespace 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
31 uint64_t reqid{0}; ///< request id
32
33public:
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
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
60public:
61 const std::string &GetId() const { return id; }
62 uint64_t GetRequestId() const { return reqid; }
63
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
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
91public:
92 std::unique_ptr<RDrawableReply> Process() override;
93};
94
95} // namespace Experimental
96} // namespace ROOT
97
98
99#endif
Request execution of method of referenced drawable, no reply.
std::unique_ptr< RDrawableReply > Process() override
Execute method of the drawable.
Base class for replies on RDrawableRequest.
virtual ~RDrawableReply()
destructor, pin vtable
Base class for requests which can be submitted from the clients.
const RDrawable::RDisplayContext & GetContext() const
RDrawable::RDisplayContext & GetContext()
RDrawable::RDisplayContext fContext
! display context
virtual ~RDrawableRequest()
destructor, pin vtable
const std::string & GetId() const
virtual std::unique_ptr< RDrawableReply > Process()
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.