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

C++ Channel函数代码示例

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

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



在下文中一共展示了Channel函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: caml_ml_flush_partial

CAMLprim value caml_ml_flush_partial(value vchannel)
{
  CAMLparam1 (vchannel);
  struct channel * channel = Channel(vchannel);
  int res;

  if (channel->fd == -1) CAMLreturn(Val_true);
  Lock(channel);
  res = caml_flush_partial(channel);
  Unlock(channel);
  CAMLreturn (Val_bool(res));
}
开发者ID:bobzhang,项目名称:ocaml,代码行数:12,代码来源:io.c


示例2: caml_ml_output_partial

CAMLprim value caml_ml_output_partial(value vchannel, value buff, value start,
                                      value length)
{
  CAMLparam4 (vchannel, buff, start, length);
  struct channel * channel = Channel(vchannel);
  int res;

  Lock(channel);
  res = caml_putblock(channel, &Byte(buff, Long_val(start)), Long_val(length));
  Unlock(channel);
  CAMLreturn (Val_int(res));
}
开发者ID:bobzhang,项目名称:ocaml,代码行数:12,代码来源:io.c


示例3: onAddChannelButtonPressed

void MainWindow::onAddChannelButtonPressed()
{
    if (m_session.isValid())
    {
        QString name = ui->channelNameEdit->text();
        QString description = ui->channelDescriptionEdit->text();
        QString url = ui->channelUrlEdit->text();

        m_applyChannelQuery->setQuery(Channel(name,description,url),m_session);
        m_applyChannelQuery->doRequest();
    }
}
开发者ID:4ukuta,项目名称:core,代码行数:12,代码来源:mainwindow.cpp


示例4: main

int main(void)
  {
    int i, j;
    unsigned short CRC_Xmit;
    unsigned short CRC_Recv;
    int Detected_Count = 0;
    int Okay_Count     = 0;

    /* Initialize. */
    for (i = 0; i < 1024; i++) {
      Raw_Data[i] = (unsigned char)i;
    }
    CRC_Xmit = CRC_Clear();
    Initialize_Noise(1.0e-5);

    /* Compute the CRC checksum. */
    for (i = 0; i < 1024; i++) {
      CRC_Xmit = CRC_Update(CRC_Xmit, Raw_Data[i]);
    }
    CRC_Xmit = CRC_Finish(CRC_Xmit);

    /* Now loop many times sending the block of data through the channel. */
    for (i = 0; i < 1024; i++) {
      CRC_Recv = CRC_Clear();

      for (j = 0; j < 1024; j++) {
        CRC_Recv = CRC_Update(CRC_Recv, Channel(Raw_Data[j]));
      }
      CRC_Recv = CRC_Update(CRC_Recv, Channel((CRC_Xmit & 0xFF00) >> 8));
      CRC_Recv = CRC_Update(CRC_Recv, Channel(CRC_Xmit & 0x00FF));

      if (CRC_Recv != 0) Detected_Count++;
        else Okay_Count++;
    }

    printf("Blocks with detected errors: %d\n", Detected_Count);
    printf("Blocks okay: %d\n", Okay_Count);

    return 0;
  }
开发者ID:pchapin,项目名称:spica,代码行数:40,代码来源:crc_tests.c


示例5: string2qstring

SensorDataSet SensorDB::ExecuteSQL_SelectFromSensorDataTable(std::string sqlcommand)
{
    SensorDataSet ds;
	ChannelList channelist;
    int channel_num;
    int datatype_id;
    int operator_id;
    int device_id;
    int position_id;
    int activity_id;
    int activitybeginframe_id;
    int activityendframe_id;
    double samplerate;
    QDateTime createtime;
    if(db.isOpen()){
        QSqlQuery query;
        QString sqlcmd = string2qstring(sqlcommand);
        if(query.exec(sqlcmd)){
                while(query.next()){
					datatype_id = query.value("DataTypeID").toInt();
                    activity_id = query.value("ActivityID").toInt();
                    device_id = query.value("DeviceID").toInt();
                    operator_id = query.value("OperatorID").toInt();
                    position_id = query.value("PositionID").toInt();
                    activitybeginframe_id = query.value("ActivityBeginFrameID").toInt();
                    activityendframe_id = query.value("ActivityEndFrameID").toInt();
                    samplerate = query.value("SampleRate").toDouble();
                    createtime = query.value("CreateTime").toDateTime();
					channel_num = query.value("TotalChannelNum").toInt();
					channelist.clear();
					for(int i=1;i<=channel_num;i++){
                        if(query.value(i).isNull()){
                            break;
                        }					
						string ch = "channel_"+int2string(i);						
						//qDebug() << query.value(string2qstring(ch.c_str())).toString();
						channelist.push_back(Channel(query.value(string2qstring(ch.c_str())).toString().toStdString()));
						//qDebug() << string2qstring((channelist[channelist.size()-1].ToString()));
					}
					ds.PushBackSensorData(SensorData(channelist,channel_num,datatype_id,operator_id,device_id,position_id,
                                         activity_id,activitybeginframe_id,activityendframe_id, samplerate,createtime));
                }
        }
        else{
            qDebug()<<query.lastError();
        }
    }
    else{
        qDebug()<<"DataBase is not opened";
    }
    return ds;
}
开发者ID:BloodyPudding,项目名称:SensorDB_API,代码行数:52,代码来源:sensordb.cpp


