30 using SG::AuxStoreInternal::addVector;
40 TClass* holderTC = cl->GetBaseClass(
"SG::IAuxStoreHolder");
41 if (holderTC ==
nullptr) {
42 return(StatusCode::FAILURE);
45 if (storeHolder ==
nullptr) {
46 return(StatusCode::FAILURE);
49 std::unique_ptr<AthenaPoolAuxStore> storeInt = std::make_unique<AthenaPoolAuxStore>(standalone);
51 void* nameData =
nullptr;
54 while (
m_ipcTool->getObject(&nameData, nbytes, num).isSuccess() && nbytes > 0) {
55 const char* del1 =
static_cast<const char*
>(std::memchr(nameData,
'\n', nbytes));
56 if (del1 ==
nullptr)
continue;
57 const char* del2 =
static_cast<const char*
>(std::memchr(del1 + 1,
'\n', nbytes - (del1 -
static_cast<const char*
>(nameData) + 1)));
58 if (del2 ==
nullptr)
continue;
59 const std::string dataStr(
static_cast<const char*
>(nameData));
60 const std::string& attrName = dataStr.substr(0, del1 -
static_cast<const char*
>(nameData));
61 const std::string& typeName = dataStr.substr(del1 -
static_cast<const char*
>(nameData) + 1, del2 - del1 - 1);
62 const std::string& elemName = dataStr.substr(del2 -
static_cast<const char*
>(nameData) + 1, nbytes - (del2 -
static_cast<const char*
>(nameData) + 1));
63 void* buffer =
nullptr;
64 if (
m_ipcTool->getObject(&buffer, nbytes, num).isSuccess()) {
74 }
catch (
const std::runtime_error&) {
80 void* dynAttr =
nullptr;
81 if (
type.IsFundamental()) {
82 dynAttr =
new char[nbytes];
83 std::memcpy(dynAttr, buffer, nbytes); buffer =
nullptr;
85 dynAttr =
m_serSvc->deserialize(buffer, nbytes,
type); buffer =
nullptr;
87 if (storeInt->standalone()) {
88 (void)storeInt->getData(auxid, 1, 1);
92 if (
type.IsFundamental()) {
93 delete [] (
char*)dynAttr; dynAttr =
nullptr;
95 type.Destruct(dynAttr); dynAttr =
nullptr;
99 std::unique_ptr<SG::IAuxTypeVector>
vec(registry.
makeVectorFromData(auxid, dynAttr,
nullptr,
false,
true));
100 storeInt->addVector(std::move(
vec),
false);
105 storeHolder->
setStore(storeInt.release());
106 return(StatusCode::SUCCESS);
111 const std::string& classId,
112 const std::string& contName,
114 TClass* storeTC = cl->GetBaseClass(
"SG::IAuxStoreIO");
115 if (storeTC ==
nullptr) {
116 return(StatusCode::SUCCESS);
119 if (store ==
nullptr) {
120 return(StatusCode::FAILURE);
123 if (!auxIDs.empty()) {
124 if (!
m_ipcTool->putObject(classId.c_str(), classId.size() + 1, num).isSuccess()) {
125 return(StatusCode::FAILURE);
127 if (!
m_ipcTool->putObject(contName.c_str(), contName.size() + 1, num).isSuccess()) {
128 return(StatusCode::FAILURE);
132 const std::type_info* typePtr = store->getIOType(auxid);
133 if (typePtr ==
nullptr)
continue;
135 if (!
m_ipcTool->putObject(dataStr.c_str(), dataStr.size() + 1, num).isSuccess()) {
136 return(StatusCode::FAILURE);
138 const std::type_info* tip = store->getIOType(auxid);
139 if (tip ==
nullptr) {
140 return(StatusCode::FAILURE);
143 StatusCode
sc = StatusCode::FAILURE;
144 if (
type.IsFundamental()) {
145 sc =
m_ipcTool->putObject(store->getIOData(auxid),
type.SizeOf(), num);
148 void* buffer =
m_serSvc->serialize(store->getIOData(auxid),
type, nbytes);
150 delete []
static_cast<char*
>(buffer); buffer =
nullptr;
152 if (!
sc.isSuccess()) {
153 return(StatusCode::FAILURE);
156 return(StatusCode::SUCCESS);
This file contains the class definition for the AuxDiscoverySvc class.
An auxiliary data store that holds data internally.
Handle mappings between names and auxid_t.
Make an AuxVectorData object from either a raw vector or an aux store.
std::vector< size_t > vec
Interface providing I/O for a generic auxiliary store.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
AthenaPoolAuxStore(bool standalone)
AuxDiscoverySvc(const IAthenaSerializeSvc *serSvc, IAthenaIPCTool *ipcTool)
StatusCode receiveStore(TClass *cl, void *obj, int num=0)
Receive dynamic aux store variables from streaming tool.
StatusCode sendStore(TClass *cl, const void *obj, const std::string &classId, const std::string &contName, int num=0)
Send dynamic aux store variables to streaming tool.
const IAthenaSerializeSvc * m_serSvc
IAthenaIPCTool * m_ipcTool
const std::type_info * getTypeInfo() const
Return the type_info for the described type.
Handle mappings between names and auxid_t.
SG::auxid_t findAuxID(const std::string &name, const std::string &clsname="") const
Look up a name -> auxid_t mapping.
std::unique_ptr< IAuxTypeVector > makeVectorFromData(SG::auxid_t auxid, void *data, IAuxTypeVector *linkedVector, bool isPacked, bool ownFlag) const
Construct an IAuxTypeVector object from a vector.
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
std::string getTypeName(SG::auxid_t auxid) const
Return the type name of an aux data item.
void copy(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const
Copy elements between vectors.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Make an AuxVectorData object from either a raw array or an aux store.
Interface for objects taking part in direct ROOT I/O.
@ AST_ObjectStore
The store describes a single object.
virtual AuxStoreType getStoreType() const =0
Return the type of the store object.
virtual void setStore(IAuxStore *store)=0
Give an auxiliary store object to the holder object.
Interface providing I/O for a generic auxiliary store.
A set of aux data identifiers.
Find the auxid for a dynamic branch.
std::string normalizedTypeinfoName(const std::type_info &info)
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
static const auxid_t null_auxid
To signal no aux data item.
SG::auxid_t getDynamicAuxID(const std::type_info &ti, const std::string &name, const std::string &elementTypeName, const std::string &branch_type_name, bool standalone, SG::auxid_t linked_auxid)
Find the auxid for a dynamic branch.
AuxStoreInternal(bool standalone=false)
An auxiliary data store that holds data internally.
size_t auxid_t
Identifier for a particular aux data item.
Convert a type_info to a normalized string representation (matching the names used in the root dictio...