• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IN函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IN函数的典型用法代码示例。如果您正苦于以下问题:C++ IN函数的具体用法?C++ IN怎么用?C++ IN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IN函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:doniexun,项目名称:Compiler-32,代码行数:29,代码来源:parser.c


示例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));
	}
}
开发者ID:scztt,项目名称:sc-debug,代码行数:35,代码来源:FFT_UGens.cpp


示例3: IN

bool Client::network_IN(float dt)
{
	IN(con, conID);
	if (con->isConnected())
		return true;
	return false;
}
开发者ID:deathcleaver,项目名称:Tron3k,代码行数:7,代码来源:Client.cpp


示例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);
}
开发者ID:gooodmorningopenstack,项目名称:thecus-n2520,代码行数:28,代码来源:main.c


示例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);
}
开发者ID:petterreinholdtsen,项目名称:serval-dna,代码行数:30,代码来源:crypto.c


示例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();
}
开发者ID:Ivan-du-toit,项目名称:batphone,代码行数:31,代码来源:overlay_mdp.c


示例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);
  }
}
开发者ID:shithead,项目名称:pcbsd,代码行数:31,代码来源:WebSocket.cpp


示例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++;
	}
}
开发者ID:dardevelin,项目名称:ponyos,代码行数:8,代码来源:tty.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
        }
      }
    }
开发者ID:ParRes,项目名称:Kernels,代码行数:17,代码来源:stencil.C


示例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
}
开发者ID:noah-rush,项目名称:sc3-plugins,代码行数:45,代码来源:MCLDTreeUGens.cpp


示例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;
}
开发者ID:dluco,项目名称:ttf,代码行数:18,代码来源:bitmap.c


示例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);
}
开发者ID:Colliotv,项目名称:42.sh,代码行数:18,代码来源:subdiv.c


示例13: I2CswSendBit

static void I2CswSendBit(uint8_t bit)
{
    if (bit)
        IN(I2C_SDA);    // Pullup SDA = 1
    else
        OUT(I2C_SDA);   // Active SDA = 0

    I2CswGetBit();
}
开发者ID:WiseLord,项目名称:matrixclock,代码行数:9,代码来源:i2csw.c


示例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);    	
    }
}
开发者ID:Vijeta141,项目名称:SportProgramming,代码行数:18,代码来源:TheOldMonk.c


示例15: IN

bool CRaspiProcessInterface::readPin(){
  if(-1 != mPinNumber){
    IN() = digitalRead(mPinNumber);
    return true;
  }else{
    STATUS() = scmNotInitialised;
  }
  return false;
}
开发者ID:EstebanQuerol,项目名称:Black_FORTE,代码行数:9,代码来源:processinterface.cpp


示例16: compute

    void compute() {
      double * RESTRICT in = this->in;
      double * RESTRICT out = this->out;

      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++) {

          for (int jj=-RADIUS; jj<=RADIUS; jj++) {
            OUT(i-istart,j-jstart) += WEIGHT(0,jj)*IN(i-istart,j-jstart+jj);
	  }
          for (int ii=-RADIUS; ii<0; ii++) {
            OUT(i-istart,j-jstart) += WEIGHT(ii,0)*IN(i-istart+ii,j-jstart);
	  }
          for (int ii=1; ii<=RADIUS; ii++) {
            OUT(i-istart,j-jstart) += WEIGHT(ii,0)*IN(i-istart+ii,j-jstart);
	  }
        }
      }
    }
开发者ID:nchaimov,项目名称:ParResKernels,代码行数:19,代码来源:stencil.C


示例17: MatchingPResynth_next

void MatchingPResynth_next(MatchingPResynth *unit, int inNumSamples)
{
	GET_BUF

	int audioplaybackpos = unit->m_audioplaybackpos;
	float* audiobuf      = unit->m_audiobuf;
	int nactivs          = unit->m_nactivs;
	float* triggerinput  = IN(3);
	float* residualinput = IN(4);

	for (int i=0; i < inNumSamples; ++i)
	{
		// Ensure we keep within internal buffer limit
		if (audioplaybackpos == bufFrames){
			// Shunt the top half down to the start
			memmove(audiobuf, audiobuf + bufFrames, bufFrames * sizeof(float));
			audioplaybackpos = 0;
			// Clear the 'new' top half
			Clear(bufFrames, audiobuf + bufFrames);
		}
		// If trigger, add the activations to the output buffer
		if (triggerinput[i] > 0.f){
			//printf("Triggered\n");
			for(int which=0; which<nactivs; ++which){
				int whichchannel = static_cast<int>(IN(5 + which + which    )[i]);
				float magnitude  =                  IN(5 + which + which + 1)[i];
				//printf("Outputting channel %i at magnitude %g\n", whichchannel, magnitude);
				float *readpos = buf->data + whichchannel;
				for(int j=0; j<bufFrames; ++j){
					audiobuf[audioplaybackpos + j] += (*readpos) * magnitude;
					readpos += bufChannels;
				}
			}
		}
		// Output the reconstructed version plus residual
		float residualval = residualinput[i];
		OUT(0)[i] = audiobuf[audioplaybackpos] + residualval;
		++audioplaybackpos;
	}

	unit->m_audioplaybackpos = audioplaybackpos;
}
开发者ID:davidgranstrom,项目名称:sc3-plugins,代码行数:42,代码来源:MCLDSparseUGens.cpp


示例18: work_on_quote

static size_t work_on_quote(char *s, char **bad_sintax)
{
  char	quote[3];

  quote[0] = s[0];
  quote[1] = '\'';
  quote[2] = 0;
  if (!IN(quote[0], s + 1))
    *bad_sintax = my_strcat(UNMATCHED_TOKEN, quote);
  return (my_strilen(s + 1, quote[0]) + 2);
}
开发者ID:Colliotv,项目名称:42.sh,代码行数:11,代码来源:subdiv.c


示例19: UGEN_NAME_next

void UGEN_NAME_next( UGEN_NAME* unit, int inNumSamples ){

    float *in = IN(0);
    float *out = OUT(0);

    for(int i=0; i< inNumSamples; ++i){
        val = in[i];

        out[i] = val;
    }
}
开发者ID:jhuston,项目名称:ugengen,代码行数:11,代码来源:UGEN_NAME.cpp


示例20: R

double R(double x){ //Mills Ratio
	if (x > 4){
		return 1.0 / x;
	}
	double N = IC(x);
	double D = IN(x);
	if (D < pow(10,-15)){ //machine epsilon
		return 1.0 / pow(10,-15);
	}
	return exp(log(1. - N)-log(D));
}
开发者ID:dmalmer,项目名称:EMG,代码行数:11,代码来源:model.cpp



注:本文中的IN函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IN0函数代码示例发布时间:2022-05-30
下一篇:
C++ IMustLock函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap