您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ subscribe函数代码示例

51自学网 2021-06-03 08:33:16
  C++
这篇教程C++ subscribe函数代码示例写得很实用,希望能帮到您。

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

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

示例1: subscribe

double CameraWorker::_getProp(int prop){    if (!props.contains(prop))    {        subscribe();        props[prop] = cam.get(prop);        emit propProbingFinished(prop, props[prop]);        unsubscribe();    }    return props.value(prop);}
开发者ID:ACKino,项目名称:qTox,代码行数:12,


示例2: main

int main(int argc, char *argv[]){    auto values = rxcpp::observable<>::from(1, 2, 2, 3, 3, 3, 4, 5, 5, 6)                        .distinct()                        //.distinct_until_changed();                        .filter([](int v) { return v % 2; })                        .max();    values.subscribe([](int v) { printf("%d ", v); }, []{});        return 0;}
开发者ID:MagnusTiberius,项目名称:code,代码行数:12,


示例3: m_connected

ConnectionInfo::ConnectionInfo() :		m_connected(false), m_interfaceName("Unknown"), m_interfaceType(				ConnectionInfo::Unknown) {	subscribe(netstatus_get_domain());	bps_initialize();	// Request all network status events.	netstatus_request_events(0);	info = NULL;}
开发者ID:rodrigopex,项目名称:CheckInternetMicroSample,代码行数:12,


示例4: DEBUG_TAG

void QApplicationStatus::start(){#ifdef QT_DEBUG   DEBUG_TAG(1, "status", "start")#endif    updateState(Connecting);    if (connectSockets())    {        subscribe();    }}
开发者ID:OEMBureau,项目名称:QtQuickVcp,代码行数:12,


示例5: QWidget

MainWindow::MainWindow() : QWidget(), _positionUpdatedTimer(this), _body(this), _icon(CreateIcon()), _titleText(qsl("Telegram")) {	subscribe(Theme::Background(), [this](const Theme::BackgroundUpdate &data) {		if (data.paletteChanged()) {			if (_title) {				_title->update();			}			updatePalette();		}	});	subscribe(Global::RefUnreadCounterUpdate(), [this] { updateUnreadCounter(); });	subscribe(Global::RefWorkMode(), [this](DBIWorkMode mode) { workmodeUpdated(mode); });	subscribe(Messenger::Instance().authSessionChanged(), [this] { checkAuthSession(); });	checkAuthSession();	_isActiveTimer.setCallback([this] { updateIsActive(0); });	_inactivePressTimer.setCallback([this] { setInactivePress(false); });}
开发者ID:zhangsoledad,项目名称:tdesktop,代码行数:21,


示例6: unsubscribe

void OctreeVisualizer::setOctreeTopic(const std::string& topic){  unsubscribe();  octree_topic_ = topic;  subscribe();  if ( property_grid_ )  {    property_grid_->SetPropertyValue( property_grid_->GetProperty( property_prefix_ + TOPIC_PROPERTY ), wxString::FromAscii( octree_topic_.c_str() ) );  }}
开发者ID:janfrs,项目名称:kwc-ros-pkg,代码行数:13,


示例7: switch

bool ListRenders::caseMessage( af::Msg* msg){//AFINFO("ListRenders::caseMessage:/n");   switch( msg->type())   {   case af::Msg::TRendersList:      af::MCAfNodes nodes( msg);      setList( nodes);      subscribe();      return true;   }   return false;}
开发者ID:AlbertR,项目名称:cgru170,代码行数:13,


示例8: unsubscribe

/*!  All ROS interfaces are shutdown and then restarted after the topic name has  been changed. By shutting down all interfaces, it simplifies the process  */void ImageMapDisplay::setMobotPoseCount(const std::string& topic){    unsubscribe();    clear();    try {        mobotPoseCount = boost::lexical_cast<int>(topic);    } catch( boost::bad_lexical_cast const& ) {        mobotPoseCount = 0;        ROS_ERROR("Error: mobot pose count was not valid %s", topic.c_str());    }    subscribe();    propertyChanged(mobotPoseCountProperty);    causeRender();}
开发者ID:Mobots,项目名称:mobots,代码行数:17,


示例9: robot_state_

  // constructor  OdomEstimationNode::OdomEstimationNode()    : ros::node("odom_estimation"),      robot_state_(*this, true),      odom_broadcaster_(*this),      vo_notifier_(&robot_state_, this,  boost::bind(&OdomEstimationNode::voCallback, this, _1), "vo", "base_link", 10),      vel_desi_(2),      vel_active_(false),      odom_active_(false),      imu_active_(false),      vo_active_(false),      odom_initializing_(false),      imu_initializing_(false),      vo_initializing_(false)  {    // advertise our estimation    advertise<robot_msgs::PoseWithCovariance>("odom_estimation",10);    // subscribe to messages    subscribe("cmd_vel",      vel_,  &OdomEstimationNode::velCallback,  10);    subscribe("odom",         odom_, &OdomEstimationNode::odomCallback, 10);    subscribe("imu_data",     imu_,  &OdomEstimationNode::imuCallback,  10);    // paramters    param("odom_estimation/freq", freq_, 30.0);    param("odom_estimation/sensor_timeout", timeout_, 1.0);    // fiexed transform between camera frame and vo frame    vo_camera_ = Transform(Quaternion(M_PI/2.0, -M_PI/2,0), Vector3(0,0,0));    #ifdef __EKF_DEBUG_FILE__    // open files for debugging    odom_file_.open("odom_file.txt");    imu_file_.open("imu_file.txt");    vo_file_.open("vo_file.txt");    corr_file_.open("corr_file.txt");    time_file_.open("time_file.txt");    extra_file_.open("extra_file.txt");#endif  };
开发者ID:janfrs,项目名称:kwc-ros-pkg,代码行数:40,


示例10: lock

void PointcloudFloorFilter::connectCb(){  boost::lock_guard<boost::mutex> lock(connect_mutex_);   if (!pointcloud_pub_.getNumSubscribers())   {     unsubscribe();   }   else   {     subscribe();   }}
开发者ID:Yvaine,项目名称:pointcloud_floor_filter,代码行数:13,


示例11: unsubscribe

void LaserScanVisualizer::setScanTopic( const std::string& topic ){  unsubscribe();  scan_topic_ = topic;  subscribe();  if ( property_grid_ )  {    property_grid_->SetPropertyValue( property_grid_->GetProperty( property_prefix_ + SCAN_TOPIC_PROPERTY ), wxString::FromAscii( scan_topic_.c_str() ) );  }}
开发者ID:janfrs,项目名称:kwc-ros-pkg,代码行数:13,


示例12: va_start

GStatsProfiler::GStatsProfiler(const char *format, ...){  char *str;  va_list ap;  va_start(ap, format);  str = getText(format, ap);  va_end(ap);  name = str;  subscribe();}
开发者ID:demoHui,项目名称:CCOW,代码行数:13,


示例13: BlockWidget

BackgroundWidget::BackgroundWidget(QWidget *parent, UserData *self) : BlockWidget(parent, self, lang(lng_settings_section_background)) {	createControls();	subscribe(FileDialog::QueryDone(), [this](const FileDialog::QueryUpdate &update) {		notifyFileQueryUpdated(update);	});	subscribe(Window::chatBackground(), [this](const Window::ChatBackgroundUpdate &update) {		using Update = Window::ChatBackgroundUpdate;		if (update.type == Update::Type::New) {			_background->updateImage();		} else if (update.type == Update::Type::Start) {			needBackgroundUpdate(update.tiled);		}	});	subscribe(Adaptive::Changed(), [this]() {		if (Global::AdaptiveLayout() == Adaptive::WideLayout) {			_adaptive->slideDown();		} else {			_adaptive->slideUp();		}	});}
开发者ID:crystalidea,项目名称:tdesktop,代码行数:22,


示例14: unsubscribe

void RobotModelDisplay::setMechanismTopic( const std::string& topic ){  unsubscribe();  mechanism_topic_ = topic;  subscribe();  if ( mechanism_topic_property_ )  {    mechanism_topic_property_->changed();  }}
开发者ID:janfrs,项目名称:kwc-ros-pkg,代码行数:13,


示例15: subscribe

void PointGroupFactoryImpl::subscribePointGroup(    const std::string &hmSymbol, const std::string &generatorString,    const std::string &description) {  if (isSubscribed(hmSymbol)) {    throw std::invalid_argument(        "Point group with this symbol is already registered.");  }  PointGroupGenerator_sptr generator = boost::make_shared<PointGroupGenerator>(      hmSymbol, generatorString, description);  subscribe(generator);}
开发者ID:DanNixon,项目名称:mantid,代码行数:13,


示例16: BlockWidget

NotificationsWidget::NotificationsWidget(QWidget *parent, UserData *self) : BlockWidget(parent, self, lang(lng_settings_section_notify)) {	createControls();	subscribe(AuthSession::Current().notifications().settingsChanged(), [this](ChangeType type) {		if (type == ChangeType::DesktopEnabled) {			desktopEnabledUpdated();		} else if (type == ChangeType::ViewParams) {			viewParamUpdated();		} else if (type == ChangeType::SoundEnabled) {			_playSound->setChecked(Global::SoundNotify());		}	});}
开发者ID:Peque,项目名称:tdesktop,代码行数:13,


示例17: unsubscribe

void RosoutPanel::setTopic(const std::string& topic){  if (topic == topic_)  {    return;  }  unsubscribe();  topic_ = topic;  subscribe();}
开发者ID:andrewsy,项目名称:asctec_drivers_andrewsy,代码行数:13,


示例18: unsubscribe

    void AmbientSoundDisplay::setTopic( const std::string& topic )/*{{{*/    {        unsubscribe();        clear();        topic_ = topic;        subscribe();        // Broadcast the fact that the variable has changed.        propertyChanged( topic_property_ );        // Make sure rviz renders the next time it gets a chance.        causeRender();    }/*}}}*/
开发者ID:CPFL,项目名称:jsk_visualization_packages,代码行数:13,


示例19: PointCloudSnapshotter

  PointCloudSnapshotter() : ros::node("point_cloud_snapshotter")  {    prev_signal_.header.stamp.fromNSec(0) ;        advertise<PointCloud> ("full_cloud", 1) ;    subscribe("laser_scanner_signal", cur_signal_, &PointCloudSnapshotter::scannerSignalCallback, 40) ;    std::string default_fixed_frame = "torso" ;    param("~fixed_frame", fixed_frame_, std::string("torso")) ;        first_time_ = true ;  }
开发者ID:janfrs,项目名称:kwc-ros-pkg,代码行数:13,


示例20: showMenu

void SubscribeToolButton::subscribePrivate(){	if (menu()) {#ifdef USE_MENUBUTTONPOPUP		showMenu();#endif		return;	}	emit subscribe(true);	setSubscribed(true);}
开发者ID:G10h4ck,项目名称:RetroShare,代码行数:13,


示例21: createSubscriptionContext

Status ProcessEventSubscriber::init() {  auto sc = createSubscriptionContext();  // Monitor for execve syscalls.  sc->rules.push_back({AUDIT_SYSCALL_EXECVE, ""});  // Request call backs for all parts of the process execution state.  // Drop events if they are encountered outside of the expected state.  sc->types = {AUDIT_SYSCALL, AUDIT_EXECVE, AUDIT_CWD, AUDIT_PATH};  subscribe(&ProcessEventSubscriber::Callback, sc);  return Status(0, "OK");}
开发者ID:1514louluo,项目名称:osquery,代码行数:13,


示例22: setSearchNoResultsText

void ChatSearchFromController::prepare() {	setSearchNoResultsText(lang(lng_blocked_list_not_found));	delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);	delegate()->peerListSetTitle(langFactory(lng_search_messages_from));	rebuildRows();	subscribe(Notify::PeerUpdated(), Notify::PeerUpdatedHandler(Notify::PeerUpdate::Flag::MembersChanged, [this](const Notify::PeerUpdate &update) {		if (update.peer == _chat) {			rebuildRows();		}	}));}
开发者ID:eegorov,项目名称:tdesktop,代码行数:13,


示例23: TEST_F

TEST_F(FSEventsTests, test_fsevents_event_action) {  // Assume event type is registered.  StartEventLoop();  // Simulate registering an event subscriber.  auto sub = std::make_shared<TestFSEventsEventSubscriber>();  auto status = sub->init();  auto sc = sub->GetSubscription(real_test_path, 0);  EventFactory::registerEventSubscriber(sub);  sub->subscribe(&TestFSEventsEventSubscriber::Callback, sc);  event_pub_->configure();  CreateEvents();  sub->WaitForEvents(kMaxEventLatency, 1);  // Make sure the fsevents action was expected.  ASSERT_TRUE(sub->actions_.size() > 0);  bool has_created = false;  bool has_unknown = false;  {    WriteLock lock(sub->mutex_);    for (const auto& action : sub->actions_) {      // Expect either a created event or attributes modified event.      if (action == "CREATED" || action == "ATTRIBUTES_MODIFIED") {        has_created = true;      } else if (action == "UNKNOWN" || action == "") {        // Allow an undetermined but existing FSevent on our target to pass.        has_unknown = true;      }    }  }  EXPECT_TRUE(has_created || has_unknown);  CreateEvents();  sub->WaitForEvents(kMaxEventLatency, 2);  bool has_updated = false;  {    WriteLock lock(sub->mutex_);    // We may have triggered several updated events.    for (const auto& action : sub->actions_) {      if (action == "UPDATED") {        has_updated = true;      }    }  }  EXPECT_TRUE(has_updated);  EndEventLoop();}
开发者ID:folpindo,项目名称:osquery,代码行数:51,


示例24: AxisControl

//CONSTRUCTOR THAT ESTABLISHES THIS AS A ROS NODE, INIT PUBLIC VARIABLES HERE  AxisControl() : ros::node("axis_control_demo"), cv_bridge_(&image_, CvBridge<std_msgs::Image>::CORRECT_BGR), cv_image_(NULL), quit(false)  {    //This pops up an OpenCV highgui window and puts in mouse call back and 3 sliders	cvNamedWindow("cv_view", CV_WINDOW_AUTOSIZE);	cvSetMouseCallback("cv_view", left_mouse, 0);	cvCreateTrackbar("Pan", "cv_view", &g_pan, 350, pan_callback);	cvCreateTrackbar("Tilt", "cv_view", &g_tilt, 135, tilt_callback);	cvCreateTrackbar("Zoom", "cv_view", &g_zoom, 10000, zoom_callback);	//Ros stuff, subscribe to image and ptz state nodes    subscribe("image", image_, &AxisControl::image_cb, 1);    subscribe("ptz_state", ptz_state_, &AxisControl::ptz_cb, 1);	//Advertise that you'll be talking commands to the ptz    advertise<axis_cam::PTZActuatorCmd>("ptz_cmd", 1);	//I PRE SET THE COMMANDS HERE        g_pan = 175;	ptz_cmd_.pan.cmd   = g_pan - 175;	ptz_cmd_.pan.rel   = 0;	ptz_cmd_.pan.mode  = 0;	ptz_cmd_.pan.valid = 1;	g_pan_go = true;  //Start at 0	g_tilt = 45;	ptz_cmd_.tilt.cmd = g_tilt - 45;	ptz_cmd_.tilt.rel = 0;	ptz_cmd_.tilt.mode = 0;	ptz_cmd_.tilt.valid=1;	g_tilt_go = true;	g_zoom = 0;	ptz_cmd_.zoom.cmd = g_zoom;	ptz_cmd_.zoom.rel = 0;	ptz_cmd_.zoom.mode = 0;	ptz_cmd_.zoom.valid = 1;	g_zoom_go = true;  }
开发者ID:goretkin,项目名称:kwc-ros-pkg,代码行数:39,


示例25: reconfigureCallback

 void reconfigureCallback(jsk_perception::HoughLinesConfig &new_config, uint32_t level) {     config_ = new_config;     _rho            = config_.rho;     _theta          = config_.theta;     _threshold       = config_.threshold;     _minLineLength  = config_.minLineLength;     _maxLineGap     = config_.maxLineGap;     if (subscriber_count_)         { // @todo Could do this without an interruption at some point.             unsubscribe();             subscribe();         } }
开发者ID:HiroyukiMikita,项目名称:jsk_recognition,代码行数:14,


示例26: propertyChanged

    void EffortDisplay::setRobotDescription( const std::string& description_param )    {        description_param_ = description_param;        propertyChanged(robot_description_property_);        if ( isEnabled() )            {                load();                unsubscribe();                subscribe();                causeRender();            }    }
开发者ID:jstnhuang,项目名称:rviz_publish_shadow,代码行数:14,


示例27: state_

InteractiveMarkerClient::InteractiveMarkerClient(    tf::Transformer& tf,    const std::string& target_frame,    const std::string &topic_ns )    : state_("InteractiveMarkerClient",IDLE)    , tf_(tf){    target_frame_ = target_frame;    if ( !topic_ns.empty() )    {        subscribe( topic_ns );    }    callbacks_.setStatusCb( boost::bind( &InteractiveMarkerClient::statusCb, this, _1, _2, _3 ) );}
开发者ID:F34140r,项目名称:visualization-userfriendly,代码行数:14,


示例28: AbstractBox

LocalStorageBox::LocalStorageBox() : AbstractBox(), _clear(this, lang(lng_local_storage_clear), st::defaultBoxLinkButton), _close(this, lang(lng_box_ok), st::defaultBoxButton) {	connect(_clear, SIGNAL(clicked()), this, SLOT(onClear()));	connect(_close, SIGNAL(clicked()), this, SLOT(onClose()));	connect(App::wnd(), SIGNAL(tempDirCleared(int)), this, SLOT(onTempDirCleared(int)));	connect(App::wnd(), SIGNAL(tempDirClearFailed(int)), this, SLOT(onTempDirClearFailed(int)));	subscribe(FileDownload::ImageLoaded(), [this] { update(); });	checkLocalStoredCounts();	prepare();}
开发者ID:2asoft,项目名称:tdesktop,代码行数:14,


示例29: subscribe

	void LuaSystem::subscribeEntity(Entity &entity, const std::string &eventName)	{		// Subscribe the LuaSystem to the specified event, and tell that the		// entity that's related to this script is interested in such events.		LuaComponent *comp = entity.getComponent<LuaComponent>();		if(comp->subscribedEvents.find(eventName) == comp->subscribedEvents.end())		{			subscribe(eventName);			comp->subscribedEvents.insert(eventName);			m_subscribedScripts[eventName].push_back(&entity);		}	}
开发者ID:TrentSterling,项目名称:jlEngine,代码行数:14,



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


C++ subst函数代码示例
C++ subpicture_region_New函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。