This class provides the AthenaSerializeSvc using ROOT.
More...
#include <AthenaRootSerializeSvc.h>
|
| | AthenaRootSerializeSvc (const std::string &name, ISvcLocator *pSvcLocator) |
| | Standard Service Constructor.
|
| virtual | ~AthenaRootSerializeSvc () |
| | Destructor.
|
| virtual StatusCode | initialize () override |
| | Gaudi Service Interface method implementations:
|
| virtual void * | serialize (const void *object, const std::string &name, size_t &nbytes) const override |
| virtual void * | serialize (const void *object, const Guid &id, size_t &nbytes) const override |
| virtual void * | serialize (const void *object, const RootType &cltype, size_t &nbytes) const override |
| virtual void * | deserialize (void *buffer, size_t &nbytes, const std::string &name) const override |
| virtual void * | deserialize (void *buffer, size_t &nbytes, const Guid &id) const override |
| virtual void * | deserialize (void *buffer, size_t &nbytes, const RootType &cltype) const override |
This class provides the AthenaSerializeSvc using ROOT.
Definition at line 19 of file AthenaRootSerializeSvc.h.
◆ AthenaRootSerializeSvc()
| AthenaRootSerializeSvc::AthenaRootSerializeSvc |
( |
const std::string & | name, |
|
|
ISvcLocator * | pSvcLocator ) |
◆ ~AthenaRootSerializeSvc()
| AthenaRootSerializeSvc::~AthenaRootSerializeSvc |
( |
| ) |
|
|
virtual |
◆ deserialize() [1/3]
| void * AthenaRootSerializeSvc::deserialize |
( |
void * | buffer, |
|
|
size_t & | nbytes, |
|
|
const Guid & | id ) const |
|
overridevirtual |
Definition at line 62 of file AthenaRootSerializeSvc.cxx.
62 {
64}
virtual void * deserialize(void *buffer, size_t &nbytes, const std::string &name) const override
static const TypeH forGuid(const Guid &info)
Access classes by Guid.
◆ deserialize() [2/3]
| void * AthenaRootSerializeSvc::deserialize |
( |
void * | buffer, |
|
|
size_t & | nbytes, |
|
|
const RootType & | cltype ) const |
|
overridevirtual |
Definition at line 67 of file AthenaRootSerializeSvc.cxx.
67 {
70 obj =
new char[nbytes];
71 std::memcpy(obj, buffer, nbytes);
72 }
else if (cltype.
Name() ==
"Token") {
73 obj =
new char[nbytes];
74 std::memcpy(obj, buffer, nbytes);
static_cast<char*
>(
obj)[nbytes - 1] = 0;
75 } else {
76 TBufferFile readBuffer(TBuffer::kRead, nbytes, buffer, kFALSE);
77 obj = readBuffer.ReadObjectAny(cltype);
78 nbytes = readBuffer.Length();
79 }
80 return(obj);
81}
Bool_t IsFundamental() const
std::string Name(unsigned int mod=Reflex::SCOPED) const
◆ deserialize() [3/3]
| void * AthenaRootSerializeSvc::deserialize |
( |
void * | buffer, |
|
|
size_t & | nbytes, |
|
|
const std::string & | name ) const |
|
overridevirtual |
◆ initialize()
| StatusCode AthenaRootSerializeSvc::initialize |
( |
| ) |
|
|
overridevirtual |
◆ serialize() [1/3]
| void * AthenaRootSerializeSvc::serialize |
( |
const void * | object, |
|
|
const Guid & | id, |
|
|
size_t & | nbytes ) const |
|
overridevirtual |
Definition at line 42 of file AthenaRootSerializeSvc.cxx.
42 {
44}
virtual void * serialize(const void *object, const std::string &name, size_t &nbytes) const override
◆ serialize() [2/3]
| void * AthenaRootSerializeSvc::serialize |
( |
const void * | object, |
|
|
const RootType & | cltype, |
|
|
size_t & | nbytes ) const |
|
overridevirtual |
Definition at line 47 of file AthenaRootSerializeSvc.cxx.
47 {
48 TBufferFile writeBuffer(TBuffer::kWrite);
49 writeBuffer.WriteObjectAny(object, cltype);
50 void*
buffer = writeBuffer.Buffer();
51 nbytes = writeBuffer.Length();
52 writeBuffer.ResetBit(TBuffer::kIsOwner); writeBuffer.SetBuffer(nullptr);
53 return(buffer);
54}
◆ serialize() [3/3]
| void * AthenaRootSerializeSvc::serialize |
( |
const void * | object, |
|
|
const std::string & | name, |
|
|
size_t & | nbytes ) const |
|
overridevirtual |
◆ SvcFactory< AthenaRootSerializeSvc >
The documentation for this class was generated from the following files: