本文整理汇总了C++中cl函数的典型用法代码示例。如果您正苦于以下问题:C++ cl函数的具体用法?C++ cl怎么用?C++ cl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cl
void CTraderApi::AddToSendQueue(SRequest * pRequest)
{
if (NULL == pRequest)
return;
CLock cl(&m_csList);
bool bFind = false;
if (!bFind)
m_reqList.push_back(pRequest);
if (NULL == m_hThread
&&!m_reqList.empty())
{
m_bRunning = true;
m_hThread = CreateThread(NULL,0,SendThread_TD,this,0,NULL);
}
}
示例2: assert
bool
manager::wait_for_next(void)
{
client *cl((client*)pthread_getspecific(client_key));
assert(cl != NULL);
cl->cunits++;
while(cl->counter <= 0) {
if(cl->done)
return true;
usleep(100);
}
if(cl->done)
return true;
cl->counter--;
return true;
}
示例3: cl
inline T& UMatrix2D<T>::GetValue(unsigned int x,unsigned int y)
{
#ifdef _SAFE_ACCESS_
CheckLocker cl(GetLocker());
#endif //_SAFE_ACCESS_
if(x>=nX) {
ms=MXS_ERR_OUT_OF_INDEX;throw(this);
} else if(y>=nY) {
ms=MXS_ERR_OUT_OF_INDEX;throw(this);
} else ms = MXS_OK;
if(mso == MSO_XY)
return Ptr[y*nX + x];
else
return Ptr[x*nY + y];
// return Ptr[ATF(x,y,atfN)];
}
示例4: read_clique
void read_clique(vector<vector<int>> &neutral_vectors){
ifstream cl("clique.txt");
int count = -1;
string c;
while (!cl.eof())
{
getline(cl, c);
count++;
}
cl.close();
cl.open("clique.txt");
vector<int> init = { -1, -1, -1, -1, -1 };
for (int v = 0; v < count; v++){
neutral_vectors.push_back(init);
cl >> neutral_vectors[v][0] >> neutral_vectors[v][1] >> neutral_vectors[v][2] >> neutral_vectors[v][3] >> neutral_vectors[v][4];
}
cl.close();
}
示例5: hs_dummy_kernel_enqueue
static
void
hs_dummy_kernel_enqueue(cl_command_queue cq,
uint32_t wait_list_size,
cl_event const * wait_list,
cl_event * event)
{
size_t const global_work_size = 1;
cl(EnqueueNDRangeKernel(cq,
hs_dummy_kernel,
1,
NULL,
&global_work_size,
NULL,
wait_list_size,
wait_list,
event));
}
示例6: ConstantPool
void InterpretTest::callTest()
{
ConstantPool * pool = new ConstantPool();
Class * cls = initClass("CallTest", pool);
const char code1[] =
{
RET_VOID
};
const char code2[] =
{
PUSH, 0x00, 0x00,
RET
};
const char code[] =
{
CALL, 0x01, 0x00, 0x02, 0x00, //ClassRef na pozici 1, MethodRef na pozici 2
CALL, 0x01, 0x00, 0x03, 0x00, //ClassRef na pozici 1, MethodRef na pozici 3
RET
};
Method * m = initMethod("callTest", code, sizeof(code), 0, 0, 0);
Method * m1 = initMethod("returnVoid", code1, sizeof(code1), 0, 0, 0);
Method * m2 = initMethod("returnInt", code2, sizeof(code2), 0, 0, 0);
ClassLoader cl("");
Interpret instance(&cl);
IntConst i;
i.value = 1;
pool->addItem(&i, INT_CONST);//0
ClassRef cr;
memset(cr.name, 0x00, IDENTIFIER_LENGTH);
sprintf(cr.name, "%s", cls->getName().c_str());
pool->addItem(&cr, CLASS_REF);//1
MethodRef mr;
sprintf(mr.name, "%s", m1->getName().c_str());
mr.params = 0;
pool->addItem(&mr, METHOD_REF);//2
sprintf(mr.name, "%s", m2->getName().c_str());
pool->addItem(&mr, METHOD_REF);//3
cls->addMethod(m);
cls->addMethod(m1);
cls->addMethod(m2);
cl.addClass(cls);
assert(1 == instance.run(cls->getName().c_str(), m->getName().c_str()));
}
示例7: initParserByString
void initParserByString(char * str)
{
pSt.type = PT_STRING;
cl();
waitLex();
if (pSt.srcStr != NULL)
free(pSt.srcStr);
pSt.srcStr = str;
/*pSt.fileStr = NULL;*/
if (pSt.list == NULL)
pSt.list = newLexList();
else
clearLexList(pSt.list);
initLexerByString(str);
}
示例8: clearParser
void clearParser()
{
pSt.type = PT_STDIN;
cl();
waitLex();
pSt.srcStr = NULL;
/*pSt.fileStr = NULL;*/
if (pSt.list != NULL)
{
clearLexList(pSt.list);
free(pSt.list);
pSt.list = NULL;
}
clearLexer();
}
示例9: scanCard
void scanCard(size_t index, HeapRegion *r) {
// Stack allocate the DirtyCardToOopClosure instance
HeapRegionDCTOC cl(_g1h, r, _oc,
CardTableModRefBS::Precise);
// Set the "from" region in the closure.
_oc->set_region(r);
MemRegion card_region(_bot_shared->address_for_index(index), G1BlockOffsetSharedArray::N_words);
MemRegion pre_gc_allocated(r->bottom(), r->scan_top());
MemRegion mr = pre_gc_allocated.intersection(card_region);
if (!mr.is_empty() && !_ct_bs->is_card_claimed(index)) {
// We make the card as "claimed" lazily (so races are possible
// but they're benign), which reduces the number of duplicate
// scans (the rsets of the regions in the cset can intersect).
_ct_bs->set_card_claimed(index);
_cards_done++;
cl.do_MemRegion(mr);
}
}
示例10: skc_raster_builder_pfn_release
static
void
skc_raster_builder_pfn_release(struct skc_raster_builder_impl * const impl)
{
// decrement reference count
if (--impl->raster_builder->refcount != 0)
return;
//
// otherwise, dispose of the the raster builder and its impl
//
struct skc_runtime * const runtime = impl->runtime;
// free the raster builder
skc_runtime_host_perm_free(runtime,impl->raster_builder);
// free durable/perm extents
skc_extent_phrwg_thr1s_free(runtime,&impl->path_ids);
skc_extent_phw1g_tdrNs_free(runtime,&impl->transforms);
skc_extent_phw1g_tdrNs_free(runtime,&impl->clips);
skc_extent_phw1g_tdrNs_free(runtime,&impl->fill_cmds);
skc_extent_phrwg_tdrNs_free(runtime,&impl->raster_ids);
// release kernels
cl(ReleaseKernel(impl->kernels.fills_expand));
cl(ReleaseKernel(impl->kernels.rasterize_all));
#if 0
cl(ReleaseKernel(impl->kernels.rasterize_lines));
cl(ReleaseKernel(impl->kernels.rasterize_quads));
cl(ReleaseKernel(impl->kernels.rasterize_cubics));
#endif
cl(ReleaseKernel(impl->kernels.segment));
cl(ReleaseKernel(impl->kernels.rasters_alloc));
cl(ReleaseKernel(impl->kernels.prefix));
// free the impl
skc_runtime_host_perm_free(runtime,impl);
}
示例11: main
int main (int argc, char *argv[] )
{
ODABAClient uti_client(argc > 1 ? argv[1] : NULL,"WorkSpace",argv[0],APT_Console);
CommandLine cl(NULL);
char tree_opt[3];
logical term = NO;
BEGINSEQ
CSUtilityHandle uti_handle(uti_client,"WorkSpace",argc > 1 ? argv[1] : NULL,argv[0],APT_Console);
std::cout << std::endl << "Running Workspace Utility ..." << std::endl;
std::cout.flush();
if ( CheckRuntimeParms(argc,argv,4,7) ) ERROR
if ( uti_handle.sdbures->SetupVariables(argv[2]) ) ERROR
cl.InputFromArguments(argc,argv);
*tree_opt = 0;
if ( cl.GetOption('T') || cl.GetOption('t') )
strcpy(tree_opt,"-T");
if ( UWorkspace(uti_handle,cl.Parm(2),cl.Parm(3),cl.Parm(4),tree_opt) )
ERROR
std::cout << std::endl << argv[3] << " Workspace terminated successfully." << std::endl;
std::cout.flush();
RECOVER
std::cout << std::endl << (argc > 3 ? argv[3] : "") << " Workspace"
<< (argc > 3 ? "" : " Utility") << " terminated with errors. See error log for details." << std::endl;
std::cout.flush();
term = YES;
ENDSEQ
uti_client.ShutDown();
return(term);
}
示例12: QString
QString CardOCR::suit(const QImage * img_wb, const QImage * img)
{
if ((img_wb->width() != img->width()) ||
(img_wb->height() != img->height()))
return QString();
const int w = img->width();
const int h = img->height();
QRgb clMinValue;
qreal minVal = 1.0;
for (int x = 0; x < w; ++x)
{
for (int y = 0; y < h; ++y)
{
QRgb rgb_wb = img_wb->pixel(x, y);
//рассматриваем только черные точки
if (rgb_wb == qRgb(0, 0, 0))
{
QRgb rgb = img->pixel(x, y);
QColor cl(rgb);
if (cl.valueF() < minVal)
{
minVal = cl.valueF();
clMinValue = rgb;
//qDebug() << x << y;
}
}
}
}
if (isRed(clMinValue))
return "h";
else if (isBlue(clMinValue))
return "d";
else if (isGreen(clMinValue))
return "c";
else
return "s";
return QString();
}
示例13: BuildJoinSpecs
void JoinCommand :: BuildJoinSpecs( const string & js ) {
if ( js == "" ) {
CSVTHROW( "No join specified with " << FLAG_COLS << " flag" );
}
ALib::CommaList cl( js );
for ( unsigned int i = 0; i < cl.Size(); i++ ) {
vector <string> cols;
if ( ALib::Split( cl.At(i), ':', cols ) != 2 ) {
CSVTHROW( "Invalid join specification: " << cl.At(i) );
}
int c1 = ALib::ToInteger( cols[0], "Invalid column: " + cols[0] );
int c2 = ALib::ToInteger( cols[1], "Invalid column: " + cols[1] );
if ( c1 < 1 || c2 < 1 ) {
CSVTHROW( "Invalid join specfication: " << cl.At(i) );
}
mJoinSpecs.push_back( std::make_pair( c1 - 1, c2 - 1 ) );
}
}
示例14: cl
void VCCueList_Test::keySequences()
{
QWidget w;
VCCueList cl(&w, m_doc);
cl.setNextKeySequence(QKeySequence(keySequenceB));
QCOMPARE(cl.nextKeySequence(), QKeySequence(keySequenceB));
QCOMPARE(cl.previousKeySequence(), QKeySequence());
QCOMPARE(cl.playbackKeySequence(), QKeySequence());
cl.setPreviousKeySequence(QKeySequence(keySequenceA));
QCOMPARE(cl.nextKeySequence(), QKeySequence(keySequenceB));
QCOMPARE(cl.previousKeySequence(), QKeySequence(keySequenceA));
QCOMPARE(cl.playbackKeySequence(), QKeySequence());
cl.setPlaybackKeySequence(QKeySequence(keySequenceD));
QCOMPARE(cl.nextKeySequence(), QKeySequence(keySequenceB));
QCOMPARE(cl.previousKeySequence(), QKeySequence(keySequenceA));
QCOMPARE(cl.playbackKeySequence(), QKeySequence(keySequenceD));
}
示例15: cl
void NR::bcucof(Vec_I_DP &y, Vec_I_DP &y1, Vec_I_DP &y2, Vec_I_DP &y12,
const DP d1, const DP d2, Mat_O_DP &c)
{
static int wt_d[16*16]=
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
-3, 0, 0, 3, 0, 0, 0, 0,-2, 0, 0,-1, 0, 0, 0, 0,
2, 0, 0,-2, 0, 0, 0, 0, 1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