本文整理汇总了C++中Unsigned类的典型用法代码示例。如果您正苦于以下问题:C++ Unsigned类的具体用法?C++ Unsigned怎么用?C++ Unsigned使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Unsigned类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: slotDataAvailable
void SensorfwProximitySensor::slotDataAvailable(const Unsigned& data)
{
bool close = data.x()? true: false;
if (close == m_exClose) return;
m_reading.setClose(close);
m_reading.setTimestamp(data.UnsignedData().timestamp_);
newReadingAvailable();
m_exClose = close;
}
开发者ID:deztructor,项目名称:qtsensors,代码行数:9,代码来源:sensorfwproximitysensor.cpp
示例2: getLightLevel
void meegoals::slotDataAvailable(const Unsigned& data)
{
QAmbientLightReading::LightLevel level = getLightLevel(data.x());
if (level != m_reading.lightLevel()) {
m_reading.setLightLevel(level);
m_reading.setTimestamp(data.UnsignedData().timestamp_);
newReadingAvailable();
}
}
开发者ID:Koi-foo,项目名称:qt-mobility,代码行数:9,代码来源:meegoals.cpp
示例3: assert
void Unsigned::Subtract(Unsigned& b)
{
assert(_width == b.Width());
Unsigned one_val(b.Width(),"_b1");
Unsigned tmp(b.Width());
tmp = b;
tmp.Complement();
tmp.Add(one_val);
this->Add(tmp);
}
开发者ID:ahirOrg,项目名称:ahir,代码行数:12,代码来源:Value.cpp
示例4: Multiply
void Unsigned::Multiply(Unsigned& b )
{
assert(this->_width == b.Width());
if(b.Width() > 64)
{
cerr << "Error: multiply supported for integers which are up to 64 bits wide" << endl;
cerr << " will return junk " << endl;
return;
}
this->_bit_field[0] = this->_bit_field[0] * b._bit_field[0];
}
开发者ID:ahirOrg,项目名称:ahir,代码行数:13,代码来源:Value.cpp
示例5: Perform_Unary_Operation
rtlValue* Perform_Unary_Operation(rtlOperation op, rtlValue* v)
{
if((op == __NOT) && (v->Is("rtlUnsignedValue")))
{
rtlUnsignedValue* uv = (rtlUnsignedValue*)v;
Unsigned* nv = new Unsigned(*((Unsigned*)(uv->Get_Value())));
nv->Complement();
rtlValue* ret_val = new rtlUnsignedValue(v->Get_Type(), nv);
return(ret_val);
}
else
{
return(NULL);
}
}
开发者ID:madhavPdesai,项目名称:ahir,代码行数:15,代码来源:rtlValue.cpp
示例6: tmp
void Unsigned::Concatenate(Unsigned& b)
{
Unsigned tmp(_width + b._width);
for(int idx = 0; idx < b.Width(); idx++)
{
tmp.Set_Bit(idx, (b.Get_Bit(idx) ? true : false));
}
for(int idx = 0; idx < this->_width; idx++)
{
tmp.Set_Bit(idx + b.Width(), (this->Get_Bit(idx) ? true : false));
}
this->Swap(tmp);
}
开发者ID:ahirOrg,项目名称:ahir,代码行数:15,代码来源:Value.cpp
示例7: Add
void Unsigned::Add(Unsigned& b)
{
bool carry = false;
assert(this->_width == b.Width());
for(int idx = 0; idx < b.Width(); idx++)
{
bool abit = this->Get_Bit(idx);
bool bbit = b.Get_Bit(idx);
bool sum = (abit ^ bbit ^ carry);
this->Set_Bit(idx,sum);
carry = (abit & bbit) | ((abit | bbit) & carry);
}
this->Sign_Extend();
}
开发者ID:ahirOrg,项目名称:ahir,代码行数:16,代码来源:Value.cpp
示例8: Greater
bool Unsigned::Greater(Unsigned& b)
{
bool ret_val = true;
assert(this->Width() == b.Width());
for(int idx = this->Width()-1; idx >= 0; idx--)
{
if((!this->Get_Bit(idx) && b.Get_Bit(idx)))
{
ret_val = false;
break;
}
else if(this->Get_Bit(idx) && !b.Get_Bit(idx))
break;
}
return(ret_val);
}
开发者ID:ahirOrg,项目名称:ahir,代码行数:17,代码来源:Value.cpp
示例9: Assign
// unsigned int <-> int type conversion
void Unsigned::Assign(Unsigned& v)
{
for(int idx = 0; idx < this->Array_Size() ; idx++)
this->_bit_field[idx] = 0;
for(int idx = 0; idx < __MIN__(this->Array_Size(),v.Array_Size()); idx++)
_bit_field[idx] = v._bit_field[idx];
}
开发者ID:ahirOrg,项目名称:ahir,代码行数:10,代码来源:Value.cpp
示例10: Divide
void Unsigned::Divide(Unsigned& b)
{
assert(_width == b.Width());
if(_width > 64)
{
cerr << "Error: divide supported for integers which are up to 64 bits wide" << endl;
cerr << " will return junk " << endl;
return;
}
this->_bit_field[0] = this->_bit_field[0] / b._bit_field[0];
}
开发者ID:ahirOrg,项目名称:ahir,代码行数:12,代码来源:Value.cpp
示例11: slotDataAvailable
void SensorfwLightSensor::slotDataAvailable(const Unsigned& data)
{
m_reading.setLux(data.x());
m_reading.setTimestamp(data.UnsignedData().timestamp_);
newReadingAvailable();
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:6,代码来源:sensorfwlightsensor.cpp
示例12: slotDataAvailable
void SensorfwOrientationSensor::slotDataAvailable(const Unsigned& data)
{
m_reading.setOrientation(SensorfwOrientationSensor::getOrientation(data.x()));
m_reading.setTimestamp(data.UnsignedData().timestamp_);
newReadingAvailable();
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:6,代码来源:sensorfworientationsensor.cpp
示例13: Greater_Equal
bool Unsigned::Greater_Equal(Unsigned& b)
{
return(this->Greater(b) && !b.Greater(*this));
}
开发者ID:ahirOrg,项目名称:ahir,代码行数:4,代码来源:Value.cpp
示例14: Less_Than
bool Unsigned::Less_Than(Unsigned& b)
{
return(b.Greater(*this));
}
开发者ID:ahirOrg,项目名称:ahir,代码行数:4,代码来源:Value.cpp
示例15: Xor
void Unsigned::Xor(Unsigned& b)
{
assert(this->Width() == b.Width());
for(int idx = 0; idx < this->Array_Size(); idx++)
this->_bit_field[idx] = (this->_bit_field[idx] ^ b._bit_field[idx]);
}
开发者ID:ahirOrg,项目名称:ahir,代码行数:6,代码来源:Value.cpp
注:本文中的Unsigned类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论