本文整理汇总了C++中StringBuilder::count方法的典型用法代码示例。如果您正苦于以下问题:C++ StringBuilder::count方法的具体用法?C++ StringBuilder::count怎么用?C++ StringBuilder::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringBuilder
的用法示例。
在下文中一共展示了StringBuilder::count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
int8_t STM32F7USB::notify(ManuvrMsg* active_event) {
int8_t return_value = 0;
switch (active_event->eventCode()) {
case MANUVR_MSG_XPORT_QUEUE_RDY:
read_port();
if (_accumulator.count()) {
char* working_chunk = _accumulator.position(0);
if (write_port((uint8_t*) working_chunk, strlen(working_chunk))) {
// TODO: Fail-over timer? Disconnection signal?
_accumulator.drop_position(0);
}
}
return_value++;
break;
case MANUVR_MSG_SYS_BOOTLOADER:
case MANUVR_MSG_SYS_REBOOT:
case MANUVR_MSG_SYS_SHUTDOWN:
connected(false);
listening(false);
TM_USBD_Stop(TM_USB_FS); // DeInit() The USB device.
return_value++;
break;
default:
return_value += ManuvrXport::notify(active_event);
break;
}
if (local_log.length() > 0) Kernel::log(&local_log);
return return_value;
}
示例2: reset
/**
* This is called when the kernel attaches the module.
* This is the first time the class can be expected to have kernel access.
*
* @return 0 on no action, 1 on action, -1 on failure.
*/
int8_t STM32F7USB::attached() {
if (EventReceiver::attached()) {
read_abort_event.alterScheduleRecurrence(-1);
read_abort_event.alterSchedulePeriod(50);
read_abort_event.autoClear(false);
read_abort_event.enableSchedule(true);
#if !defined (__BUILD_HAS_THREADS)
platform.kernel()->addSchedule(&read_abort_event);
#endif
reset();
if (_accumulator.count() > 0) {
TM_USBD_CDC_Puts(TM_USB_FS, (const char*)_accumulator.string());
//_tx_in_progress = true;
TM_USBD_CDC_Process(TM_USB_FS);
}
return 1;
}
return 0;
}