本文整理汇总了C++中PolyDriverList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ PolyDriverList::size方法的具体用法?C++ PolyDriverList::size怎么用?C++ PolyDriverList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolyDriverList
的用法示例。
在下文中一共展示了PolyDriverList::size方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attachAll
bool AnalogServer::attachAll(const PolyDriverList &analog2attach)
{
yTrace();
if (analog2attach.size() != 1)
{
std::cerr<<"AnalogServer: cannot attach more than one device\n";
return false;
}
yarp::dev::PolyDriver * Idevice2attach=analog2attach[0]->poly;
if (Idevice2attach->isValid())
{
Idevice2attach->view(analogSensor_p);
}
if(NULL == analogSensor_p)
{
yError() << "AnalogServer: subdevice passed to attach method is invalid!!!";
return false;
}
attach(analogSensor_p);
start();
return true;
}
示例2: attachAll
bool AnalogWrapper::attachAll(const PolyDriverList &analog2attach)
{
//check if we already instantiated a subdevice previously
if (ownDevices)
return false;
if (analog2attach.size() != 1)
{
yError("AnalogWrapper: cannot attach more than one device");
return false;
}
yarp::dev::PolyDriver * Idevice2attach=analog2attach[0]->poly;
if (Idevice2attach->isValid())
{
Idevice2attach->view(analogSensor_p);
}
if(YARP_NULLPTR == analogSensor_p)
{
yError("AnalogWrapper: subdevice passed to attach method is invalid");
return false;
}
attach(analogSensor_p);
RateThread::setRate(_rate);
RateThread::start();
return true;
}
示例3: attachAll
bool BatteryWrapper::attachAll(const PolyDriverList &battery2attach)
{
if (battery2attach.size() != 1)
{
yError("BatteryWrapper: cannot attach more than one device");
return false;
}
yarp::dev::PolyDriver * Idevice2attach = battery2attach[0]->poly;
if (Idevice2attach->isValid())
{
Idevice2attach->view(battery_p);
}
if(NULL == battery_p)
{
yError("BatteryWrapper: subdevice passed to attach method is invalid");
return false;
}
attach(battery_p);
RateThread::setRate(_rate);
RateThread::start();
return true;
}
示例4: attachAll
bool JoypadControlServer::attachAll(const PolyDriverList& p)
{
if (p.size() != 1)
{
yError("JoypadControlServer: cannot attach more than one device");
return false;
}
yarp::dev::PolyDriver* Idevice2attach = p[0]->poly;
if(p[0]->key == "IJoypadController")
{
yInfo() << "JoypadControlServer: Good name Dude!";
}
else
{
yInfo() << "JoypadControlServer: Bad name Dude!!";
}
if (!Idevice2attach->isValid())
{
yError() << "JoypadControlServer: Device " << p[0]->key << " to attach to is not valid ... cannot proceed";
return false;
}
Idevice2attach->view(m_device);
if(!attach(m_device))
return false;
PeriodicThread::setPeriod(m_period);
if (!PeriodicThread::start())
return false;
openPorts();
return true;
}
示例5: attach
bool yarp::dev::ServerInertial::attachAll(const PolyDriverList &imuToAttachTo)
{
if (imuToAttachTo.size() != 1)
{
yError("ServerInertial: cannot attach more than one device");
return false;
}
return attach(imuToAttachTo[0]->poly);
}
示例6: yError
bool Rangefinder2DWrapper::attachAll(const PolyDriverList &device2attach)
{
if (device2attach.size() != 1)
{
yError("Rangefinder2DWrapper: cannot attach more than one device");
return false;
}
yarp::dev::PolyDriver * Idevice2attach = device2attach[0]->poly;
if (Idevice2attach->isValid())
{
Idevice2attach->view(sens_p);
Idevice2attach->view(iTimed);
}
if (NULL == sens_p)
{
yError("Rangefinder2DWrapper: subdevice passed to attach method is invalid");
return false;
}
attach(sens_p);
if(!sens_p->getDistanceRange(minDistance, maxDistance))
{
yError() << "Laser device does not provide min & max distance range.";
return false;
}
if(!sens_p->getScanLimits(minAngle, maxAngle))
{
yError() << "Laser device does not provide min & max angle scan range.";
return false;
}
if (!sens_p->getHorizontalResolution(resolution))
{
yError() << "Laser device does not provide horizontal resolution ";
return false;
}
RateThread::setRate(_rate);
RateThread::start();
return true;
}
示例7: attachAll
bool VirtualAnalogWrapper::attachAll(const PolyDriverList &polylist)
{
mMutex.wait();
for (int p=0; p<polylist.size(); ++p)
{
std::string key=polylist[p]->key.c_str();
// find appropriate entry in list of subdevices and attach
for (unsigned int k=0; k<mSubdevices.size(); ++k)
{
if (mSubdevices[k].getKey()==key)
{
if (!mSubdevices[k].attach(polylist[p]->poly,key))
{
mMutex.post();
return false;
}
}
}
}
//check if all devices are attached to the driver
for (unsigned int k=0; k<mSubdevices.size(); ++k)
{
if (!mSubdevices[k].isAttached())
{
mMutex.post();
return false;
}
}
mMutex.post();
Thread::start();
return true;
}
示例8: attachAllControlBoard
bool floatingBaseEstimator::attachAllControlBoard(const PolyDriverList& p)
{
PolyDriverList controlBoardList;
for(size_t devIdx = 0; devIdx < (size_t) p.size(); devIdx++)
{
IEncoders * pEncs = 0;
if( p[devIdx]->poly->view(pEncs) )
{
controlBoardList.push(const_cast<PolyDriverDescriptor&>(*p[devIdx]));
}
}
// Attach the controlBoardList to the controlBoardRemapper
bool ok = remappedControlBoardInterfaces.multwrap->attachAll(controlBoardList);
if( !ok )
{
yError() << " floatingBaseEstimator::attachAll in attachAll of the remappedControlBoard";
return false;
}
return true;
}
示例9: attachAll
/**
* IWrapper and IMultipleWrapper interfaces
*/
bool RGBDSensorWrapper::attachAll(const PolyDriverList &device2attach)
{
// First implementation only accepts devices with both the interfaces Framegrabber and IDepthSensor,
// on a second version maybe two different devices could be accepted, one for each interface.
// Yet to be defined which and how parameters shall be used in this case ... using the name of the
// interface to view could be a good initial guess.
if (device2attach.size() != 1)
{
yError("RGBDSensorWrapper: cannot attach more than one device");
return false;
}
yarp::dev::PolyDriver * Idevice2attach = device2attach[0]->poly;
if(device2attach[0]->key == "IRGBDSensor")
{
yInfo() << "RGBDSensorWrapper: Good name Dude!";
}
else
{
yInfo() << "RGBDSensorWrapper: Bad name Dude!!";
}
if (!Idevice2attach->isValid())
{
yError() << "RGBDSensorWrapper: Device " << device2attach[0]->key << " to attach to is not valid ... cannot proceed";
return false;
}
Idevice2attach->view(sensor_p);
if(!attach(sensor_p))
return false;
RateThread::setRate(rate);
RateThread::start();
return true;
}
示例10: attachAll
bool HapticDeviceWrapper::attachAll(const PolyDriverList &p)
{
if (p.size()!=1)
{
yError("*** Haptic Device Wrapper: cannot attach more than one device");
return false;
}
PolyDriver *dev=p[0]->poly;
if (dev->isValid())
dev->view(device);
if (device==NULL)
{
yError("*** Haptic Device Wrapper: invalid device");
return false;
}
start();
if (verbosity>0)
yInfo("*** Haptic Device Wrapper: started");
return true;
}