示例6: stream_of_channel

/* converts a Caml channel to a C FILE* stream */
static FILE * stream_of_channel(value chan, const char * mode) {
    int des;
    FILE * res ;
    struct channel *c_chan = Channel(chan) ;
    if(c_chan==NULL)
        return NULL;
    des = dup(c_chan->fd) ;
    res = fdopen(des, mode) ;
    if (des < 0 || res == NULL) {
        caml_failwith("failed to duplicate caml channel");
    }
    return res ;
}
开发者ID:aziem,项目名称:ocaml-buddy,代码行数:14,代码来源:libbuddy_stubs.c


示例7: caml_ml_input_int

CAMLprim value caml_ml_input_int(value vchannel)
{
  CAMLparam1 (vchannel);
  struct channel * channel = Channel(vchannel);
  intnat i;

  Lock(channel);
  i = caml_getword(channel);
  Unlock(channel);
#ifdef ARCH_SIXTYFOUR
  i = (i << 32) >> 32;          /* Force sign extension */
#endif
  CAMLreturn (Val_long(i));
}
开发者ID:bobzhang,项目名称:ocaml,代码行数:14,代码来源:io.c


示例8: ForwardTransaction

 void OutgoingResourceLimiter::ForwardMessage(string_t type, uint160 hash)
 {
     if (type == "tx")
         return ForwardTransaction(hash);
     string_t channel = Channel(type);
     with_msg_as_instance_of_(type, hash,
         if (channel == "trade")
             flexnode.tradehandler.BroadcastMessage(msg);
         else if (channel == "relay")
             flexnode.relayhandler.BroadcastMessage(msg);
         else if (channel == "deposit")
             flexnode.deposit_handler.BroadcastMessage(msg);
         )
 }
开发者ID:peer-node,项目名称:flex,代码行数:14,代码来源:resourcemonitor.cpp


示例9: Channel

// returns a status message regarding the successful or unsuccesful
//    creation of a channel
std::string IRCCommandHandler::createChannel() {
  // CREATECHANNEL channelname username
  std::string channel {arguments[0]};
  std::string user    {arguments[1]};

  std::string result;
  if (channels.count(channel) || channel == "server") {
    result = "Error: Channel '"+channel+"' already exists";
  }
  else {
    channels.emplace(channel, Channel(channel));
    channels.at(channel).addUser(user);
    result = "Successfully created channel '"+channel+"'";
  }
  return result;
}
开发者ID:FundCompXbee,项目名称:XBeeMessenger,代码行数:18,代码来源:IRCCommandHandler.cpp


示例10: VLOG

boost::system::error_code RtspService::createChannel(uint32_t uiChannelId, const std::string& sChannelName, const AudioChannelDescriptor& audioDescriptor)
{
  VLOG(2) << "createChannel: " << uiChannelId;
  boost::mutex::scoped_lock l(m_channelLock);
  ChannelMap_t::iterator it = m_mChannels.find(uiChannelId);
  if (it != m_mChannels.end())
  {
    return boost::system::error_code(boost::system::errc::file_exists, boost::system::get_generic_category());
  }
  else
  {
    m_qChannelsToBeAdded.push_back(Channel(uiChannelId, sChannelName, audioDescriptor));
    return boost::system::error_code();
  }
  return boost::system::error_code();
}
开发者ID:duongbaoduy,项目名称:LiveMediaExt,代码行数:16,代码来源:RtspService.cpp


