本文整理汇总了C++中Check函数的典型用法代码示例。如果您正苦于以下问题:C++ Check函数的具体用法?C++ Check怎么用?C++ Check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Check函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Check
void GdiContext2D::set_textBaseline(const TextBaseline& v)
{
Check();
textBaseline = v;
}
示例2: ASSERT
BOOL CColumns::Open(UINT nOpenType /* = snapshot */,
LPCSTR lpszSQL /* = NULL */, DWORD dwOptions /* = none */)
{
#ifdef WIN32
ASSERT(lpszSQL == NULL);
RETCODE nRetCode;
// Cache state info and allocate hstmt
SetState(nOpenType,NULL,noDirtyFieldCheck | dwOptions);
if (!AllocHstmt())
return FALSE;
TRY
{
OnSetOptions(m_hstmt);
AllocStatusArrays();
// call the ODBC catalog function with data member params
AFX_SQL_ASYNC(this, ::SQLColumns(m_hstmt,
(m_strQualifierParam.IsEmpty()? (UCHAR FAR *)NULL: (UCHAR FAR *)(const char*)m_strQualifierParam), SQL_NTS,
(m_strOwnerParam.IsEmpty()? (UCHAR FAR *)NULL: (UCHAR FAR *)(const char*)m_strOwnerParam), SQL_NTS,
(m_strTableNameParam.IsEmpty()? (UCHAR FAR *)NULL: (UCHAR FAR *)(const char*)m_strTableNameParam), SQL_NTS,
NULL, SQL_NTS));
if (!Check(nRetCode))
ThrowDBException(nRetCode, m_hstmt);
// Allocate memory and cache info
AllocAndCacheFieldInfo();
AllocRowset();
// Fetch the first row of data
MoveNext();
// If EOF, result set is empty, set BOF as well
m_bBOF = m_bEOF;
}
CATCH_ALL(e)
{
Close();
THROW_LAST();
}
END_CATCH_ALL
return TRUE;
#else // WIN16
RETCODE nRetCode;
ASSERT(lpszSQL == NULL);
// Allocation and opening of database not supported
if (m_hstmt == SQL_NULL_HSTMT)
{
CString strDefaultConnect;
TRY
{
if (m_pDatabase == NULL)
{
m_pDatabase = new CDatabase();
m_bRecordsetDb = TRUE;
}
strDefaultConnect = GetDefaultConnect();
// If not already opened, attempt to open
if (!m_pDatabase->IsOpen() &&
!m_pDatabase->Open("", FALSE, FALSE, strDefaultConnect))
return FALSE;
AFX_SQL_SYNC(::SQLAllocStmt(m_pDatabase->m_hdbc, &m_hstmt));
if (!Check(nRetCode))
ThrowDBException(SQL_INVALID_HANDLE);
// return FALSE; #JB951122
}
CATCH_ALL(e)
{
#ifdef _DEBUG
if (afxTraceFlags & 0x20)
TRACE0("Error: CDatabase create for CRecordset failed\n");
#endif // _DEBUG
strDefaultConnect.Empty();
if (m_bRecordsetDb)
{
DELETE_OBJ (m_pDatabase);
}
ASSERT(m_hstmt == SQL_NULL_HSTMT);
THROW_LAST();
}
END_CATCH_ALL
}
示例3: Check
int LuaC::TimerLib::unpause(lua_State *l){
//Stack: userdata (Timer)
Timer *t = Check(l, 1);
t->Unpause();
return 0;
}
示例4: Check
Object::Status Object::SubmitProcessTask(Sample *sample)
{
if (Tracker.IsValid() && !Paused && sample)
return Check() = Tracker->ProcessImageAsync(sample->Images, &sample->SyncOut);
else return Check() = PXC_STATUS_HANDLE_INVALID;
}
示例5: GetDateVal
const wxDateTime& GetDateVal() const
{ Check(wxCMD_LINE_VAL_DATE); return m_dateVal; }
示例6: SetStrVal
void SetStrVal(const wxString& val)
{ Check(wxCMD_LINE_VAL_STRING); m_strVal = val; m_hasVal = true; }
示例7: Check
void OrthancContext::Redirect(OrthancPluginRestOutput* output,
const std::string& s)
{
Check();
OrthancPluginRedirect(context_, output, s.c_str());
}
示例8: GetLongVal
long GetLongVal() const
{ Check(wxCMD_LINE_VAL_NUMBER); return m_longVal; }
示例9: GetStrVal
const wxString& GetStrVal() const
{ Check(wxCMD_LINE_VAL_STRING); return m_strVal; }
示例10: SetLongVal
void SetLongVal(long val)
{ Check(wxCMD_LINE_VAL_NUMBER); m_longVal = val; m_hasVal = true; }
示例11: EmHubLogToDlg
// Copy the HUB_LOG to the state of the dialog
void EmHubLogToDlg(HWND hWnd, HUB_LOG *g)
{
// Validate arguments
if (hWnd == NULL || g == NULL)
{
return;
}
CbSelect(hWnd, C_PACKET_SWITCH, g->PacketLogSwitchType);
Check(hWnd, B_PACKET_0_0, g->PacketLogConfig[0] == 0);
Check(hWnd, B_PACKET_0_1, g->PacketLogConfig[0] == 1);
Check(hWnd, B_PACKET_0_2, g->PacketLogConfig[0] == 2);
Check(hWnd, B_PACKET_1_0, g->PacketLogConfig[1] == 0);
Check(hWnd, B_PACKET_1_1, g->PacketLogConfig[1] == 1);
Check(hWnd, B_PACKET_1_2, g->PacketLogConfig[1] == 2);
Check(hWnd, B_PACKET_2_0, g->PacketLogConfig[2] == 0);
Check(hWnd, B_PACKET_2_1, g->PacketLogConfig[2] == 1);
Check(hWnd, B_PACKET_2_2, g->PacketLogConfig[2] == 2);
Check(hWnd, B_PACKET_3_0, g->PacketLogConfig[3] == 0);
Check(hWnd, B_PACKET_3_1, g->PacketLogConfig[3] == 1);
Check(hWnd, B_PACKET_3_2, g->PacketLogConfig[3] == 2);
Check(hWnd, B_PACKET_4_0, g->PacketLogConfig[4] == 0);
Check(hWnd, B_PACKET_4_1, g->PacketLogConfig[4] == 1);
Check(hWnd, B_PACKET_4_2, g->PacketLogConfig[4] == 2);
Check(hWnd, B_PACKET_5_0, g->PacketLogConfig[5] == 0);
Check(hWnd, B_PACKET_5_1, g->PacketLogConfig[5] == 1);
Check(hWnd, B_PACKET_5_2, g->PacketLogConfig[5] == 2);
Check(hWnd, B_PACKET_6_0, g->PacketLogConfig[6] == 0);
Check(hWnd, B_PACKET_6_1, g->PacketLogConfig[6] == 1);
Check(hWnd, B_PACKET_6_2, g->PacketLogConfig[6] == 2);
Check(hWnd, B_PACKET_7_0, g->PacketLogConfig[7] == 0);
Check(hWnd, B_PACKET_7_1, g->PacketLogConfig[7] == 1);
Check(hWnd, B_PACKET_7_2, g->PacketLogConfig[7] == 2);
}
示例12: SetDateVal
void SetDateVal(const wxDateTime& val)
{ Check(wxCMD_LINE_VAL_DATE); m_dateVal = val; m_hasVal = true; }
示例13: Check
void CMasternodeMan::CheckAndRemove(bool forceExpiredRemoval)
{
Check();
LOCK(cs);
//remove inactive and outdated
vector<CMasternode>::iterator it = vMasternodes.begin();
while(it != vMasternodes.end()){
if((*it).activeState == CMasternode::MASTERNODE_REMOVE ||
(*it).activeState == CMasternode::MASTERNODE_VIN_SPENT ||
(forceExpiredRemoval && (*it).activeState == CMasternode::MASTERNODE_EXPIRED) ||
(*it).protocolVersion < masternodePayments.GetMinMasternodePaymentsProto()) {
LogPrint("masnernode", "CMasternodeMan: Removing inactive Masternode %s - %i now\n", (*it).addr.ToString(), size() - 1);
//erase all of the broadcasts we've seen from this vin
// -- if we missed a few pings and the node was removed, this will allow is to get it back without them
// sending a brand new mnb
map<uint256, CMasternodeBroadcast>::iterator it3 = mapSeenMasternodeBroadcast.begin();
while(it3 != mapSeenMasternodeBroadcast.end()){
if((*it3).second.vin == (*it).vin){
masternodeSync.mapSeenSyncMNB.erase((*it3).first);
mapSeenMasternodeBroadcast.erase(it3++);
} else {
++it3;
}
}
// allow us to ask for this masternode again if we see another ping
map<COutPoint, int64_t>::iterator it2 = mWeAskedForMasternodeListEntry.begin();
while(it2 != mWeAskedForMasternodeListEntry.end()){
if((*it2).first == (*it).vin.prevout){
mWeAskedForMasternodeListEntry.erase(it2++);
} else {
++it2;
}
}
it = vMasternodes.erase(it);
} else {
++it;
}
}
// check who's asked for the Masternode list
map<CNetAddr, int64_t>::iterator it1 = mAskedUsForMasternodeList.begin();
while(it1 != mAskedUsForMasternodeList.end()){
if((*it1).second < GetTime()) {
mAskedUsForMasternodeList.erase(it1++);
} else {
++it1;
}
}
// check who we asked for the Masternode list
it1 = mWeAskedForMasternodeList.begin();
while(it1 != mWeAskedForMasternodeList.end()){
if((*it1).second < GetTime()){
mWeAskedForMasternodeList.erase(it1++);
} else {
++it1;
}
}
// check which Masternodes we've asked for
map<COutPoint, int64_t>::iterator it2 = mWeAskedForMasternodeListEntry.begin();
while(it2 != mWeAskedForMasternodeListEntry.end()){
if((*it2).second < GetTime()){
mWeAskedForMasternodeListEntry.erase(it2++);
} else {
++it2;
}
}
}
示例14: sizeof
// Compute an upper bound of the memory size that is required to load all
// sections
void RuntimeDyldImpl::computeTotalAllocSize(ObjectImage &Obj,
uint64_t &CodeSize,
uint64_t &DataSizeRO,
uint64_t &DataSizeRW) {
// Compute the size of all sections required for execution
std::vector<uint64_t> CodeSectionSizes;
std::vector<uint64_t> ROSectionSizes;
std::vector<uint64_t> RWSectionSizes;
uint64_t MaxAlignment = sizeof(void *);
// Collect sizes of all sections to be loaded;
// also determine the max alignment of all sections
for (section_iterator SI = Obj.begin_sections(), SE = Obj.end_sections();
SI != SE; ++SI) {
const SectionRef &Section = *SI;
bool IsRequired;
Check(Section.isRequiredForExecution(IsRequired));
// Consider only the sections that are required to be loaded for execution
if (IsRequired) {
uint64_t DataSize = 0;
uint64_t Alignment64 = 0;
bool IsCode = false;
bool IsReadOnly = false;
StringRef Name;
Check(Section.getSize(DataSize));
Check(Section.getAlignment(Alignment64));
Check(Section.isText(IsCode));
Check(Section.isReadOnlyData(IsReadOnly));
Check(Section.getName(Name));
unsigned Alignment = (unsigned)Alignment64 & 0xffffffffL;
uint64_t StubBufSize = computeSectionStubBufSize(Obj, Section);
uint64_t SectionSize = DataSize + StubBufSize;
// The .eh_frame section (at least on Linux) needs an extra four bytes
// padded
// with zeroes added at the end. For MachO objects, this section has a
// slightly different name, so this won't have any effect for MachO
// objects.
if (Name == ".eh_frame")
SectionSize += 4;
if (SectionSize > 0) {
// save the total size of the section
if (IsCode) {
CodeSectionSizes.push_back(SectionSize);
} else if (IsReadOnly) {
ROSectionSizes.push_back(SectionSize);
} else {
RWSectionSizes.push_back(SectionSize);
}
// update the max alignment
if (Alignment > MaxAlignment) {
MaxAlignment = Alignment;
}
}
}
}
// Compute the size of all common symbols
uint64_t CommonSize = 0;
for (symbol_iterator I = Obj.begin_symbols(), E = Obj.end_symbols(); I != E;
++I) {
uint32_t Flags = I->getFlags();
if (Flags & SymbolRef::SF_Common) {
// Add the common symbols to a list. We'll allocate them all below.
uint64_t Size = 0;
Check(I->getSize(Size));
CommonSize += Size;
}
}
if (CommonSize != 0) {
RWSectionSizes.push_back(CommonSize);
}
// Compute the required allocation space for each different type of sections
// (code, read-only data, read-write data) assuming that all sections are
// allocated with the max alignment. Note that we cannot compute with the
// individual alignments of the sections, because then the required size
// depends on the order, in which the sections are allocated.
CodeSize = computeAllocationSizeForSections(CodeSectionSizes, MaxAlignment);
DataSizeRO = computeAllocationSizeForSections(ROSectionSizes, MaxAlignment);
DataSizeRW = computeAllocationSizeForSections(RWSectionSizes, MaxAlignment);
}
示例15: Check
void CheckListComboPopup::CheckAll(bool check)
{
for ( unsigned int i = 1; i < GetCount(); i++ )
Check(i, check);
}