BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
HltProcessor::MyFrame Class Reference

#include <MyFrame.h>

Public Member Functions

void init (const std::string, const std::string)
 
void makeTableVector ()
 
void final ()
 
const std::vector< std::pair< Signature *, Sequence * > > & getTablesVector () const
 
const double DOMToDouble (const XMLCh *thisDOMString) const
 

Static Public Member Functions

static MyFrameinstance ()
 
static void destruct ()
 

Protected Member Functions

 MyFrame ()
 
 ~MyFrame ()
 

Detailed Description

Definition at line 34 of file MyFrame.h.

Constructor & Destructor Documentation

◆ MyFrame()

HltProcessor::MyFrame::MyFrame ( )
protected

Definition at line 33 of file MyFrame.cxx.

33 :
34 m_FrameNumSequenceTables(0),m_FrameNumTables(0),
35 m_FrameAbsolutMaxStep(0),
36 m_Signature_DocNode(NULL), m_Sequence_DocNode(NULL),
37 m_SignatureVec(0),m_SequenceVec(0),m_TableVector(0),
38 m_idSequence(0),m_idSignature(0),m_idCriteria(0),m_idItem(0),
39 m_first(true)
40{
41 if(s_FrameInstance){
42 std::cout << " MyFrame constructed twice!"<< std::endl;
43 }
44 s_FrameInstance=this;
45 m_thisName = "HltConfig";
46 m_msgSvcProvider = MessageSvcProvider::instance();
47}
#define NULL
static MessageSvcProvider * instance()

Referenced by instance().

◆ ~MyFrame()

HltProcessor::MyFrame::~MyFrame ( )
protected

Definition at line 50 of file MyFrame.cxx.

51{
52 for (unsigned int i = 0; i < m_SignatureVec.size(); i++) delete m_SignatureVec[i];
53 for (unsigned int j = 0; j < m_SequenceVec.size(); j++) delete m_SequenceVec[j];
54 //destruct();
55}

Member Function Documentation

◆ destruct()

void HltProcessor::MyFrame::destruct ( )
static

Definition at line 28 of file MyFrame.cxx.

28 {
29 if (s_FrameInstance) delete s_FrameInstance;
30}

◆ DOMToDouble()

const double HltProcessor::MyFrame::DOMToDouble ( const XMLCh * thisDOMString) const

Definition at line 395 of file MyFrame.cxx.

396{
397 double returnValue(0);
398 std::string helpString(XMLString::transcode(thisDOMString));
399 std::istringstream is(helpString);
400 is >> returnValue;
401 return returnValue;
402}

◆ final()

void HltProcessor::MyFrame::final ( )

Definition at line 186 of file MyFrame.cxx.

187{
188 /*zoujh:MsgStream log(m_msgSvcProvider->msgSvc(), m_thisName);
189 log << MSG::INFO << endreq;
190 log << MSG::INFO << "***" << endreq;
191 log << MSG::INFO << "Finalizing XML." << endreq;
192 log << MSG::INFO << "***" << endreq;*/
193 //m_msgSvcProvider=0;
194 // Call the XML termination method
195 XMLPlatformUtils::Terminate();
196}

Referenced by HltConfigSvc::handle(), and HltConfigSvc::initialize().

◆ getTablesVector()

const std::vector< std::pair< Signature *, Sequence * > > & HltProcessor::MyFrame::getTablesVector ( ) const

Definition at line 390 of file MyFrame.cxx.

391{
392 return m_TableVector;
393}

Referenced by HltConfigSvc::retrieve().

◆ init()

void HltProcessor::MyFrame::init ( const std::string sequenceFile,
const std::string signatureFile )

Definition at line 58 of file MyFrame.cxx.

