Hi,
I’m working on development a framework using ROOT I/O.
And I have some difficulties to convert from TMessage to user-defined class.
Here’s my test code to convert from TMessage to user-defined class
[code]MyClass* outevt = new MyClass();
outevt->Print();
msg->Print();
outevt = (MyEvent*)msg->ReadObjectAny(MyEvent::Class());
outevt->Print();[/code]
And here’s the result including error
[code]OBJ: MyEvent MyEvent Simple event class
OBJ: TMessage TMessage Message buffer class
*** Break *** segmentation violation
Using host libthread_db library “/lib/tls/libthread_db.so.1”.
Attaching to program: /proc/5225/exe, process 5225
[Thread debugging using libthread_db enabled]
[New Thread -1218586048 (LWP 5225)]
0x04f8051e in __waitpid_nocancel () from /lib/tls/libc.so.6
Thread 1 (Thread -1218586048 (LWP 5225)):
#0 0x04f8051e in __waitpid_nocancel () from /lib/tls/libc.so.6
#1 0x04f151d4 in do_system () from /lib/tls/libc.so.6
#2 0x00232d7f in system () from /lib/tls/libpthread.so.0
#3 0x004c36f9 in TUnixSystem::Exec () from /root/lib/libCore.so
#4 0x004c3b29 in TUnixSystem::StackTrace ()
from /root/lib/libCore.so
#5 0x004c1c1f in TUnixSystem::DispatchSignals ()
from /root/lib/libCore.so
#6 0x004bfd17 in SigHandler () from /root/lib/libCore.so
#7 0x004c635b in sighandler () from /root/lib/libCore.so
#8
#9 0x0804e47e in main (argc=2, argv=0xbfffc174) at main.cc:94[/code]
Is there any wrong syntax to use TMessage::ReadObjectAny() function?
After using it, I can’t access any member function of MyClass.
(When I try to use, it makes segmentation violation)
I need your help please.
Best Regards,