9#ifndef ROOT7_Browsable_RProvider
10#define ROOT7_Browsable_RProvider
21namespace Experimental {
57 static std::string
GetClassIcon(
const ClassArg &,
bool =
false);
59 static bool CanDraw6(
const ClassArg &);
60 static bool CanDraw7(
const ClassArg &);
63 static std::shared_ptr<RElement>
OpenFile(
const std::string &
extension,
const std::string &fullname);
64 static std::shared_ptr<RElement>
Browse(std::unique_ptr<RHolder> &obj);
65 static std::shared_ptr<RElement>
BrowseNTuple(
const std::string &tuplename,
const std::string &filename);
66 static bool Draw6(
TVirtualPad *subpad, std::unique_ptr<RHolder> &obj,
const std::string &opt =
"");
67 static bool Draw7(std::shared_ptr<ROOT::Experimental::RPadBase> &subpad, std::unique_ptr<RHolder> &obj,
const std::string &opt =
"");
71 using FileFunc_t = std::function<std::shared_ptr<RElement>(
const std::string &)>;
72 using BrowseFunc_t = std::function<std::shared_ptr<RElement>(std::unique_ptr<RHolder> &)>;
73 using BrowseNTupleFunc_t = std::function<std::shared_ptr<RElement>(
const std::string &,
const std::string &)>;
75 using Draw7Func_t = std::function<
bool(std::shared_ptr<ROOT::Experimental::RPadBase> &, std::unique_ptr<RHolder> &,
const std::string &)>;
82 const std::string &iconname,
83 const std::string &browselib =
"",
84 const std::string &draw6lib =
"",
85 const std::string &draw7lib =
"");
102 using FileMap_t = std::multimap<std::string, StructFile>;
104 using Draw6Map_t = std::multimap<const TClass*, StructDraw6>;
105 using Draw7Map_t = std::multimap<const TClass*, StructDraw7>;
116 template<
class Map_t>
119 auto fiter = fmap.begin();
120 while (fiter != fmap.end()) {
121 if (fiter->second.provider ==
this)
122 fiter = fmap.erase(fiter);
const TClass * GetClass() const
ClassArg(const char *_name)
const std::string & GetName() const
ClassArg(const std::string &_name)
ClassArg(const TClass *_cl)
Provider of different browsing methods for supported classes.
void RegisterDraw7(const TClass *cl, Draw7Func_t func)
static std::shared_ptr< RElement > BrowseNTuple(const std::string &tuplename, const std::string &filename)
Start browsing of RNTuple.
std::function< bool(std::shared_ptr< ROOT::Experimental::RPadBase > &, std::unique_ptr< RHolder > &, const std::string &)> Draw7Func_t
static bool CanDraw6(const ClassArg &)
Return true if provided class can be drawn on the TCanvas.
static ClassMap_t & GetClassMap()
static FileMap_t & GetFileMap()
void RegisterDraw6(const TClass *cl, Draw6Func_t func)
static std::shared_ptr< RElement > Browse(std::unique_ptr< RHolder > &obj)
Create browsable element for the object Created element may take ownership over the object.
static bool CanDraw7(const ClassArg &)
Return true if provided class can be drawn on the RCanvas.
static BrowseNTupleFunc_t gNTupleFunc
static bool Draw6(TVirtualPad *subpad, std::unique_ptr< RHolder > &obj, const std::string &opt="")
Invoke drawing of object on TCanvas sub-pad All existing providers are checked, first checked are cla...
virtual ~RProvider()
Automatically unregister provider from all maps.
std::multimap< std::string, StructClass > ClassMap_t
static std::string GetClassIcon(const ClassArg &, bool=false)
Return icon name for the given class - either class name or TClass *.
std::multimap< std::string, StructFile > FileMap_t
static bool Draw7(std::shared_ptr< ROOT::Experimental::RPadBase > &subpad, std::unique_ptr< RHolder > &obj, const std::string &opt="")
Invoke drawing of object on RCanvas sub-pad All existing providers are checked, first checked are cla...
void RegisterFile(const std::string &extension, FileFunc_t func)
static bool IsFileFormatSupported(const std::string &extension)
static Draw7Map_t & GetDraw7Map()
std::function< std::shared_ptr< RElement >(const std::string &, const std::string &)> BrowseNTupleFunc_t
std::function< std::shared_ptr< RElement >(std::unique_ptr< RHolder > &)> BrowseFunc_t
std::multimap< const TClass *, StructBrowse > BrowseMap_t
void RegisterBrowse(const TClass *cl, BrowseFunc_t func)
void RegisterNTupleFunc(BrowseNTupleFunc_t func)
void RegisterClass(const std::string &clname, const std::string &iconname, const std::string &browselib="", const std::string &draw6lib="", const std::string &draw7lib="")
std::function< std::shared_ptr< RElement >(const std::string &)> FileFunc_t
static bool CanHaveChilds(const ClassArg &)
Return true if provided class can have childs.
std::function< bool(TVirtualPad *, std::unique_ptr< RHolder > &, const std::string &)> Draw6Func_t
static BrowseMap_t & GetBrowseMap()
static std::shared_ptr< RElement > OpenFile(const std::string &extension, const std::string &fullname)
std::multimap< const TClass *, StructDraw7 > Draw7Map_t
static Draw6Map_t & GetDraw6Map()
void CleanThis(Map_t &fmap)
std::multimap< const TClass *, StructDraw6 > Draw6Map_t
static const StructClass & GetClassEntry(const ClassArg &)
TClass instances represent classes, structs and namespaces in the ROOT type system.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...