示例11: SimulateRead

    string SimulateRead(const SequencingParameters& p,
                        const std::string& tpl,
                        RandomNumberGenerator& rng)
    {
        std::string read;
        read.reserve(tpl.length() * 2);

        int pos = 0;
        while (pos < (int)tpl.length())
        {
            char base = tpl[pos];
            char prevBase = pos > 0 ? tpl[pos-1] : 'N';
            int channel = Channel(base);

            //
            // Tabulate the different possible move probabilities, then choose one
            //
            bool canMerge =  base == prevBase;
            vector<double> errorProbs = ErrorProbs(p, channel, canMerge);
            int choice = rng.RandomChoice(errorProbs);

            if (choice == (int) errorProbs.size() - 1) {  // Match
                read.push_back(base);
                pos++;

            } else if (choice < 4) {                     // Insert
                vector<double> insertProbs = vector<double>(errorProbs.begin(),
                                                            errorProbs.begin() + 4);
                int eChannel = rng.RandomChoice(insertProbs);
                char eBase = "TGAC"[eChannel];
                read.push_back(eBase);

            } else if (choice == 4) {                   // Dark
                pos++;

            } else if (choice == 5) {                   // Miscall
                read.push_back(rng.RandomBase());
                pos++;

            } else {                                   // Merge
                assert (canMerge);
                pos++;
            }
        }

        return read;
    }
开发者ID:evolvedmicrobe,项目名称:ConsensusCore,代码行数:47,代码来源:Simulator.cpp


示例12: win_filedescr_of_channel

CAMLprim value win_filedescr_of_channel(value vchan)
{
  CAMLparam1(vchan);
  CAMLlocal1(fd);
  struct channel * chan;
  HANDLE h;

  chan = Channel(vchan);
  if (chan->fd == -1) uerror("descr_of_channel", Nothing);
  h = (HANDLE) _get_osfhandle(chan->fd);
  if (chan->flags & CHANNEL_FLAG_FROM_SOCKET)
    fd = win_alloc_socket((SOCKET) h);
  else
    fd = win_alloc_handle(h);
  CRT_fd_val(fd) = chan->fd;
  CAMLreturn(fd);
}
开发者ID:d5nguyenvan,项目名称:mirage,代码行数:17,代码来源:channels.c


示例13: SetStatus

void TransportStreamFilter::SetStatus(bool On) {
    cFilter::SetStatus(On);
#if VDRVERSNUM <= 10327
#error "Unfortunately, VDR versions up to 1.3.27 contain a bug that prevents this code from working properly. Please use VDR version 1.3.28 or later."
#endif
    //printf("TransportStreamFilter::SetStatus , status is %d, On is %d\n", status, On);
    TransportStreamID currentTs=TransportStream(Channel()).GetTransportStreamID();
    if (On) {
        switch (status) {
        case TransportStreamUnknown:
            ts=currentTs;
            status=Active;
            AddFilterData();
            break;
        case Active:
            break; // should not happen
        case Inactive:
        case OnOtherTransportStream:
            if (currentTs == ts) {
                status=Active;
                AddFilterData();
            } else {
                status=OnOtherTransportStream;
                OtherTransportStream(currentTs);
            }
            break;
        case Deactivated:
            break;
        }
    } else {
        switch (status) {
        case TransportStreamUnknown:
            break;
        case Active:
            status=Inactive;
            RemoveFilterData();
            break;
        case Inactive:
        case OnOtherTransportStream:
            break;
        case Deactivated:
            break;
        }
    }
    //printf("TransportStreamFilter::SetStatus, leaving, status is %d\n", status);
}
开发者ID:BackupTheBerlios,项目名称:mhpforvdr-svn,代码行数:46,代码来源:filter.c


示例14: caml_ml_output

CAMLprim value caml_ml_output(value vchannel, value buff, value start,
                              value length)
{
  CAMLparam4 (vchannel, buff, start, length);
  struct channel * channel = Channel(vchannel);
  intnat pos = Long_val(start);
  intnat len = Long_val(length);

  Lock(channel);
    while (len > 0) {
      int written = caml_putblock(channel, &Byte(buff, pos), len);
      pos += written;
      len -= written;
    }
  Unlock(channel);
  CAMLreturn (Val_unit);
}
开发者ID:bobzhang,项目名称:ocaml,代码行数:17,代码来源:io.c


示例15: Channel

