本文整理汇总了C++中IN函数的典型用法代码示例。如果您正苦于以下问题:C++ IN函数的具体用法?C++ IN怎么用?C++ IN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: STAT
// <stat> -> <in> | <out> | <block> | <if> | <loop> | <assign>
APTNode* STAT(void)
{
//printf("STAT node with sym = %s and text = %s \n", currentTok.sym, currentTok.selection);
APTNode* parentStatNode = createNonIdAPTNode("<STATtk>");
APTNode* childNode;
if (strcmp(currentTok.sym, "SCANFtk") == 0)
{
childNode = IN();
} else if (strcmp(currentTok.sym, "PRINTFtk") == 0)
{
childNode = OUT();
} else if (strcmp(currentTok.sym, "IFtk") == 0)
{
childNode = IF();
} else if (strcmp(currentTok.sym, "LOOPtk") == 0)
{
childNode = LOOP();
} else if (strcmp(currentTok.sym, "IDtk") == 0)
{
childNode = ASSIGN();
} else if (strcmp(currentTok.sym, "BEGINtk") == 0)
{
childNode = BLOCK();
} else errMsg("STATEMENT tok");
addChildNode(parentStatNode, childNode);
return parentStatNode;
}
示例2: FFT_next
void FFT_next(FFT *unit, int wrongNumSamples)
{
float *in = IN(1);
float *out = unit->m_inbuf + unit->m_pos + unit->m_shuntsize;
// int numSamples = unit->mWorld->mFullRate.mBufLength;
int numSamples = unit->m_numSamples;
// copy input
memcpy(out, in, numSamples * sizeof(float));
unit->m_pos += numSamples;
bool gate = ZIN0(4) > 0.f; // Buffer shunting continues, but no FFTing
if (unit->m_pos != unit->m_hopsize || !unit->m_fftsndbuf->data || unit->m_fftsndbuf->samples != unit->m_fullbufsize) {
if(unit->m_pos == unit->m_hopsize){
unit->m_pos = 0;
}
ZOUT0(0) = -1.f;
} else {
unit->m_pos = 0;
if(gate){
scfft_dofft(unit->m_scfft);
unit->m_fftsndbuf->coord = coord_Complex;
ZOUT0(0) = unit->m_fftbufnum;
} else {
ZOUT0(0) = -1;
}
// Shunt input buf down
memcpy(unit->m_inbuf, unit->m_inbuf + unit->m_hopsize, unit->m_shuntsize * sizeof(float));
}
}
示例3: IN
bool Client::network_IN(float dt)
{
IN(con, conID);
if (con->isConnected())
return true;
return false;
}
示例4: exit_handler
static void exit_handler(int32_t signum)
{
IN(DEBUG_MODEL_MISC, "signum %d", signum);
if(_gExitFlag)
return;
_gExitFlag=1;
cmd_queue_release();
menu_release();
menu_queue_release();
i2c_release();
pipe_uninit();
#if(_DEBUG_ == 1 && _DEBUG_TO_FILE_ == 1)
if(gDebugToFile == 1)
util_debug_file_uninit();
#endif
if(SIGQUIT == signum && _gQuitHandler)
_gQuitHandler(signum);
else if(SIGKILL == signum && _gKillHandler)
_gKillHandler(signum);
else if(SIGTERM == signum && _gTermHandler)
_gTermHandler(signum);
else if(SIGINT == signum && _gIntHandler)
{
debug_print(DEBUG_MODEL_MISC, "kekeke\n");
_gIntHandler(signum);
}
exit(0);
}
示例5: crypto_verify_signature
// verify a signature against a public sas key.
int crypto_verify_signature(unsigned char *sas_key,
unsigned char *content, int content_len,
unsigned char *signature_block, int signature_len)
{
IN();
if (signature_len!=SIGNATURE_BYTES)
RETURN(WHY("Invalid signature length"));
/* reconstitute signed message by putting hash at end of signature */
unsigned char reassembled[signature_len + content_len];
bcopy(signature_block, reassembled, signature_len);
bcopy(content, &reassembled[signature_len], content_len);
/* verify signature.
Note that crypto_sign_open requires m to be as large as signature, even
though it will not need the whole length eventually -- it does use the
full length and will overwrite the end of a short buffer. */
unsigned char message[sizeof(reassembled)+64];
unsigned long long mlen=0;
int result
=crypto_sign_edwards25519sha512batch_open(message,&mlen,
reassembled,sizeof(reassembled),
sas_key);
if (result)
RETURN(WHY("Signature verification failed"));
RETURN(0);
}
示例6: overlay_saw_mdp_containing_frame
int overlay_saw_mdp_containing_frame(struct overlay_frame *f, time_ms_t now)
{
IN();
/* Take frame source and destination and use them to populate mdp->in->{src,dst}
SIDs.
Take ports from mdp frame itself.
Take payload from mdp frame itself.
*/
overlay_mdp_frame mdp;
bzero(&mdp, sizeof(overlay_mdp_frame));
mdp.in.queue = f->queue;
mdp.in.ttl = f->ttl;
/* Get source and destination addresses */
if (f->destination)
bcopy(f->destination->sid,mdp.in.dst.sid,SID_SIZE);
else{
// pack the broadcast address into the mdp structure, note that we no longer care about the broadcast id
memset(mdp.in.dst.sid, 0xFF, SID_SIZE);
}
bcopy(f->source->sid,mdp.in.src.sid,SID_SIZE);
/* copy crypto flags from frame so that we know if we need to decrypt or verify it */
if (overlay_mdp_decrypt(f,&mdp))
RETURN(-1);
/* and do something with it! */
RETURN(overlay_saw_mdp_frame(f, &mdp,now));
OUT();
}
示例7: IN
//=======================
// PRIVATE
//=======================
void WebSocket::EvaluateREST(QString msg){
//Parse the message into it's elements and proceed to the main data evaluation
RestInputStruct IN(msg);
//NOTE: All the REST functionality is disabled for the moment, until we decide to turn it on again at a later time (just need websockets right now - not full REST)
if(DEBUG){
qDebug() << "New REST Message:";
qDebug() << " VERB:" << IN.VERB << "URI:" << IN.URI;
qDebug() << " HEADERS:" << IN.Header;
qDebug() << " BODY:" << IN.Body;
}
//Now check for the REST-specific verbs/actions
if(IN.VERB == "OPTIONS" || IN.VERB == "HEAD"){
RestOutputStruct out;
out.CODE = RestOutputStruct::OK;
if(IN.VERB=="HEAD"){
}else{ //OPTIONS
out.Header << "Allow: HEAD, GET";
out.Header << "Hosts: /syscache";
}
out.Header << "Accept: text/json";
out.Header << "Content-Type: text/json; charset=utf-8";
SOCKET->sendTextMessage(out.assembleMessage());
}else{
EvaluateRequest(IN);
}
}
示例8: dump_input_buffer
static void dump_input_buffer(pty_t * pty) {
char * c = pty->canon_buffer;
while (pty->canon_buflen > 0) {
IN(*c);
pty->canon_buflen--;
c++;
}
}
示例9: compute
void compute() {
double * RESTRICT in = this->in;
double * RESTRICT out = this->out;
int ii, jj;
for (int j=MAX(jstart,RADIUS); j<=MIN(n-1-RADIUS,jend); j++) {
for (int i=MAX(istart,RADIUS); i<=MIN(n-1-RADIUS,iend); i++) {
#if LOOPGEN
#include "loop_body_star.incl"
#else
for (jj=-RADIUS; jj<=RADIUS; jj++) OUT(i,j) += WEIGHT(0,jj)*IN(i,j+jj);
for (ii=-RADIUS; ii<0; ii++) OUT(i,j) += WEIGHT(ii,0)*IN(i+ii,j);
for (ii=1; ii<=RADIUS; ii++) OUT(i,j) += WEIGHT(ii,0)*IN(i+ii,j);
#endif
}
}
}
示例10: NearestN_next
void NearestN_next(NearestN *unit, int inNumSamples) {
GET_BUF
int ndims = unit->m_ndims;
if((int)bufChannels != (ndims + 3)) {
Print("NearestN: number of channels in buffer (%i) != number of input dimensions (%i) + 3\n",
bufChannels, ndims);
SETCALC(*ClearUnitOutputs);
return;
}
int num = unit->m_num;
float* bestlist = unit->m_bestlist;
float* inputdata = unit->m_inputdata;
for(int i=0; i<inNumSamples; ++i) {
if(IN(1)[i] > 0.f) { // If gate > 0
// Get data inputs, ALSO checking whether they've changed
bool inputchanged=false;
float chanval;
for(int chan=0; chan<ndims; ++chan) {
chanval = IN(chan + 3)[i];
if(inputdata[chan] != chanval) {
inputdata[chan] = chanval;
inputchanged = true;
}
}
if(inputchanged) {
// init the search: must set the results array to infinitely bad
for(int j=0; j<num; ++j) {
bestlist[3 * j ] = -1;
bestlist[3 * j + 1] = FLT_MAX;
bestlist[3 * j + 2] = -1;
}
// First, recurse from very top to get to the 'first guess' leaf.
int firstLeaf = NearestN_descend(1, ndims, inputdata, bufData, bufChannels, bufFrames);
// Then ascend back up the full tree (which may itself involve more descend+ascend loops)
NearestN_ascend(firstLeaf, 0, ndims, inputdata, bufData, bestlist, num, bufChannels, bufFrames);
}
} // End gate check
// The results should now be in 'bestlist' - let's write them to the output
for(int j=0; j< (num*3); ++j) {
OUT(j)[i] = bestlist[j];
}
} // end loop inNumSamples
}
示例11: draw_bitmap
int draw_bitmap(TTF_Bitmap *canvas, TTF_Bitmap *bitmap, int x, int y) {
CHECKPTR(canvas);
CHECKPTR(bitmap);
if (!IN(x, 0, canvas->w-1) || !IN(y, 0, canvas->h-1)) {
warn("failed to draw bitmap out of bounds");
return FAILURE;
}
/* Out of bounds checking is also done in bitmap_set,_get() */
for (int yb = 0; yb < bitmap->h; yb++) {
for (int xb = 0; xb < bitmap->w; xb++) {
bitmap_set(canvas, x+xb, y+yb, bitmap_get(bitmap, xb, yb));
}
}
return SUCCESS;
}
示例12: redir_lenth
static size_t redir_lenth(char *s)
{
size_t n;
n = IN(s[0], "012");
n += 1;
if (s[n] != '&' || s[n - 1] == '<')
return (n + IN(s[n], "<>"));
n += 1;
if (IN(s[n], "012"))
{
if (IN(s[n + 1], " \t\"'|&;()`") || !s[n + 1])
return (n + 1);
else
return (n - 1);
}
return (n - 1);
}
示例13: I2CswSendBit
static void I2CswSendBit(uint8_t bit)
{
if (bit)
IN(I2C_SDA); // Pullup SDA = 1
else
OUT(I2C_SDA); // Active SDA = 0
I2CswGetBit();
}
示例14: main
int main()
{
int i,T,n,m=0;
ll A[MAX];
ll B[MAX];
scanf("%d",&T);
while(T--){
m=0;
IN(n);
FOR(i,n)
IN(A[i]);
FOR(i,n)
IN(B[i]);
FOR(i,n)
m=max(m,monkiness(B,A[i],n)-i);
printf("%d\n",m);
}
}
示例15: IN
bool CRaspiProcessInterface::readPin(){
if(-1 != mPinNumber){
IN() = digitalRead(mPinNumber);
return true;
}else{
STATUS() = scmNotInitialised;
}
return false;
}