18 if(
vec.size()+pos>54) {
19 std::cout <<
"***EFResult:EFResult(): vector size error!" << std::endl;
23 for(
unsigned int i=0;i<54;++i){
24 if(i<pos||i>=
vec.size()+pos) m_efVec.push_back(0);
25 else m_efVec.push_back(
vec[i-pos]);
57 if(pos>=m_efVec.size())
return 0;
58 else return m_efVec[pos];
62 if(m_efVec.size()>0&&m_efVec.size()<54)
return false;
63 if(m_efVec.size()==0) m_efVec.resize(54,0);
64 m_efVec.push_back(val);
70 if(pos>=54)
return false;
71 if(m_efVec.size()!=0&&m_efVec.size()<54){
72 std::cout <<
"EFResult::appToEFVec-->size error!" <<std::endl;
74 if(m_efVec.size()==0) m_efVec.resize(54,0);
77 m_efVec[pos]=*((uint32_t*)&a);
86 if(pos>=54)
return false;
87 if(m_efVec.size()!=0&&m_efVec.size()<54){
88 std::cout <<
"EFResult::addToEFVec-->size error!" <<std::endl;
90 if(m_efVec.size()==0) m_efVec.resize(54,0);
99 if(vecpos>=54)
return false;
100 if(bend>=32||bbegin>bend)
return false;
101 if(m_efVec.size()==0) m_efVec.resize(54,0);
102 uint32_t bits=0xFFFFFFFF>>(31-bend+bbegin);
103 m_efVec[vecpos]&= (~((bits)<<bbegin));
104 m_efVec[vecpos]|= (val&bits)<<bbegin;
110 if(vecpos>=54)
return false;
111 if(bitpos>=32)
return false;
112 if(m_efVec.size()==0) m_efVec.resize(54,0);
113 if(val) m_efVec[vecpos]|=(1<<bitpos);
114 else m_efVec[vecpos]&=(~(1<<bitpos));
122 std::vector<std::string>::iterator itVs = m_answerVector.begin();
123 std::vector<std::string>::iterator endVs = m_answerVector.end();
124 for (;itVs != endVs && m_answerIndex == -1; ++itVs) {
125 if (*itVs == answer) {
126 m_answerIndex = iCount;
140 std::vector<std::string>::iterator itVs = m_answerVector.begin();
141 std::vector<std::string>::iterator endVs = m_answerVector.end();
142 for (;itVs != endVs && m_answerIndex == -1; ++itVs) {
143 if (*itVs == answer) {
144 m_midanswerIndex = iCount;
159 m_midanswerIndex = -1;
160 if(m_efVec.size()>=54){
161 m_efVec.resize(54,0);
162 for(
unsigned int i=0;i<m_efVec.size();++i) m_efVec[i]=0;
164 else if(m_efVec.size()!=0){
165 std::cout <<
"EFResult::reset(): m_efVec size check error!"<<std::endl;
Defines the EFResult RDO structure.
bool addToEFVec(uint32_t val, uint32_t pos)
const std::string getAnswer() const
const int getMidAnswerIndex() const
static const CLID & classID()
void setAnswer(std::string &answer)
bool appToEFVec(double val, uint32_t pos)
const int getAnswerIndex() const
void setMidAnswer(std::string &answer)
const std::string getMidAnswer() const
virtual const CLID & clID() const
bool setVecBit(uint32_t val, uint32_t vecpos, uint32_t bbegin, uint32_t bend)
const std::vector< uint32_t > getEFVec() const
bool push_back(uint32_t val)