本文整理汇总了C++中ClearData函数的典型用法代码示例。如果您正苦于以下问题:C++ ClearData函数的具体用法?C++ ClearData怎么用?C++ ClearData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ClearData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connect
void MainWindow::connectSignals()
{
connect(m_assign1, &QPushButton::clicked, this, [this] { AssignData(*m_model); });
connect(m_assign2, &QPushButton::clicked, this, [this] { AssignData(*m_viewModel1); });
connect(m_assign3, &QPushButton::clicked, this, [this] { AssignData(*m_viewModel2); });
connect(m_upsert1, &QPushButton::clicked, this, [this] { UpsertData(*m_model); });
connect(m_upsert2, &QPushButton::clicked, this, [this] { UpsertData(*m_viewModel1); });
connect(m_upsert3, &QPushButton::clicked, this, [this] { UpsertData(*m_viewModel2); });
connect(m_clear1, &QPushButton::clicked, this, [this] { ClearData(*m_model); });
connect(m_clear2, &QPushButton::clicked, this, [this] { ClearData(*m_viewModel1); });
connect(m_clear3, &QPushButton::clicked, this, [this] { ClearData(*m_viewModel2); });
}
示例2: ClearData
void CSingleArenaTotemExt::LoadData()
{
//清空数据
ClearData();
//父类加载数据
CSingleArenaTotemData::LoadData();
//分析匹配key
for( CSingleArenaTotemData::UInt32SingleArenaTotemMap::iterator iter = id_singlearenatotem_map.begin();
iter != id_singlearenatotem_map.end();
++iter )
{
if( 0 == iter->second->rank )
continue;
rank_map[iter->second->rank].push_back(iter->second);
}
//打印信息
for( std::map<uint32, std::vector<SData*> >::iterator iter = rank_map.begin();
iter != rank_map.end();
++iter )
{
LOG_DEBUG("rank:%d,count:%d", iter->first, (uint32)iter->second.size());
}
}
示例3: assert
// Initializer
void MeshModelRender::AttachKernel(MeshModelKernel* pKernel)
{
assert(pKernel != NULL);
kernel = pKernel;
ClearData();
}
示例4: ClearData
void RBACData::LoadFromDB()
{
ClearData();
TC_LOG_DEBUG("rbac", "RBACData::LoadFromDB [Id: %u Name: %s]: Loading permissions", GetId(), GetName().c_str());
// Load account permissions (granted and denied) that affect current realm
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_FUN_ACCOUNT_PERMISSIONS);
stmt->setUInt32(0, GetId());
stmt->setInt32(1, GetRealmId());
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (result)
{
do
{
Field* fields = result->Fetch();
if (fields[1].GetBool())
GrantPermission(fields[0].GetUInt32());
else
DenyPermission(fields[0].GetUInt32());
}
while (result->NextRow());
}
// Add default permissions
RBACPermissionContainer const& permissions = sAccountMgr->GetRBACDefaultPermissions(_secLevel);
for (RBACPermissionContainer::const_iterator itr = permissions.begin(); itr != permissions.end(); ++itr)
GrantPermission(*itr);
// Force calculation of permissions
CalculateNewPermissions();
}
示例5: ClearData
//**************************************************************************************
void CBCGPToolbarComboBoxButton::CopyFrom (const CBCGPToolbarButton& s)
{
CBCGPToolbarButton::CopyFrom (s);
POSITION pos;
m_lstItems.RemoveAll ();
const CBCGPToolbarComboBoxButton& src = (const CBCGPToolbarComboBoxButton&) s;
for (pos = src.m_lstItems.GetHeadPosition (); pos != NULL;)
{
m_lstItems.AddTail (src.m_lstItems.GetNext (pos));
}
ClearData ();
m_lstItemData.RemoveAll ();
for (pos = src.m_lstItemData.GetHeadPosition (); pos != NULL;)
{
m_lstItemData.AddTail (src.m_lstItemData.GetNext (pos));
}
DuplicateData ();
ASSERT (m_lstItemData.GetCount () == m_lstItems.GetCount ());
m_dwStyle = src.m_dwStyle;
m_iWidth = src.m_iWidth;
m_iSelIndex = src.m_iSelIndex;
m_nDropDownHeight = src.m_nDropDownHeight;
m_uiMenuResID = src.m_uiMenuResID;
m_bIsRibbon = src.m_bIsRibbon;
m_bIsRibbonFloaty = src.m_bIsRibbonFloaty;
m_bIsCtrl = src.m_bIsCtrl;
}
示例6: ClearData
inline void REClip::SetData(REClipData* d)
{
if(_d == d) return;
ClearData();
++d->_refs;
_d = d;
}
示例7: ClearData
// method to expose data to JavaScript by using properties
void QmitkHistogramJSWidget::ComputeHistogram(HistogramType* histogram)
{
m_Histogram = histogram;
HistogramConstIteratorType startIt = m_Histogram->End();
HistogramConstIteratorType endIt = m_Histogram->End();
HistogramConstIteratorType it = m_Histogram->Begin();
ClearData();
unsigned int i = 0;
bool firstValue = false;
// removes frequencies of 0, which are outside the first and last bin
for (; it != m_Histogram->End(); ++it)
{
if (it.GetFrequency() > 0.0)
{
endIt = it;
if (!firstValue)
{
firstValue = true;
startIt = it;
}
}
}
++endIt;
// generating Lists of measurement and frequencies
for (it = startIt ; it != endIt; ++it, ++i)
{
QVariant frequency = QVariant::fromValue(it.GetFrequency());
QVariant measurement = it.GetMeasurementVector()[0];
m_Frequency.insert(i, frequency);
m_Measurement.insert(i, measurement);
}
m_IntensityProfile = false;
this->SignalDataChanged();
}
示例8: SendMessage
/*
** Handles the ClosePlayer bang.
**
*/
void PlayerCAD::ClosePlayer()
{
SendMessage(m_PlayerWindow, WM_USER, 0, IPC_CLOSE);
// TODO
m_Initialized = false;
ClearData();
}
示例9: ClearData
void SimpleSkeletalAnimatedObject_cl::SetMode(SampleMode_e newMode)
{
ClearData();
m_eSampleMode = newMode;
switch (newMode)
{
case MODE_SINGLEANIM:
StartSingleAnimation(false); break;
case MODE_BLENDTWOANIMS:
BlendTwoAnimations(); break;
case MODE_LISTENTOEVENTS:
ListenToEvents(); break;
case MODE_SETANIMATIONTIME:
SetAnimationTime(); break;
case MODE_LAYERTWOANIMATIONS:
LayerTwoAnimations(); break;
case MODE_FORWARDKINEMATICS:
ForwardKinematics(); break;
case MODE_LOOKAT:
LookAt(); break;
}
// disable motion delta for this sample
if (GetAnimConfig() != NULL)
GetAnimConfig()->SetFlags(GetAnimConfig()->GetFlags() & ~APPLY_MOTION_DELTA);
}
示例10: GetFlags
//---------------------------------------------------------------------------
void __fastcall TfrmHeartMonitor::DisplayHeartRateMeasurementData(TBytes Data) {
THRMFlags *Flags = GetFlags(Data[0]);
int LBPM = 0;
if (Flags->HRValue16bits) {
LBPM = Data[1] + (Data[2] * 16);
}
else {
LBPM = Data[1];
}
switch (Flags->SensorContactStatus) {
case NonSupported:
lblContactStatus->Text = "";
break;
case NonDetected:
lblContactStatus->Text = "Sensor contact non detected";
break;
case Detected:
lblContactStatus->Text = "Sensor contact detected";
break;
}
if (Flags->SensorContactStatus == NonDetected) {
ClearData();
}
else {
lblBPM->Text = IntToStr(LBPM) + " bpm";
imgHeart->Visible = !imgHeart->Visible;
}
}
示例11: defined
//---------------------------------------------------------------------------
void __fastcall TfrmHeartMonitor::EnableHRMMonitorize(bool Enabled) {
TBluetoothGattDescriptor * LDescriptor;
if (FHRMeasurementGattCharact != NULL) {
#if defined(_WIN32) || defined(_WIN64)
LDescriptor = FHRMeasurementGattCharact->Descriptors->Items[0];
LDescriptor->Notification = Enabled;
FBLEDevice->WriteDescriptor(LDescriptor);
#endif
FBLEDevice->SetCharacteristicNotification(FHRMeasurementGattCharact,
Enabled);
if (Enabled) {
btnMonitorize->Text = "Stop monitoring";
}
else {
btnMonitorize->Text = "Start monitoring";
ClearData();
}
btnMonitorize->Enabled = true;
}
else {
Memo1->Lines->Add("HRM Characteristic not found");
lblBPM->Text = "HRM Characteristic not found";
btnMonitorize->Enabled = false;
}
}
示例12: Pop
void Pop(const Callback& cb)
{
boost::unique_lock<boost::mutex> lock(m_Mutex);
// check persistent queue
if (m_FilePath.empty())
{
// there is no persistent queue yet
if (!m_Queue.empty())
{
m_ByteSize -= m_Queue.front().m_Size;
m_Queue.pop_front();
}
if (!m_Queue.empty())
{
const auto next = m_Queue.front();
lock.unlock();
// write next packet
cb(next);
}
}
else
{
// all data must be in the file buffer
assert(m_Queue.empty());
m_ByteSize -= m_CurrentPacket.m_Size;
if (!m_ByteSize)
{
// we have just written last packet, clear persistent queue
m_Stream.seekg(0, std::ios::end);
assert(m_Stream.tellg() == m_ReadOffset);
ClearData();
return;
}
// extract last packet from persistent queue
m_Stream.seekg(m_ReadOffset);
m_Stream.read(reinterpret_cast<char*>(&m_CurrentPacket.m_Size), sizeof(m_CurrentPacket.m_Size));
if (m_CurrentSize < m_CurrentPacket.m_Size)
{
// not enough memory, allocate new buffer
m_CurrentPacket.m_Memory = boost::make_shared_noinit<char[]>(m_CurrentPacket.m_Size);
m_CurrentSize = m_CurrentPacket.m_Size;
}
m_Stream.read(m_CurrentPacket.m_Memory.get(), m_CurrentPacket.m_Size);
// increment read offset
m_ReadOffset += (m_CurrentPacket.m_Size + sizeof(m_CurrentPacket.m_Size));
lock.unlock();
// write packet
cb(m_CurrentPacket);
}
}
示例13: file
int NetworkCommunication::loadData(QString datafile)
{
QFile file(datafile);
if (file.open(QIODevice::ReadOnly | QIODevice::Text))
{
qDebug() << "NetworkCommunication::LoadData: File " << datafile << "is open";
ClearData();
QTextStream in(&file);
int counter=0;
while(!in.atEnd()) {
counter++;
QString line = in.readLine();
QStringList fields = line.split(" ",QString::SkipEmptyParts);
if(fields.length() == 2)
{
AddData(fields[0].toDouble(),fields[1].toDouble());
}
}
file.close();
emit(updateUI());
return(0);
}
else
{
qDebug() << "NetworkCommunication::LoadData: File " << datafile << " can not be opened";
return(1);
}
}
示例14: ClearData
//! ResourceUninit
void Texture::ResourceUninit()
{
if (!m_pImpl)
return;
m_pImpl->GraphicUnload();
ClearData();
}
示例15: BeginWaitCursor
void CFoulerDoc::OnEditClearAll()
{
BeginWaitCursor();
ClearData();
m_pLeftView->Refresh();
m_pRightView->Refresh();
EndWaitCursor();
}