本文整理汇总了C++中rdata函数的典型用法代码示例。如果您正苦于以下问题:C++ rdata函数的具体用法?C++ rdata怎么用?C++ rdata使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rdata函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pinmode
String pinmode()
{
int pin=str2int(rdata("pin ?"));
int mode=str2int(rdata("mode ?"));
pinMode(pin,mode);
return "";
}
示例2: pulsein
String pulsein()
{
int pin=str2int(rdata("pin ?"));
int value=str2int(rdata("value ?"));
int timeout=str2int(rdata("timeout ?"));
return pulseIn(pin, value, timeout);
}
示例3: AddPoint
RcppExport SEXP AddPoint(SEXP x,SEXP d) {
try {
Rcpp::XPtr< flann::Index<flann::L2<float> > > index(x);
Rcpp::NumericVector rdata(d);
int colNum = rdata.size();
flann::Matrix<float> input(new float[colNum], 1, colNum);
for (int i = 0; i < colNum; i++) {
input[0][i] = rdata(i);
}
index->addPoints(input);
return R_NilValue; // -Wall
} catch( std::exception &ex ) { // or use END_RCPP macro
forward_exception_to_r( ex );
} catch(...) {
::Rf_error( "c++ exception (unknown reason)" );
}
return R_NilValue; // -Wall
}
示例4: rattr
static void rattr(unsigned verb, SkStream& s, BMLW& rec, SkXMLWriter& writer)
{
int data = verb & 31;
verb >>= 5;
int nameIndex, valueIndex;
switch (verb) {
case kAttr_Value_Value_Verb:
nameIndex = rec.fNextName; // record before the ++
set(rec.fNames, rec.fNextName++, s, data);
valueIndex = rec.fNextValue; // record before the ++
set(rec.fValues, rec.fNextValue++, s, 31);
break;
case kAttr_Value_Index_Verb:
nameIndex = rec.fNextName; // record before the ++
set(rec.fNames, rec.fNextName++, s, data);
valueIndex = rbyte(s);
break;
case kAttr_Index_Value_Verb:
nameIndex = rdata(s, data);
valueIndex = rec.fNextValue; // record before the ++
set(rec.fValues, rec.fNextValue++, s, 31);
break;
case kAttr_Index_Index_Verb:
nameIndex = rdata(s, data);
valueIndex = rbyte(s);
break;
default:
SkDEBUGFAIL("bad verb");
return;
}
writer.addAttribute(rec.fNames[nameIndex], rec.fValues[valueIndex]);
}
示例5: analogwrite
String analogwrite()
{
int pin=str2int(rdata("pin ?"));
int value=str2int(rdata("value ?"));
analogWrite(pin, value);
return "";
}
示例6: shiftin
String shiftin()
{
int dataPin=str2int(rdata("dataPin ?"));
int clockPin=str2int(rdata("clockPin ?"));
int bitOrder=str2int(rdata("bitOrder ?"));
return shiftIn(dataPin, clockPin, bitOrder);
}
示例7: digitalwrite
String digitalwrite()
{
int pin=str2int(rdata("pin ?"));
int value=str2int(rdata("value ?"));
digitalWrite(pin,value);
return "";
}
示例8: CreateCenters
RcppExport SEXP CreateCenters(SEXP d) {
try {
Rcpp::NumericVector rdata(d);
int colNum = rdata.size();
flann::Matrix<float> input(new float[colNum], 1, colNum);
for (int i = 0; i < colNum; i++) {
input[0][i] = rdata(i);
}
flann::Index<flann::L2<float> >* index = new flann::Index<flann::L2<float> >(input,flann::KDTreeSingleIndexParams());
index->buildIndex();
Rcpp::XPtr< flann::Index<flann::L2<float> > > p(index, true);
return p; // -Wall
} catch( std::exception &ex ) { // or use END_RCPP macro
forward_exception_to_r( ex );
} catch(...) {
::Rf_error( "c++ exception (unknown reason)" );
}
return R_NilValue; // -Wall
}
示例9: tones
String tones()
{
int pin=str2int(rdata("pin ?"));
int frequency=str2int(rdata("frequency ?"));
int duration=str2int(rdata("duration ?"));
tone(pin, frequency, duration);
return "";
}
示例10: shiftout
String shiftout()
{
int dataPin=str2int(rdata("dataPin ?"));
int clockPin=str2int(rdata("clockPin ?"));
int bitOrder=str2int(rdata("bitOrder ?"));
int value=str2int(rdata("value ?"));
shiftOut(dataPin, clockPin, bitOrder, value);
return "";
}
示例11: init
void
init() /* everything for 1st time run */
{
rdata(); /* read data from orig. file */
linkdata();
poof();
}
示例12: equalizeHistogram
void equalizeHistogram ()
{
real_array_type rdata( boost::extents[getSizeX()][getSizeY()] );
Abstract2dData::getRealSpaceData(&rdata);
SingleParticle2dx::Utilities::DataContainerFunctions::equalizeHistogram(&rdata);
Abstract2dData::setFourierSpaceData(&rdata);
}
示例13: r64
u64 r64 (addr address)
{
u64 x;
rdata(address, &x, sizeof(x));
return x;
}
示例14: init
/* everything for 1st time run */
void
init(void)
{
rdata(); /* read data from orig. file */
linkdata();
poof();
}
示例15: loop
void loop()
{
cmdlck = "";
cmd = rdata("?");
cmdlck = cmd;
sprintln(funcparser(cmd));
}