30 return(StatusCode::FAILURE);
35 return(StatusCode::FAILURE);
38 StringProperty containerPrefixProp(
"PoolContainerPrefix",
"CollectionTree");
39 StringProperty containerNameHintProp(
"TopLevelContainerName",
"");
40 StringProperty branchNameHintProp(
"SubLevelBranchName",
"<type>/<key>");
41 if (propertyServer !=
nullptr) {
42 propertyServer->getProperty(&containerPrefixProp).ignore();
43 propertyServer->getProperty(&containerNameHintProp).ignore();
44 propertyServer->getProperty(&branchNameHintProp).ignore();
49 return(StatusCode::SUCCESS);
61 return(POOL_StorageType);
67 bool ownTokAddr =
false;
68 if (tokAddr ==
nullptr || tokAddr->
getToken() ==
nullptr) {
72 GenericAddress* genAddr =
dynamic_cast<GenericAddress*
>(pAddr);
74 ATH_MSG_ERROR(
"Dynamic cast failed in AthenaPoolConverter::createObj");
77 return StatusCode::FAILURE;
83 ::sprintf(
text,
"[CTXT=%08X]",
static_cast<int>(*(pAddr->ipar())));
91 std::string
key = pAddr->par()[1];
100 if (pObj ==
nullptr) {
104 delete tokAddr; tokAddr =
nullptr;
107 if (pObj ==
nullptr) {
108 return(StatusCode::FAILURE);
110 return(StatusCode::SUCCESS);
115 if (
proxy ==
nullptr) {
116 ATH_MSG_ERROR(
"AthenaPoolConverter CreateRep failed to cast DataProxy, key = " << pObj->name());
117 return(StatusCode::FAILURE);
123 return(StatusCode::FAILURE);
127 return(StatusCode::FAILURE);
130 if (pAddr ==
nullptr) {
134 GenericAddress* gAddr =
dynamic_cast<GenericAddress*
>(pAddr);
135 if (gAddr !=
nullptr) {
139 return(StatusCode::SUCCESS);
147 return(StatusCode::FAILURE);
151 return(StatusCode::FAILURE);
153 return(StatusCode::SUCCESS);
157 return(POOL_StorageType);
162 ::
Converter(POOL_StorageType, myCLID, pSvcLocator),
164 name ?
name :
"AthenaPoolConverter"),
165 m_athenaPoolCnvSvc(
"AthenaPoolCnvSvc",
"AthenaPoolConverter"),
169 m_containerPrefix(
""),
170 m_containerNameHint(
""),
171 m_branchNameHint(
""),
172 m_dataObject(nullptr),
173 m_i_poolToken(nullptr) {
179 std::string::size_type pos1 =
output.find(
'[');
180 std::string outputConnectionSpec =
output.substr(0, pos1);
188 std::string containerName;
191 std::size_t colonPos = containerPrefix.find(
':');
192 if (colonPos != std::string::npos) {
193 dhContainerPrefix = containerPrefix.substr(0, colonPos + 1) + dhContainerPrefix;
199 std::string containerFriendPostfix;
200 while (pos1 != std::string::npos) {
201 const std::string::size_type pos2 =
output.find(
'=', pos1);
202 const std::string thisKey =
output.substr(pos1 + 1, pos2 - pos1 - 1);
203 const std::string::size_type pos3 =
output.find(
']', pos2);
204 const std::string
value =
output.substr(pos2 + 1, pos3 - pos2 - 1);
205 if (thisKey ==
"OutputCollection") {
206 dhContainerPrefix =
value;
207 }
else if (thisKey ==
"PoolContainerPrefix") {
208 containerPrefix =
value;
209 }
else if (thisKey ==
"TopLevelContainerName") {
210 containerNameHint =
value;
211 }
else if (thisKey ==
"SubLevelBranchName") {
212 branchNameHint =
value;
213 }
else if (thisKey ==
"PoolContainerFriendPostfix") {
214 containerFriendPostfix =
value;
216 pos1 =
output.find(
'[', pos3);
220 if( tname.compare(0, 10,
"DataHeader") == 0 ) {
221 if( tname.compare(10, 4,
"Form") == 0 ) {
222 containerName = dhContainerPrefix +
"Form" +
"(" + tname +
")";
224 if (
key[
key.size() - 1] ==
'/') {
225 containerName = dhContainerPrefix +
"(" +
key + tname +
")";
227 containerName = dhContainerPrefix +
"(" + tname +
")";
232 else if (tname.compare(0, 13,
"AttributeList") == 0) {
234 if( pool::ROOTRNTUPLE_StorageType.exactMatch(tech) ) {
239 tech = pool::ROOTTREE_StorageType.
type();
245 const std::string typeTok =
"<type>", keyTok =
"<key>";
246 containerName = containerPrefix + containerFriendPostfix + containerNameHint;
247 if (!branchNameHint.empty()) {
248 containerName +=
"(" + branchNameHint +
")";
250 const std::size_t pos1 = containerName.find(typeTok);
251 if (pos1 != std::string::npos) {
252 containerName.replace(pos1, typeTok.size(), tname);
254 const std::size_t pos2 = containerName.find(keyTok);
255 if (pos2 != std::string::npos) {
257 containerName.replace(pos2, keyTok.size(), tname);
259 containerName.replace(pos2, keyTok.size(),
key);
278 ATH_MSG_DEBUG(
"AthenaPoolConverter cleanUp called for base class.");
279 return(StatusCode::SUCCESS);