59{
60 //if(m_msgSvcProvider==0)m_msgSvcProvider = MessageSvcProvider::instance();
61 //MsgStream log(m_msgSvcProvider->msgSvc(), m_thisName);
62 //MsgStream log(messageService(),name());
63 //std::cout<<"@@@@@@@@@@@@@@@@@@@1"<<std::endl;
64 try {
65 XMLPlatformUtils::Initialize();
66 //log << MSG::INFO << "MyFrame : Initialized XML!" << endreq;
67 }
68
69 catch (const XMLException& toCatch) {
70 //log << MSG::ERROR << "MyFrame : Init failed!" << endreq;
71 exit(1);
72 }
73 //std::cout<<"@@@@@@@@@@@@@@@@@@@2"<<std::endl;
74 // Instantiate DOM parser for signature XML file.
75 XercesDOMParser* signatureParser = new XercesDOMParser;
76 signatureParser->setValidationScheme(XercesDOMParser::Val_Always); // optional.
77 signatureParser->setDoNamespaces(true); // optional
78
79 // Instantiate DOM parser for sequence XML file.
80 XercesDOMParser* sequenceParser = new XercesDOMParser;
81 sequenceParser->setValidationScheme(XercesDOMParser::Val_Always); // optional.
82 sequenceParser->setDoNamespaces(true); // optional
83
84 // Now try to parse.
85 try {
86 signatureParser->parse(signatureFile.c_str());
87 //zoujh:log << MSG::INFO << "Parsing " << signatureFile.c_str() << endreq;
88
89 sequenceParser->parse(sequenceFile.c_str());
90 //zoujh:log << MSG::INFO << "Parsing " << sequenceFile.c_str() << endreq;
91 }
92
93 catch (const XMLException& toCatch) {
94 //log << MSG::ERROR << "Error 1" << endreq;
95 exit(1);
96 }
97 catch (const DOMException& toCatch) {
98 //log << MSG::ERROR << "Error 4" << endreq;
99 XMLPlatformUtils::Terminate();
100 exit(1);
101 }
102 catch (...) {
103 //log << MSG::ERROR << "Error 5" << endreq;
104 XMLPlatformUtils::Terminate();
105 exit(1);
106 }
107 //std::cout<<"@@@@@@@@@@@@@@@@@@@3"<<std::endl;
108 // Get document handle.
109 m_Sequence_DocNode = sequenceParser->getDocument();
110 m_Signature_DocNode = signatureParser->getDocument();
111 //std::cout<<"1@@@@@@@@@@@@@@@@@@@"<<m_SequenceVec.size()<<std::endl;
112 //std::cout<<"2@@@@@@@@@@@@@@@@@@@"<<m_SignatureVec.size()<<std::endl;
113 //std::cout<<"3@@@@@@@@@@@@@@@@@@@"<<m_TableVector.size()<<std::endl;
114 if(m_first){
115 m_first=false;
116 }
117 else{
118 for (unsigned int i = 0; i < m_SignatureVec.size(); i++) delete m_SignatureVec[i];
119 for (unsigned int j = 0; j < m_SequenceVec.size(); j++) delete m_SequenceVec[j];
120 m_SignatureVec.clear();
121 m_SequenceVec.clear();
122 m_TableVector.clear();
123 m_idCriteria=0;
124 m_idSignature=0;
125 m_idSequence=0;
126 m_idItem=0;
127 }
128 //std::cout<<"1@@@@@@@@@@@@@@@@@@@"<<m_SequenceVec.size()<<std::endl;
129 //std::cout<<"2@@@@@@@@@@@@@@@@@@@"<<m_SignatureVec.size()<<std::endl;
130 //std::cout<<"3@@@@@@@@@@@@@@@@@@@"<<m_TableVector.size()<<std::endl;
131 //std::vector<Sequence*> tmp1(0);
132 //m_SequenceVec=tmp1;
133 //std::cout<<"1@@@@@@@@@@@@@@@@@@@"<<m_SequenceVec.size()<<std::endl;
134 //std::vector<Signature*> tmp2(0);
135 //m_SignatureVec=tmp2;
136 //std::cout<<"2@@@@@@@@@@@@@@@@@@@"<<m_SignatureVec.size()<<std::endl;
137 //std::vector<std::pair<Signature*,Sequence*> > tmp3(0);
138 //m_TableVector=tmp3;
139 //std::cout<<"3@@@@@@@@@@@@@@@@@@@"<<m_TableVector.size()<<std::endl;
140 // Build global sequence list (and print it).
141 buildSequenceList(m_Sequence_DocNode, true);
142 //std::cout<<"1@@@@@@@@@@@@@@@@@@@"<<m_SequenceVec.size()<<std::endl;
143 //std::vector<Sequence*>::iterator iter=m_SequenceVec.begin();
144 //for(;iter!=m_SequenceVec.end();iter++){
145 // std::cout<< "@@@@@@@@"<<((*iter)->getSeqID())<<std::endl;
146 //}
147 //for (unsigned int i = 0; i < m_SequenceVec.size(); i++) {
148 // std::string seqId = m_SequenceVec[i]->getSeqID();
149 // std::cout<< "@@@@@@@@"<<seqId<<std::endl;
150 //}
151 // Build global signature list (and print it).
152 buildSignatureList(m_Signature_DocNode, true);
153 //std::cout<<"2@@@@@@@@@@@@@@@@@@@"<<m_SignatureVec.size()<<std::endl;
154 //m_Signature_DocNode->release();
155 //m_Sequence_DocNode->release();
156 delete sequenceParser;
157 delete signatureParser;
158 //std::cout<<"@@@@@@@@@@@@@@@@@@@6"<<std::endl;
160 //std::cout<<"3@@@@@@@@@@@@@@@@@@@"<<m_TableVector.size()<<std::endl;
161 m_first=false;
162 std::cout << "MyFrame init() succuss" << "criteria num=" << m_idCriteria << std::endl;
163}

Referenced by HltConfigSvc::handle(), and HltConfigSvc::initialize().

◆ instance()

MyFrame * HltProcessor::MyFrame::instance ( )
static

Definition at line 22 of file MyFrame.cxx.

22 {
23 if(s_FrameInstance == 0) {
24 s_FrameInstance = new MyFrame;
25 }
26 return s_FrameInstance;
27}

Referenced by HltConfigSvc::handle(), HltConfigSvc::initialize(), and HltConfigSvc::retrieve().

◆ makeTableVector()

void HltProcessor::MyFrame::makeTableVector ( )

Definition at line 165 of file MyFrame.cxx.

166{
167 //MsgStream log(m_msgSvcProvider->msgSvc(), m_thisName);
168
169 for (unsigned int i = 0; i < m_SequenceVec.size(); i++) {
170 std::string seqId = m_SequenceVec[i]->getSeqID();
171 bool matched = false;
172 for (unsigned int j = 0; j < m_SignatureVec.size(); j++) {
173 if (m_SignatureVec[j]->label() == m_SequenceVec[i]->getSeqID()) {
174 m_TableVector.push_back(std::make_pair(m_SignatureVec[j], m_SequenceVec[i]));
175 matched = true;
176 break;
177 }
178 }
179 if (!matched) {
180 //log << MSG::ERROR << "No matched Signature to Sequence(" << seqId << ")" << endreq;
181 exit(1);
182 }
183 }
184}

Referenced by init().


The documentation for this class was generated from the following files: