BOSS 6.6.4.p03
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}
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}

Referenced by HltConfigSvc::finalize().

◆ DOMToDouble()

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

Definition at line 394 of file MyFrame.cxx.

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

◆ final()

void HltProcessor::MyFrame::final ( )

Definition at line 185 of file MyFrame.cxx.

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

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

◆ getTablesVector()

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

Definition at line 389 of file MyFrame.cxx.

390{
391 return m_TableVector;
392}

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 }
127 //std::cout<<"1@@@@@@@@@@@@@@@@@@@"<<m_SequenceVec.size()<<std::endl;
128 //std::cout<<"2@@@@@@@@@@@@@@@@@@@"<<m_SignatureVec.size()<<std::endl;
129 //std::cout<<"3@@@@@@@@@@@@@@@@@@@"<<m_TableVector.size()<<std::endl;
130 //std::vector<Sequence*> tmp1(0);
131 //m_SequenceVec=tmp1;
132 //std::cout<<"1@@@@@@@@@@@@@@@@@@@"<<m_SequenceVec.size()<<std::endl;
133 //std::vector<Signature*> tmp2(0);
134 //m_SignatureVec=tmp2;
135 //std::cout<<"2@@@@@@@@@@@@@@@@@@@"<<m_SignatureVec.size()<<std::endl;
136 //std::vector<std::pair<Signature*,Sequence*> > tmp3(0);
137 //m_TableVector=tmp3;
138 //std::cout<<"3@@@@@@@@@@@@@@@@@@@"<<m_TableVector.size()<<std::endl;
139 // Build global sequence list (and print it).
140 buildSequenceList(m_Sequence_DocNode, true);
141 //std::cout<<"1@@@@@@@@@@@@@@@@@@@"<<m_SequenceVec.size()<<std::endl;
142 //std::vector<Sequence*>::iterator iter=m_SequenceVec.begin();
143 //for(;iter!=m_SequenceVec.end();iter++){
144 // std::cout<< "@@@@@@@@"<<((*iter)->getSeqID())<<std::endl;
145 //}
146 //for (unsigned int i = 0; i < m_SequenceVec.size(); i++) {
147 // std::string seqId = m_SequenceVec[i]->getSeqID();
148 // std::cout<< "@@@@@@@@"<<seqId<<std::endl;
149 //}
150 // Build global signature list (and print it).
151 buildSignatureList(m_Signature_DocNode, true);
152 //std::cout<<"2@@@@@@@@@@@@@@@@@@@"<<m_SignatureVec.size()<<std::endl;
153 //m_Signature_DocNode->release();
154 //m_Sequence_DocNode->release();
155 delete sequenceParser;
156 delete signatureParser;
157 //std::cout<<"@@@@@@@@@@@@@@@@@@@6"<<std::endl;
159 //std::cout<<"3@@@@@@@@@@@@@@@@@@@"<<m_TableVector.size()<<std::endl;
160 m_first=false;
161 std::cout << "MyFrame init() succuss" << "criteria num=" << m_idCriteria << std::endl;
162}

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 164 of file MyFrame.cxx.

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

Referenced by init().


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