Print object.
319 {
321
323
324 if (this->count(object.getTypename()) != 0) {
325
326 this->
print(out, prefix,
object.getTypename(),
object.getAddress());
327
328 } else if (object.getClass() != NULL) {
329
330 if (object.getClass() == TArray::Class()) {
331
332 TArray* p = (TArray*) (object.getAddress());
333
334 if (p->GetSize() == 0) {
335 out << prefix << " <" << p->IsA()->GetName() << "> " << "{}" << endl;
336 } else {
337 print<TArrayC>(out, prefix, p);
338 print<TArrayS>(out, prefix, p);
339 print<TArrayI>(out, prefix, p);
340 print<TArrayL>(out, prefix, p);
341 print<TArrayF>(out, prefix, p);
342 print<TArrayD>(out, prefix, p);
343 }
344
345 } else if (object.getClass() == TList::Class()) {
346
347 int i = 0;
348
349 for (TIter next((TList*)
object.getAddress());
const TObject *
p1 = (
const TObject*) next(); ++i) {
350 print(out, prefix +
"[" +
to_string(i) +
"]", JRootWritableClass(
p1->IsA(), (
const char*)
p1));
351 }
352
353 } else if (object.getClass()->GetCollectionProxy() != NULL) {
354
355 unique_ptr<TVirtualCollectionProxy>
p1(
object.getClass()->GetCollectionProxy()->Generate());
356
357 p1->PushProxy(
const_cast<char*
>(
object.getAddress()));
358
359 if (
p1->GetValueClass() == NULL) {
360 for (UInt_t i = 0; i !=
p1->Size(); ++i) {
361 this->
print(out, prefix +
"[" +
to_string(i) +
"]", TDataType::GetTypeName(
p1->GetType()), (
const char*)
p1->At(i));
362 }
363 } else {
364 for (UInt_t i = 0; i !=
p1->Size(); ++i) {
365 this->
print(out, prefix +
"[" +
to_string(i) +
"]",
p1->GetValueClass()->GetStreamerInfo(), (
const char*)
p1->At(i));
366 }
367 }
368
369 } else {
370
371 if (object.getClass()->GetListOfBases() != NULL) {
372
373 for (TIter next(
object.getClass()->GetListOfBases());
const TBaseClass *
p1 = (
const TBaseClass*) next(); ) {
374
376 this->
print(out, prefix,
object.get(*
p1));
377 }
378 }
379 }
380
381 if (object.getClass()->GetListOfDataMembers() != NULL) {
382
383 if (!object.getClass()->InheritsFrom(TClass::GetClass<TArray>())) {
384
385 for (TIter next(
object.getClass()->GetListOfDataMembers());
const TDataMember *
p1 = (
const TDataMember*) next(); ) {
386
388
389 if (!
p1->IsEnum() &&
p1->IsPersistent()) {
390 this->
print(out, prefix +
"." +
p1->GetName(),
object.get(*
p1));
391 }
392 }
393 }
394 }
395 }
396 }
397 }
398 }
399 }
std::string to_string(const T &value)
Convert value to string.
bool is_valid(const json &js)
Check validity of JSon data.
static bool is_class(const char *const name)
Check name of class against internal ROOT class names.
static bool is_static(const TDataMember &object)
Check if data member is static.