104 rec.SetField(
"_can_draw",
"false",
kFALSE);
105 rec.SetField(
"_player",
"drawLeafPlayer");
106 rec.SetField(
"_module",
"draw_tree");
125 if (
rec.CanExpandItem()) {
132 rec.SetField(
"_player",
"drawTreePlayerKey");
133 rec.SetField(
"_module",
"draw_tree");
150 rec.SetField(
"_player",
"drawTreePlayer");
151 rec.SetField(
"_module",
"draw_tree");
227 l->Add(
gROOT->GetListOfStreamerInfo()->FindObject(
"TGraph"));
228 l->Add(
gROOT->GetListOfStreamerInfo()->FindObject(
"TH1F"));
229 l->Add(
gROOT->GetListOfStreamerInfo()->FindObject(
"TH1"));
230 l->Add(
gROOT->GetListOfStreamerInfo()->FindObject(
"TNamed"));
231 l->Add(
gROOT->GetListOfStreamerInfo()->FindObject(
"TObject"));
274 const char *
path_ = path.c_str();
284 Info(
"ProduceBinary",
"Non-TObject class not supported");
298 sbuf->MapObject(obj);
308 res.resize(
sbuf->Length());
309 std::copy((
const char *)
sbuf->Buffer(), (
const char *)
sbuf->Buffer() +
sbuf->Length(), res.begin());
326 const char *
path_ = path.c_str();
388 const char *
path_ = path.c_str();
398 Error(
"TRootSniffer",
"Only derived from TObject classes can be drawn");
411 Info(
"TRootSniffer",
"Crate IMAGE directly from pad");
416 Info(
"TRootSniffer",
"Crate IMAGE from object %s", obj->
GetName());
421 if (!options.empty()) {
423 url.SetOptions(options.c_str());
425 Int_t w =
url.GetIntValueFromOptions(
"w");
428 Int_t h =
url.GetIntValueFromOptions(
"h");
498 const char *
path_ = path.c_str();
528 debug->append(
"Item name not specified\n");
529 return debug !=
nullptr;
532 const char *
path_ = path.c_str();
541 return debug !=
nullptr;
544 url.SetOptions(options.c_str());
589 debug->append(
"Method not found\n");
590 return debug !=
nullptr;
596 debug->append(
"Server runs in read-only mode, method cannot be executed\n");
597 return debug !=
nullptr;
600 debug->append(
"Server runs in read-only mode, function cannot be executed\n");
601 return debug !=
nullptr;
604 debug->append(
"For that special method server allows access even read-only mode is specified\n");
616 while (
auto arg =
static_cast<TMethodArg *
>(next())) {
618 if ((
strcmp(arg->GetName(),
"rest_url_opt") == 0) && (
strcmp(arg->GetFullTypeName(),
"const char*") == 0) &&
622 const char *pos =
strstr(options.c_str(),
"method=");
624 return debug !=
nullptr;
634 const char *val =
url.GetValueFromOptions(arg->GetName());
640 if (
sval ==
"_this_") {
652 if (
url.HasOption(
"_destroy_post_"))
662 if (
url.HasOption(
"_destroy_post_"))
679 if (
url.HasOption(
"_destroy_post_"))
687 }
else if (
sval ==
"_post_data_")
689 else if (
sval ==
"_post_length_")
696 if (
sval.IsNull() && arg->GetDefault())
697 sval = arg->GetDefault();
701 TString::Format(
" Argument:%s Type:%s Value:%s \n", arg->GetName(), arg->GetFullTypeName(),
sval.Data())
708 (
strcmp(arg->GetFullTypeName(),
"Option_t*") == 0) ||
709 (
strcmp(arg->GetFullTypeName(),
"string") == 0);
728 if (std::isalnum(
sval[i]) || std::strchr(
".:+-",
sval[i]))
756 debug->append(
"Fail: invalid TMethodCall\n");
757 return debug !=
nullptr;
761 if (
url.GetValueFromOptions(
"compact"))
762 compact =
url.GetIntValueFromOptions(
"compact");
783 res.
Form(
"%zd", (
size_t)
l);
804 if (
txt !=
nullptr) {
853 if (obj ==
nullptr) {
887 debug->append(
"Destroy result object at the end\n");
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
float Size_t
Attribute size (float)
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
const_iterator begin() const
A TTree is a list of TBranches.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
void MapObject(const TObject *obj, UInt_t offset=1) override
Add object to the fMap container.
static TObject * ConvertFromJSON(const char *str)
Read TObject-based class from JSON, produced by ConvertToJSON() method.
static TString ConvertToJSON(const TObject *obj, Int_t compact=0, const char *member_name=nullptr)
Converts object, inherited from TObject class, to JSON string Lower digit of compact parameter define...
static const char * GetFloatFormat()
return current printf format for float members, default "%e"
static TString ConvertToXML(const TObject *obj, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Converts object, inherited from TObject class, to XML string GenericLayout defines layout choice for ...
static TObject * ConvertFromXML(const char *str, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Read object from XML, produced by ConvertToXML() method.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
All ROOT classes may have RTTI (run time type identification) support added.
TDirectory::TContext keeps track and restore the current directory.
std::enable_if_t<!std::is_base_of< TObject, T >::value, Int_t > WriteObject(const T *obj, const char *name, Option_t *option="", Int_t bufsize=0)
Write an object with proper type checking.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
virtual void WriteStreamerInfo()
Write the list of TStreamerInfo as a single object in this file The class Streamer description for al...
virtual TList * GetStreamerInfoList() final
Read the list of TStreamerInfo objects written to this file.
Global functions class (global functions are obtained from CINT).
virtual const char * GetPrototype() const
Returns the prototype of a function as defined by CINT, or 0 in case of error.
TList * GetListOfMethodArgs()
Return list containing the TMethodArgs of a TFunction.
std::string GetReturnTypeNormalizedName() const
Get the normalized name of the return type.
A TGraph is an object made of two arrays X and Y with npoints each.
void SetName(const char *name="") override
Set graph name.
1-D histogram with a float per channel (see TH1 documentation)
const void * GetPostData() const
return pointer on posted with request data
void SetExtraHeader(const char *name, const char *value)
add extra http header value to the reply
Long_t GetPostDataLength() const
return length of posted with request data
An abstract interface to image processing library.
static TImage * Create()
Create an image.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual const char * GetClassName() const
virtual TObject * ReadObj()
To read a TObject* from the file.
TClass * IsA() const override
A TMemFile is like a normal TFile except that it reads and writes only from memory.
Each ROOT method (see TMethod) has a linked list of its arguments.
Method or function calling interface.
EReturnType ReturnType()
Returns the return type of the method.
static const EReturnType kLong
static const EReturnType kString
static const EReturnType kOther
static const EReturnType kNone
void Execute(const char *, const char *, int *=nullptr) override
Execute method on this object with the given parameter string, e.g.
Bool_t IsValid() const
Return true if the method call has been properly initialized and is usable.
static const EReturnType kDouble
Each ROOT class (see TClass) has a linked list of methods.
The TNamed class is the base class for all named ROOT classes.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TClass * IsA() const
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
The most important graphics class in the ROOT system.
void * FindInHierarchy(const char *path, TClass **cl=nullptr, TDataMember **member=nullptr, Int_t *chld=nullptr) override
Search element with specified path.
Bool_t IsStreamerInfoItem(const char *itemname) override
Return true if it is streamer info item name.
static Bool_t IsDrawableClass(TClass *cl)
return true if given class can be drawn in JSROOT
Bool_t ProduceExe(const std::string &path, const std::string &options, Int_t reskind, std::string &res) override
Execute command for specified object.
TList * fSinfo
! last produced streamer info
TRootSnifferFull(const char *name="sniff", const char *objpath="Objects")
constructor
Bool_t CanDrawClass(TClass *cl) override
void ScanObjectProperties(TRootSnifferScanRec &rec, TObject *obj) override
Scans object properties.
virtual ~TRootSnifferFull()
destructor
void ScanObjectChilds(TRootSnifferScanRec &rec, TObject *obj) override
Scans object childs (if any)
Bool_t ProduceRootFile(const std::string &path, const std::string &options, std::string &res) override
Produce ROOT file for specified item.
ULong_t GetItemHash(const char *itemname) override
Get hash function for specified item.
Bool_t ProduceImage(Int_t kind, const std::string &path, const std::string &options, std::string &res) override
Method to produce image from specified object.
Bool_t CallProduceImage(const std::string &kind, const std::string &path, const std::string &options, std::string &res) override
Invokes TRootSniffer::ProduceIamge, converting kind into TImage::EImageFileTypes type.
Bool_t ProduceXml(const std::string &path, const std::string &options, std::string &res) override
Produce XML data for specified item.
void CreateMemFile()
Creates TMemFile instance, which used for objects streaming.
Bool_t ProduceBinary(const std::string &path, const std::string &options, std::string &res) override
Produce binary data for specified item.
TMemFile * fMemFile
! file used to manage streamer infos
ULong_t GetStreamerInfoHash() override
Returns hash value for streamer infos.
void ScanKeyProperties(TRootSnifferScanRec &rec, TKey *key, TObject *&obj, TClass *&obj_class) override
Scans TKey properties.
Structure used to scan hierarchies of ROOT objects.
Sniffer of ROOT objects, data provider for THttpServer.
virtual void ScanObjectChilds(TRootSnifferScanRec &rec, TObject *obj)
scans object childs (if any) here one scans collection, branches, trees and so on
TString fCurrentAllowedMethods
! list of allowed methods, extracted when analyzed object restrictions
virtual void ScanKeyProperties(TRootSnifferScanRec &rec, TKey *key, TObject *&obj, TClass *&obj_class)
Scans TKey properties in special cases load objects from the file.
Bool_t fAllowPostObject
! when true allow to deserialize objects received via POST requests
virtual void ScanObjectProperties(TRootSnifferScanRec &rec, TObject *obj)
Scans object properties here such fields as _autoload or _icon properties depending on class or objec...
TString DecodeUrlOptionValue(const char *value, Bool_t remove_quotes=kTRUE)
Method replaces all kind of special symbols, which could appear in URL options.
virtual ULong_t GetItemHash(const char *itemname)
Get hash function for specified item used to detect any changes in the specified object.
Bool_t fReadOnly
! indicate if sniffer allowed to change ROOT structures - like read objects from file
THttpCallArg * fCurrentArg
! current http arguments (if any)
virtual void * FindInHierarchy(const char *path, TClass **cl=nullptr, TDataMember **member=nullptr, Int_t *chld=nullptr)
Search element with specified path Returns pointer on element Optionally one could obtain element cla...
Int_t fCurrentRestrict
! current restriction for last-found object
void ScanCollection(TRootSnifferScanRec &rec, TCollection *lst, const char *foldername=nullptr, TCollection *keys_lst=nullptr)
Scan collection content.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
A TTree represents a columnar dataset.
This class represents a WWW compatible URL.
small helper class to store/restore gPad context in TPad methods