Commit b8e0593b authored by Joerg Stelzer's avatar Joerg Stelzer Committed by Graeme Stewart
Browse files

TrigSerializeConverter.h: switch to normalized class names (which match...

TrigSerializeConverter.h: switch to normalized class names (which match (TrigSerializeCnvSvc-00-00-38)

2014-11-04 Joerg Stelzer <stelzer@cern.ch>
	* TrigSerializeConverter.h: switch to normalized class names (which match
	the name in the dictionary)
	* TrigSerializeCnvSvc-00-00-38

2014-10-16  Marcin Nowak  <Marcin.Nowak@cern.ch>
	* src\TrigSerializeGuidHelper.cxx: merge with 00-00-35-02
	* tagging as TrigSerializeCnvSvc-00-00-37

2014-08-29 Lukas Heinrich <lukas.heinrich@cern.ch>
        * remap to dict name also when getting GUID
        * tagging TrigSerializeCnvSvc-00-00-35-02

2014-08-13  Marcin Nowak  <Marcin.Nowak@cern.ch>
	* migrate Reflex to ROOT6
	* tagging as TrigSerializeCnvSvc-00-00-36

2014-08-29 Lukas Heinrich <lukas.heinrich@cern.ch>
parent 9ea9871b
......@@ -12,7 +12,7 @@
#include "GaudiKernel/ToolHandle.h"
#include "GaudiKernel/ServiceHandle.h"
#include "CLIDSvc/tools/ClassID_traits.h"
#include "SGTools/ClassID_traits.h"
#include "SGTools/StorableConversions.h"
#include "StoreGate/StoreGateSvc.h"
......@@ -20,6 +20,8 @@
#include "TrigSerializeCnvSvc/ITrigSerConvHelper.h"
#include "TrigSerializeCnvSvc/TrigSerializeCnvSvc.h"
#include "AthContainers/normalizedTypeinfoName.h"
#include <memory>
......@@ -113,24 +115,29 @@ public:
// tran->per
StatusCode createRep( DataObject* pObj, IOpaqueAddress*& pAddr ) {
const std::string clname = ClassID_traits<DATA>::typeName();
// const std::string clname = ClassID_traits<DATA>::typeName(); // old style, does not contain the _vX of the actual class type
// const std::type_info& typeId = ClassID_traits<DATA>::typeId(); // damn, this line just does not compile
std::string classname = SG::normalizedTypeinfoName( typeid(DATA) ); // normalized string representation (matching the names used in the root dictionary)
DATA *d( 0 );
SG::fromStorable( pObj, d );
if( m_log->level() <= MSG::DEBUG ) {
*m_log << MSG::DEBUG << "My createRep for " << classID() << " "
<< clname << endreq;
<< classname << endreq;
}
void *serptr = d;
//
std::vector< uint32_t > ser;
StatusCode sc = m_convHelper->createRep( clname, serptr, ser, typeIsxAOD);
StatusCode sc = m_convHelper->createRep( classname, serptr, ser, typeIsxAOD);
if( m_log->level() <= MSG::DEBUG ) {
*m_log << MSG::DEBUG << "convHelper " << ser.size() << endreq;
}
TrigStreamAddress *addr = new TrigStreamAddress( classID(), clname, "" );
TrigStreamAddress *addr = new TrigStreamAddress( classID(), classname, "" );
addr->add( ser );
pAddr = addr;
......
......@@ -4,18 +4,17 @@ use AtlasPolicy AtlasPolicy-*
use GaudiInterface GaudiInterface-* External
use AthenaBaseComps AthenaBaseComps-* Control
use CLIDSvc CLIDSvc-* Control
use SGTools SGTools-* Control
use StoreGate StoreGate-* Control
use AthContainers AthContainers-* Control
apply_pattern dual_use_library files=*.cxx
private
use AtlasROOT AtlasROOT-* External
use AtlasPOOL AtlasPOOL-* External
use AtlasReflex AtlasReflex-* External
use AthenaKernel AthenaKernel-* Control
use DataModelRoot DataModelRoot-* Control
use PersistentDataModel PersistentDataModel-* Database
use TrigSerializeResult TrigSerializeResult-* Trigger/TrigDataAccess
......
......@@ -18,12 +18,6 @@
#include "TROOT.h"
#include "TClass.h"
//
#include "Reflex/Reflex.h"
#include "StorageSvc/DbReflex.h"
using ROOT::Reflex::Type;
using ROOT::Reflex::PropertyList;
TrigSerializeConvHelper::TrigSerializeConvHelper(const std::string& toolname, const std::string& type, const IInterface* parent) :
AthAlgTool(toolname, type, parent),
......
......@@ -5,13 +5,9 @@
#include "TrigSerializeGuidHelper.h"
#include "PersistentDataModel/Guid.h"
#include "Reflex/Reflex.h"
#include "DataModelRoot/RootType.h"
#include "StorageSvc/DbReflex.h"
using ROOT::Reflex::Type;
using ROOT::Reflex::PropertyList;
TrigSerializeGuidHelper::TrigSerializeGuidHelper(const std::string& name, const std::string& type,
......@@ -26,28 +22,30 @@ TrigSerializeGuidHelper::~TrigSerializeGuidHelper(){
}
namespace TrigSerializeResult {
std::string remapToDictName(const std::string &s);
}
StatusCode TrigSerializeGuidHelper::ClassNameToInts(const std::string &clname, uint32_t *iarr){
iarr[0] = iarr[1] = iarr[2] = iarr[3] = 0;
Type t = Type::ByName(clname);
PropertyList pl = t.Properties();
std::string cl = TrigSerializeResult::remapToDictName(clname);
RootType t = RootType::ByName(cl);
RootPropertyList pl = t.Properties();
if (pl.HasProperty("ClassID")){
if (msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) << clname << " has " << "ClassID" << endreq;
size_t idx = pl.KeyByName("ClassID");
std::string gecko = pl.PropertyAsString(idx);
if (msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) << "Index retrieval got: " << pl.KeyAt(idx)
<< " with " << gecko << endreq;
const Guid guid(gecko);
iarr[0] = guid.data1();
iarr[1] = guid.data2() << 16 | guid.data3();
iarr[2] = guid.data4(0) << 24 | guid.data4(1) << 16 | guid.data4(2) << 8 | guid.data4(3);
iarr[3] = guid.data4(4) << 24 | guid.data4(5) << 16 | guid.data4(6) << 8 | guid.data4(7);
std::string gecko = pl.PropertyAsString("ClassID");
if (msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) << clname << " to ROOT known as " << cl << " has " << "ClassID=" << gecko << endreq;
const Guid guid(gecko );
iarr[0] = guid.data1();
iarr[1] = guid.data2() << 16 | guid.data3();
iarr[2] = guid.data4(0) << 24 | guid.data4(1) << 16 | guid.data4(2) << 8 | guid.data4(3);
iarr[3] = guid.data4(4) << 24 | guid.data4(5) << 16 | guid.data4(6) << 8 | guid.data4(7);
}
else{
msg(MSG::WARNING) << "property list has no ClassID for class name " << clname << endreq;
msg(MSG::WARNING) << "property list has no ClassID for class name " << clname << " aka (" << cl << ")" << endreq;
return StatusCode::FAILURE;
}
......@@ -71,13 +69,15 @@ StatusCode TrigSerializeGuidHelper::IntsToClassName(const uint32_t *iarr, std::s
if (msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) << "constructed " << guid.toString() << " from ints" << endreq;
ROOT::Reflex::Type cltype(pool::DbReflex::forGuid(guid));
RootType cltype(pool::DbReflex::forGuid(guid));
clname = cltype.Name();
clname = cltype.Name(Reflex::SCOPED);
/*
std::string scope = cltype.DeclaringScope().Name();
if (!scope.empty()) {
clname = scope+"::"+clname;
}
*/
if (msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) << "corresponds to " << clname << endreq;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment