本文整理汇总了C++中PropertyList::cbegin方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyList::cbegin方法的具体用法?C++ PropertyList::cbegin怎么用?C++ PropertyList::cbegin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyList
的用法示例。
在下文中一共展示了PropertyList::cbegin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: websocket_callback
//.........这里部分代码省略.........
d++;
}
}
}
}
else if (name == "subscribe")
{
//Websocket wants to subscribe to an event, data.front();
for (auto i=data.begin();i!=data.end();i++)
{
sinkManager->addSink(wsi,(*i),id);
}
}
else if (name == "unsubscribe")
{
//Websocket wants to unsubscribe to an event, data.front();
for (auto i=data.begin();i!=data.end();i++)
{
sinkManager->removeSink(wsi,(*i),id);
}
}
else if (name == "getSupportedEventTypes")
{
//If data.front() dosen't contain a property name, return a list of properties supported.
//if it does, then return the event types that particular property supports.
string typessupported = "";
if (data.size() == 0)
{
//Send what properties we support
typessupported = "\"running_status_speedometer\",\"running_status_engine_speed\",\"running_status_steering_wheel_angle\",\"running_status_transmission_gear_status\"";
PropertyList foo = sinkManager->getSupportedProperties();
PropertyList::const_iterator i=foo.cbegin();
while (i != foo.cend())
{
typessupported.append(",\"").append((*i)).append("\"");
i++;
}
}
else
{
//Send what events a particular property supports
if (data.front()== "running_status_speedometer")
{
typessupported = "\"get\",\"subscribe\",\"unsubscribe\",\"getSupportedEventTypes\"";
}
else if (data.front()== "running_status_engine_speed")
{
typessupported = "\"get\",\"subscribe\",\"unsubscribe\",\"getSupportedEventTypes\"";
}
else if (data.front() == "running_status_steering_wheel_angle")
{
typessupported = "\"get\",\"subscribe\",\"unsubscribe\",\"getSupportedEventTypes\"";
}
else if (data.front() == "running_status_transmission_gear_status")
{
typessupported = "\"get\",\"subscribe\",\"unsubscribe\",\"getSupportedEventTypes\"";
}
else
{
PropertyList foo = sinkManager->getSupportedProperties();
if (ListPlusPlus<VehicleProperty::Property>(&foo).contains(data.front()))
{
//sinkManager->addSingleShotSink(wsi,data.front(),id);
typessupported = "\"get\",\"subscribe\",\"unsubscribe\",\"getSupportedEventTypes\"";