Channel Channel::downsampleEnergy(unsigned factor) const
{
	if(factor>0)
	{
		unsigned newSize=data.size()/factor;
		std::vector<float> target=std::vector<float>(newSize);
		float acc;
		for(unsigned i=0,j=0;j<newSize;j++)
		{
			acc=0;
			for(unsigned k=0;k<factor && i<data.size();k++)
				acc+=sqr(data[i++]);
			target[j]=sqrt(acc/factor);
		}
		return Channel(rate/factor,target);
	} else
		return *this;
}
开发者ID:sritterbusch,项目名称:ospac,代码行数:18,代码来源:Channel.cpp


示例16: header

void ZFnEXR::saveCameraNZ(float* data, M44f mat, float fov, const char* filename, int width, int height)
{
	Header header (width, height); 
	header.insert ("fov", DoubleAttribute (fov)); 
	header.insert ("cameraTransform", M44fAttribute (mat));
	header.channels().insert ("R", Channel (FLOAT));
	
	OutputFile file (filename, header); 
	FrameBuffer frameBuffer;

	frameBuffer.insert ("R", 
						Slice (FLOAT, 
							   (char *) data, 
							   sizeof (*data) * 1, 
							   sizeof (*data) * width)); 
	file.setFrameBuffer (frameBuffer);              
	file.writePixels (height);
}
开发者ID:saggita,项目名称:makoto,代码行数:18,代码来源:zFnEXR.cpp


示例17: LOG

Channel Channel::resampleTo(unsigned newRate) const
{
	unsigned newSize=(data.size()*newRate)/rate;
	std::vector<float> target=std::vector<float>(newSize);
	LOG(logDEBUG) << "Old rate "<< rate << " New Rate: " << newRate << std::endl;
	LOG(logDEBUG) << "Old size " << data.size() << " New Size: " << newSize << std::endl;

	unsigned oldSize=data.size();

	// TODO: Only nearest "interpolation"...
	for(unsigned i=0;i<newSize;i++)
	{
		int j=(long(i)*oldSize)/newSize;
		target[i]=data[j];
	}

	LOG(logDEBUG) << "done"<< std::endl;
	return Channel(newRate,target);
}
开发者ID:sritterbusch,项目名称:ospac,代码行数:19,代码来源:Channel.cpp


示例18: caml_ml_close_channel

CAMLprim value caml_ml_close_channel(value vchannel)
{
  int result;

  /* For output channels, must have flushed before */
  struct channel * channel = Channel(vchannel);
  if (channel->fd != -1){
    result = close(channel->fd);
    channel->fd = -1;
  }else{
    result = 0;
  }
  /* Ensure that every read or write on the channel will cause an
     immediate caml_flush_partial or caml_refill, thus raising a Sys_error
     exception */
  channel->curr = channel->max = channel->end;
  if (result == -1) caml_sys_error (NO_ARG);
  return Val_unit;
}
开发者ID:joechenq,项目名称:multi-script,代码行数:19,代码来源:ocaml_io.c


示例19: Channel

bool Box::createdChannel(const string& name)
{
	bool found = false;
	for (int i = 0; i < channels.size(); i++)
	if (channels[i].getName() == name)
	{
		found = true;
		break;
	}
	if (found)
		return false;
	else
	{
	Channel ctemp = Channel(name);
	this->channels.push_back(ctemp);
	sort(channels.begin(), channels.end());
	return true;
	}

}
开发者ID:Nunommpinto,项目名称:Prog,代码行数:20,代码来源:Box.cpp


示例20: ml_gsl_monte_vegas_set_params

CAMLprim value ml_gsl_monte_vegas_set_params(value state, value params)
{
    gsl_monte_vegas_state *s = GSLVEGASSTATE_VAL(state);
    s->alpha      = Double_val(Field(params, 0));
    s->iterations = Int_val(Field(params, 1));
    s->stage      = Int_val(Field(params, 2));
    s->mode       = Int_val(Field(params, 3)) - 1;
    s->verbose    = Int_val(Field(params, 4));
    {
        value vchan = Field(params, 5);
        if(Is_block(vchan)) {
            struct channel *chan=Channel(Field(vchan, 0));
            if(s->ostream != stdout && s->ostream != stderr)
                fclose(s->ostream);
            flush(chan);
            s->ostream = fdopen(dup(chan->fd), "w");
            GSLVEGASSTREAM_VAL(state) = vchan;
        }
    }
    return Val_unit;
}
开发者ID:oandrieu,项目名称:ocamlgsl,代码行数:21,代码来源:mlgsl_monte.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ CharGetDatum函数代码示例发布时间:2022-05-30
下一篇:
C++ Changed函数代码示例发布时间: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